Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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/'

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

share|improve this question

migrated from Jun 5 '12 at 0:37

This question came from our site for professional and enthusiast programmers.

Untested: Have you tried, /usr/apache2/bin/apachectl -k stop -f /etc/apache2-instance2/httpd.conf – EightBitTony Jun 5 '12 at 8:39
Perfect, it worked. – Jorge Marmolejo Jun 5 '12 at 16:22
ok, turned it into an answer then. – EightBitTony Jun 5 '12 at 16:57

You should be able to tell Apache to use the config file while shutting down.

/usr/apache2/bin/apachectl -k stop -f /etc/apache2-instance2/httpd.conf

that will make it look in the correct place for the PID.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.