You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Spike Burkhardt <bu...@ssd.loral.com> on 2005/08/15 23:06:04 UTC

[users@httpd] Multiple apache instances

All,

  I have two apache instances running.  Is there a way to kill just 1 
instance?  To be more specific, I have 1 startup file with the standard 
startup.  In the httpd.conf file, it specifies:

PidFile /usr/local/apache/logs/httpd.pid

In the second startup file the line that starts the server is:

httpd - f /usr/local/apache/conf/httpd-oracal.conf start
and the PidFile line reads:

PidFile /usr/local/apache/logs/httpd-oracal.pid.

Can I tell apache only to stop this instance or should I write a script 
to do it?

FYI, I'm running Apache 1.3.31 with mod_perl 1.29, mod_fastcgi 2.4.2, 
mod_ssl 2.8.19 and OpenSSL 9.9.7c.  This is on Solaris 8.

TIA,

spike

Re: [users@httpd] Multiple apache instances

Posted by Spike Burkhardt <bu...@ssd.loral.com>.
Thanks for all the info Joshua.  Seems like I might have a reason to 
upgrade to V2 :-)

spike

Joshua Slive wrote:

>On 8/16/05, Spike Burkhardt <bu...@ssd.loral.com> wrote:
>  
>
>>Joshua & all,
>>
>>  When I specified the configuration file the instance I wanted to kill
>>still didn't stop.  In fact, it stopped the other instance!  Also, at
>>least on my box, '-k' isn't a valid option. 
>>    
>>
>
>I didn't notice you were using such an old version.  The command I
>quoted works in 2.x.
>
>For your version, you need to use the other technique I mentioned
>(killing the process listed in the pid file).  If you open up
>apachectl in an editor, you'll note that this is exactly what it is
>doing.  But it has a hard-coded path to the config file for your first
>server.  You could easily edit apachectl to make a "stop2" option
>which would get the pid from the appropriate file for the second
>server.
>
>This is, by the way, documented at
>http://httpd.apache.org/docs/1.3/stopping.html
>
>Joshua.
>
>---------------------------------------------------------------------
>The official User-To-User support forum of the Apache HTTP Server Project.
>See <URL:http://httpd.apache.org/userslist.html> for more info.
>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org
>
>  
>

Re: [users@httpd] Multiple apache instances

Posted by Joshua Slive <js...@gmail.com>.
On 8/16/05, Spike Burkhardt <bu...@ssd.loral.com> wrote:
> Joshua & all,
> 
>   When I specified the configuration file the instance I wanted to kill
> still didn't stop.  In fact, it stopped the other instance!  Also, at
> least on my box, '-k' isn't a valid option. 

I didn't notice you were using such an old version.  The command I
quoted works in 2.x.

For your version, you need to use the other technique I mentioned
(killing the process listed in the pid file).  If you open up
apachectl in an editor, you'll note that this is exactly what it is
doing.  But it has a hard-coded path to the config file for your first
server.  You could easily edit apachectl to make a "stop2" option
which would get the pid from the appropriate file for the second
server.

This is, by the way, documented at
http://httpd.apache.org/docs/1.3/stopping.html

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Multiple apache instances

Posted by Spike Burkhardt <bu...@ssd.loral.com>.
Joshua & all,

  When I specified the configuration file the instance I wanted to kill 
still didn't stop.  In fact, it stopped the other instance!  Also, at 
least on my box, '-k' isn't a valid option.  Finally, the error messages 
I got was:

root:comet:/ #  apachectl -f /usr/local/apache/conf/httpd-oracal.conf stop
usage: /usr/local/apache/bin/apachectl 
(start|stop|restart|fullstatus|status|graceful|configtest|help)

start      - start httpd
startssl   - start httpd with SSL enabled
stop       - stop httpd
restart    - restart httpd if running by sending a SIGHUP or start if
             not running
fullstatus - dump a full status screen; requires lynx and mod_status enabled
status     - dump a short status screen; requires lynx and mod_status 
enabled
graceful   - do a graceful restart by sending a SIGUSR1 or start if not 
running
configtest - do a configuration syntax test
help       - this screen

usage: /usr/local/apache/bin/apachectl 
(start|stop|restart|fullstatus|status|graceful|configtest|help)

start      - start httpd
startssl   - start httpd with SSL enabled
stop       - stop httpd
restart    - restart httpd if running by sending a SIGHUP or start if
             not running
fullstatus - dump a full status screen; requires lynx and mod_status enabled
status     - dump a short status screen; requires lynx and mod_status 
enabled
graceful   - do a graceful restart by sending a SIGUSR1 or start if not 
running
configtest - do a configuration syntax test
help       - this screen

/usr/local/apache/bin/apachectl stop: httpd stopped


Joshua Slive wrote:

