Forum Moderators: phranque
It is always
www.example.com
oder
www.example2.com:8080
There is only one possibility: Your provider installs a redirect to port 8080 for that specific domain. This way your users can access the second domain via
www.example2.com
but this slows down speed and costs money. Subdomains are not possible.
Maybe there are other solutions, but i donīt know.
Imagine your servers ip is 111.0.0.111
Install Apache/php5
Make a copy of the httpd.conf and edit it for PHP4
PHP5-config file should have
Listen 111.0.0.111:80
...
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
...
NameVirtualHost 111.0.0.111:80
The second one should have
Listen 127.0.0.1:8080 # Or whatever port you'd like
...
NameVirtualHost 127.0.0.1:8080
Then comes the trick - Let's say you want www.example.com to be php5 enabled and www2.example.com to be php4 enabled. You do it by making the php5 enabled server pass requests for php4 enabled server onto the other instance:
PHP5-config:
<VirtualHost 111.0.0.111:80>
ServerName www.example.com
DocumentRoot d:\www_docs
</VirtualHost><VirtualHost 111.0.0.111:80>
ServerName www2.example.com
ProxyPass / http://127.0.0.1:8080/
</VirtualHost>
PHP4-config:
<VirtualHost 127.0.0.1:8080>
ServerName www2.example.com
DocumentRoot d:\www_docs
</VirtualHost>
Now stick info.php containing phpinfo(); in d:\www_docs and watch the magic going on at www.example.com/info.php and www2.example.com/info.php :)
So easy, so very useful, and totally awesome :D