There are several possibilities to use mod_php4 and mod_php5 in parallel on the same Apache 1.3.x server. For example, if you have plenty of free IPs, you could just set up a new nameserver entry to assign two host names to two different IPs and then use two Apache instances, both running on port 80 and grabbing one of those two IPs.
Another possibility is to use only one IP, two Apache installations, mod_proxy and mod_rewrite: configure the first Apache to run on port 80 and use mod_php4, for example. The second Apache, located at /usr/local/apache-php5/ (or whereever you place it), will run on another port (i.e. port 5555 or something like that) and have mod_php5 compiled with it (so when compiling PHP5, you have to use –with-apxs=/usr/local/apache-php5/bin/apachectl).
You configure the second apache to have it’s PHP5 host:
NameVirtualHost IP:5555 <VirtualHost IP:5555> Port 5555 ServerName php5.domain.de DocumentRoot /my/docroot </VirtualHost>
If you access http://php5.domain.de:5555/ and have a phpinfo.php for example, you will see PHP5 running on it.
The first Apache on port 80 has a special VirtualHost entry to tunnel it to the front:
<VirtualHost IP> Port 80 ServerName php5.domain.de RewriteEngine On RewriteRule ^/(.*) http://php5.domain.de:5555/$1 [P] </VirtualHost>
You use the proxying mechanism in combination with mod_rewrite to get it through. The user on the front doesn’t see anything that the PHP5 vhost originally runs on port 5555. Remember to filter requests on 5555 in your firewall :-)
Any other ideas? Let me know.
Schreibe einen Kommentar