Stopping an specify Apache instance

Posted by user1435991 on Server Fault See other posts from Server Fault or by user1435991
Published on 2012-06-04T20:58:36Z Indexed on 2012/06/05 4:43 UTC
Read the original article Hit count: 566

Filed under:
|

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

© Server Fault or respective owner

Related posts about apache2

Related posts about solaris