Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

migrated from stackoverflow.com 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. –  user1435991 Jun 5 '12 at 16:22
    
ok, turned it into an answer then. –  EightBitTony Jun 5 '12 at 16:57

1 Answer 1

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

 
discard

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.