>On 8/15/05, Spike Burkhardt <bu...@ssd.loral.com> wrote:
>  
>
>>All,
>>
>> I have two apache instances running.  Is there a way to kill just 1
>>instance?  To be more specific, I have 1 startup file with the standard
>>startup.  In the httpd.conf file, it specifies:
>>
>>PidFile /usr/local/apache/logs/httpd.pid
>>
>>In the second startup file the line that starts the server is:
>>
>>httpd - f /usr/local/apache/conf/httpd-oracal.conf start
>>and the PidFile line reads:
>>
>>PidFile /usr/local/apache/logs/httpd-oracal.pid.
>>
>>Can I tell apache only to stop this instance or should I write a script
>>to do it?
>>    
>>
>
>Either apachectl -f /usr/local/apache/conf/httpd-oracal.conf -k stop
>or just
>kill `cat /usr/local/apache/logs/httpd-oracal.pid`
>
>Joshua.
>
>---------------------------------------------------------------------
>The official User-To-User support forum of the Apache HTTP Server Project.
>See <URL:http://httpd.apache.org/userslist.html> for more info.
>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org
>
>  
>

Re: [users@httpd] Multiple apache instances

Posted by Joshua Slive <js...@gmail.com>.
On 8/15/05, Spike Burkhardt <bu...@ssd.loral.com> wrote:
> All,
> 
>  I have two apache instances running.  Is there a way to kill just 1
> instance?  To be more specific, I have 1 startup file with the standard
> startup.  In the httpd.conf file, it specifies:
> 
> PidFile /usr/local/apache/logs/httpd.pid
> 
> In the second startup file the line that starts the server is:
> 
> httpd - f /usr/local/apache/conf/httpd-oracal.conf start
> and the PidFile line reads:
> 
> PidFile /usr/local/apache/logs/httpd-oracal.pid.
> 
> Can I tell apache only to stop this instance or should I write a script
> to do it?

Either apachectl -f /usr/local/apache/conf/httpd-oracal.conf -k stop
or just
kill `cat /usr/local/apache/logs/httpd-oracal.pid`

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Multiple apache instances

Posted by Alexander Lazic <al...@none.at>.
Hi,

On Mon 15.08.2005 14:41, Spike Burkhardt wrote:
>
>  thanks for the info.  What I did forget to mention is that the
>  multiple instances are running from the same directory tree.

just some tasks to do:

1. cp apachectl apachectl_1
2. vi apachectl_1
   change the HTTPD variable with the -f $CONFIGFILE
   change the PIDFILE variable to the PidFile in you httpd_1.conf 
3. change the PidFile to another File then in you first instanz,
   but it must be the same location as in the apachectl_1 file
4. change all other options e. g. DocumentRoot, *Log, ...
5. start you new apache

Hth

al ;-)

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Multiple apache instances

Posted by Craig Dunigan <cd...@doit.wisc.edu>.
Now that I look closer at your original message, I should have been 
able to tell that from the paths.  As Joshua already said, apachectl 
responds to all or nearly all of the same switches that httpd does, so 
use the appropriate combination to control the separate instances.  My 
main point was not to write your own control script when a well-tested 
one comes with Apache.

-- 
Craig Dunigan
IS Technical Services Specialist
Middleware - EIS - DoIT
University of Wisconsin, Madison

opinions expressed are my own, not the University's

On Mon, 15 Aug 2005, Spike Burkhardt wrote:

> Craig,
> 
>   thanks for the info.  What I did forget to mention is that the 
> multiple instances are running from the same directory tree. 
> 
> spike
> 
> Craig Dunigan wrote:
> 
> >Each instance should already have its own control script, apachectl, 
> >in the bin directory, with paths specific to that instance.
> >
> >  
> >
> 



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Multiple apache instances

Posted by Spike Burkhardt <bu...@ssd.loral.com>.
Craig,

  thanks for the info.  What I did forget to mention is that the 
multiple instances are running from the same directory tree. 

spike

Craig Dunigan wrote:

>Each instance should already have its own control script, apachectl, 
>in the bin directory, with paths specific to that instance.
>
>  
>

Re: [users@httpd] Multiple apache instances

Posted by Craig Dunigan <cd...@doit.wisc.edu>.
Each instance should already have its own control script, apachectl, 
in the bin directory, with paths specific to that instance.

-- 
Craig Dunigan
IS Technical Services Specialist
Middleware - EIS - DoIT
University of Wisconsin, Madison

opinions expressed are my own, not the University's

On Mon, 15 Aug 2005, Spike Burkhardt wrote:

> All,
> 
>   I have two apache instances running.  Is there a way to kill just 1 
> instance?  To be more specific, I have 1 startup file with the standard 
> startup.  In the httpd.conf file, it specifies:
> 
> PidFile /usr/local/apache/logs/httpd.pid
> 
> In the second startup file the line that starts the server is:
> 
> httpd - f /usr/local/apache/conf/httpd-oracal.conf start
> and the PidFile line reads:
> 
> PidFile /usr/local/apache/logs/httpd-oracal.pid.
> 
> Can I tell apache only to stop this instance or should I write a script 
> to do it?
> 
> FYI, I'm running Apache 1.3.31 with mod_perl 1.29, mod_fastcgi 2.4.2, 
> mod_ssl 2.8.19 and OpenSSL 9.9.7c.  This is on Solaris 8.
> 
> TIA,
> 
> spike
> 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org