tags:

views:

57

answers:

1

I have two different config files (server1.conf & server2.conf). I need to use each of them to spawn an instance of apache.

/etc/init.d/apache2 start does let me specify which config file apache uses, it defaults to apache2.conf.

apache2ctl -f /etc/apache2/server1.conf -k start works, but when I try to spawn another instance it says that the PID is already in use.

apache2 -f /etc/apache2/server1.conf -k start I get an error saying apache2: bad user name ${APACHE_RUN_USER}.

How can I fix this?


AS an aside, I need to instances of Apache running because I'm using mod_rails/passenger with it at that will only support one SSL certificate (even if you specify many). Hence, 2 instances to 2 support 2 certs.

+1  A: 

You don't need two instances. You need 2 virtual hosts listening on 2 different IP addresses. Apache can serve multiple SSL certs, just only one per IP address. Otherwise, the cleanest and easiest way to do this in my past has been to duplicate most everything: the binary, the conf path, and init scripts.

f4nt