I have two Apache instances setup in my server (Solaris 10):
Instance 1: /etc/apache2
Instance 2: /etc/apache2-instance2
To start the instance 1, I execute the following command:
/usr/apache2/bin/apachectl -f /etc/apache2/httpd.conf
And instance 2:
/usr/apache2/bin/apachectl -f /etc/apache2-instance2/httpd.conf
Both instances run perfectly, however the problem comes when I want to stop the instances. I have not been able to find a parameter to indicate what instance I want to stop. if I execute this command:
/usr/apache2/bin/apachectl -k stop
It will stop always the Instance 1 (the default one).
The only solution that I could find to stop the instance 2 was to do this:
kill -TERM 'cat /var/run/apache2-instance2/httpd.pid'
Is this the only way to do it? or what is the best solution?
I remember that I did something similar in Ubuntu setting a the global variable APACHE_CONFDIR before calling apachectl
Best Answer
You should be able to tell Apache to use the config file while shutting down.
that will make it look in the correct place for the PID.