1

I have the following problem. I have two domains: www.domain1.de and www.domain2.de I also have path is on Jelastic server where to find my PHP page myphpsite.jelastic.dogado.eu.

Now I wanted to do the following.

1) If I go to www.domain1.de, then should address bar of the Web Browser www.domain1.de be displayed, but the page is fetched from myphpsite.jelastic.dogado.eu.

2) When I go to www.domain2.de, then should address bar of the Web Browser www.domain2.de be displayed, but the page is fetched from myphpsite.jelastic.dogado.eu / admin /.

so

1) www.domain1.de -> myphpsite.jelastic.dogado.eu 2) www.domain2.de -> myphpsite.jelastic.dogado.eu / admin /

The first one I can do by CNAM Record

But we can I solve the second problem without frames?

thank you

user1167253
  • 813
  • 1
  • 11
  • 27
  • [Server Fault](http://serverfault.com/) may be a better place for this question. – Sverri M. Olsen Mar 14 '14 at 07:58
  • Other than implementing some very complex scraping mechanism, I don't think you can do this without using a single frame frameset. There is only so much obfuscation a web browser will let you do. – Garreth McDaid Mar 14 '14 at 09:25

1 Answers1

2

This is just a matter of configuring Apache VirtualHosts (assuming that you're using Apache), or Nginx Server Blocks (if you're using Nginx). Leo's link can help you with either of them, within a Jelastic context (where to find those config files etc.): http://docs.jelastic.com/multiple-domains-php

Here's a quick example for Apache:

<VirtualHost *:80>
    DocumentRoot /var/www/webroot/ROOT
    ServerName domain1.de
    ServerAlias www.domain1.de
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot /var/www/webroot/ROOT/admin
    ServerName domain2.de
    ServerAlias www.domain2.de
</VirtualHost>

You might also wish to define different log files for each domain etc. There are many possibilities, and since Jelastic gives you direct access to the server config. files you can configure almost anything that you could want here. It's just a matter of reviewing the Apache (or Nginx) docs and trying it out.

Notes:

  1. Beware that the Jelastic default configuration defines a wildcard to catch all requests. You need to place your custom configuration before that (either literally, or via an include), or else overwrite the default VirtualHost configuration block - otherwise your config. will not have any effect.
  2. The above example handles HTTP only. If you need to handle HTTPS, you need to configure this separately. (e.g. :443 instead of :80)
  3. Remember that you need to restart Apache (or Nginx) for config. changes to take effect.

See also:

Damien - Layershift
  • 1,508
  • 8
  • 15
  • As I understand it also be set the document root. That means that the PHP scripts under .. / webroot / ROOT / admin can not access resouces of / webroot / ROOT? but I need that the PHP scripts under .. / webroot / ROOT / admin on resouces of / webroot / ROOT access? – user1167253 Mar 14 '14 at 11:44
  • I guess you are talking about open_basedir restrictions? You can edit those to suit your needs: http://stackoverflow.com/questions/223800/how-can-i-relax-phps-open-basedir-restriction – Damien - Layershift Mar 15 '14 at 09:54
  • Please post details about your workaround in case others have the same issue – Damien - Layershift Mar 22 '14 at 00:05