Having Ubuntu on virtual machine. Running Apache and need 2 virtual hosts on different ports, e.g. 69 and 100. (On 80 running nginx with php-fpm + fastcgi). Using port forwarding to host system to access from browser like localhost:69/ or localhost:100/
Config /etc/apache2/sites-available/default :
<VirtualHost *:69>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
...
<IfModule mod_fastcgi.c>
AddHandler php5-fcgi .php
Action php5-fcgi /php5-fcgi
Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -socket /var/run/php5-fpm.sock -pass-header Authorization
</IfModule>
</VirtualHost>
<VirtualHost *:100>
ServerAdmin webmaster@localhost
DocumentRoot /var/html
...
</VirtualHost>
Added those ports as well to /etc/apache2/ports.conf
PHP not working for 2nd virtual host. If I add same <IfModule mod_fastcgi.c>
directive i get error:
FastCgiExternalServer: redefinition of previously defined class "/usr/lib/cgi-bin/php5-fcgi"
What is correct way to configure it?