Two instances of Apache on the same server
Yedidyah Bar-David
linux-il at didi.bardavid.org
Tue Oct 5 15:58:32 IST 2010
On Tue, Oct 05, 2010 at 03:42:10PM +0200, Gabor Szabo wrote:
> I need to run two instances of Apache on the same SuSE based server but there
> is something very basic I don't manage. In order to run to servers
> I'll need two pid files
> to hold the two process ids. So the first thing I tried was to change
> the pidfile for the existing server.
>
> I shut down Apache and the changed /etc/init.d/apache2
> the following line:
>
> : ${pidfile:=/var/run/httpd2.pid}
>
> to:
>
> : ${pidfile:=/var/run/httpd2b.pid}
[snip]
No recent experience with SuSE, but you probably have to also edit
apache's configuration file, perhaps somewhere in /etc/apache or
/etc/httpd or something like that. Search for 'PidFile'.
This is/was true for most distros. Debian (now, don't know since when)
keeps it in /etc/apache2/envvars, and both the init.d script and apache's
conf file are somehow set from it.
Personally, when I had to, I kept it only in httpd.conf, and wrote a
trivial init.d script that calls 'apachectl -f $CFG -k stop' to stop it,
instead of messing with pidfiles by itself. So far, it worked well.
Naturally, you might have problems e.g. if you change the conf while
apache is up, or stuff like that.
--
Didi
More information about the Linux-il
mailing list