httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boyle Owen" <Owen.Bo...@swx.com>
Subject RE: [users@httpd] running two httpd.conf
Date Mon, 09 Dec 2002 08:28:19 GMT
It's not as complicated as you fear...

As I said in my first response, you can use the -f option to select the httpd.conf at start-up,
although you have to start apache directly with the binary and not use apachectl.

If you really must use apachectl, then just edit it a bit - it is only a shell script. One
simple way to do it, is to define different directories to keep the configs and pidfiles of
different instances, e.g. (I'm using canonical paths here - edit to suit your installation).

/usr/local/apache/server1
/usr/local/apache/server2 etc..

then inside apachectl, do something like:

SERVER=$1
HTTPD="/usr/local/apache/bin/httpd -f /usr/local/apache/${SERVER}/httpd.conf"
PIDFILE=/usr/local/apache/${SERVER}/httpd.pid

Then you start server1 with:

	# /usr/local/bin/apachectl server1

and so on...

Rgds,

Owen Boyle

>-----Original Message-----
>From: Farid Hamjavar [mailto:hamjavar@unm.edu]
>Sent: Freitag, 6. Dezember 2002 21:12
>To: users@httpd.apache.org
>Subject: RE: [users@httpd] running two httpd.conf
>
>
>
>Adam, thanks for sharing that with us.
>
>But things are not, as far I can see, that simple.
>
>For starters, that (/etc/init.d/httpd) is not the
>only file and there is  /etc/rc.d/init.d/functions
>and /usr/sbin/apachectl  .....
>
>Those files have a hard-coded path and pre-conceived
>notion of where pid and other httpd config files are.... 
>
>Doing a "service httpd stop/stats/restart"  involves
>much much more than just editing /etc/init.d/httpd
>as far as I can tell.
>
>
>Farid
>
>
>
>
>
>On Fri, 6 Dec 2002, Adam Cormany wrote:
>
>> Date: Fri, 6 Dec 2002 09:32:17 -0800 (PST)
>> From: Adam Cormany <acormany@yahoo.com>
>> Reply-To: users@httpd.apache.org
>> To: users@httpd.apache.org
>> Subject: RE: [users@httpd] running two httpd.conf
>> 
>> I am running apache 2.0.36 running multiple
>> configurations at once. I edited my /etc/init.d/httpd
>> to read a file I created called
>> /usr/local/apache/conf/httpd.names. In this file is a
>> list of configuration files that I want ran. Basically
>> the httpd script just loops through and runs them via
>> the '-f' flag. I haven't had any issues regarding this
>> change.
>> Adam
>> 
>> --- Farid Hamjavar <hamjavar@unm.edu> wrote:
>> > 
>> > You're right. the term 'installation' I used
>> > is confusing...
>> > 
>> > I meant 'Apache tree' let's call it....
>> > 
>> > Why do we want to have on Apache tree with two
>> > http.conf? We're not certain but one of the services
>> > we provide is really fast when it is run in
>> > httpd.conf
>> > when it owns it entirely (on another %100 identical
>> > system)
>> > ,  but when  it is run as a virtual host is 
>> > really slow ... too difficult to  explain.
>> > 
>> > 
>> > But I did look at more stuff and lot of things
>> > need to be ,in a non-standard fashion, tweaked ...
>> > 
>> > we need to have a separate apachectl, a separate
>> > /etc/init.d/httpd of course,  so on and so forth ...
>> > 
>> > It sounds really messy in terms of what needs to be 
>> >   
>> > changed and maintained that way after each OS
>> > upgrade ...
>> > 
>> > Farid
>> > 
>> > 
>> > On Fri, 6 Dec 2002, Boyle Owen wrote:
>> > 
>> > > Date: Fri, 6 Dec 2002 09:29:18 +0100
>> > > From: Boyle Owen <Owen.Boyle@swx.com>
>> > > Reply-To: users@httpd.apache.org
>> > > To: users@httpd.apache.org
>> > > Subject: RE: [users@httpd] running two httpd.conf
>> > > 
>> > > Assuming you mean "installation" = one copy of the
>> > httpd binary, then we
>> > > define an "instance" to be this binary running in
>> > memory. Since apache
>> > > 1.3 spawns many daemons, each instance of apache
>> > will have many daemons
>> > > associated with it but will be characterised by
>> > its parent process id
>> > > (kept in PidFile).
>> > > 
>> > > You can start as many instances as your OS will
>> > allow (eventually you'll
>> > > run out of process ids or something) and each
>> > instance can have a
>> > > different config file. In fact, each instance
>> > *must* have a different
>> > > config. This is because the config defines many
>> > process-specific
>> > > parameters which cannot be shared (such as
>> > PidFile, Listen, Port etc. -
>> > > you do realise that different instances cannot
>> > listen to the same
>> > > port/ip, don't you?).
>> > > 
>> > > In a complicated setup like this, I would
>> > recommend starting apache with
>> > > "-f" to define httpd.conf explicitly, e.g.
>> > > 
>> > > /usr/local/apache/bin/httpd -f
>> > /usr/local/apache/conf/httpd_1.conf
>> > > /usr/local/apache/bin/httpd -f
>> > /usr/local/apache/conf/httpd_2.conf, etc.
>> > > 
>> > > Otherwise, edit apachectl to take care of this.
>> > > 
>> > > You will then see the different processes in the
>> > process table and can
>> > > restart and stop them by sending signals to the
>> > root processes.
>> > > 
>> > > While different instances mustn't share Ports etc,
>> > they can share
>> > > logfiles and, of course, DocumentRoots and so on.
>> > > 
>> > > Rgds,
>> > > 
>> > > Owen Boyle
>> > > 
>> > > 
>> > > 
>> > > >-----Original Message-----
>> > > >From: Farid Hamjavar [mailto:hamjavar@unm.edu]
>> > > >Sent: Freitag, 6. Dezember 2002 05:05
>> > > >To: users@httpd.apache.org
>> > > >Subject: [users@httpd] running two httpd.conf
>> > > >
>> > > >
>> > > >
>> > > >apache 1.3.27 rh 7.x
>> > > >
>> > > >hello,
>> > > >
>> > > >We're in a situation where we must run a 
>> > > >single installation of Apache using two
>> > httpd.conf
>> > > >
>> > > >
>> > > >Is that doable (i.e. people are doing it often)?
>> > > >
>> > > >What are the  pitfalls in setting it up?
>> > > >
>> > > >How do we bring up/down daemons in such a way
>> > that
>> > > >httpds running under one httpd.conf does not
>> > effect 
>> > > >the other  httpds running under other httpd.conf?
>> > > >
>> > > >
>> > > >Thanks,
>> > > >Farid
>> > > >
>> > > >
>> > > >
>> > > >
>> > >
>> >
>> 
>>---------------------------------------------------------------------
>> > > >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
>> > > >
>> > > >
>> > > 
>> > > This message is for the named person's use only.
>> > It may contain
>> > > confidential, proprietary or legally privileged
>> > information. No
>> > > confidentiality or privilege is waived or lost by
>> > any mistransmission.
>> > > If you receive this message in error, please
>> > notify the sender urgently
>> > > and then immediately delete the message and any
>> > copies of it from your
>> > > system. Please also immediately destroy any
>> > hardcopies of the message.
>> > > You must not, directly or indirectly, use,
>> > disclose, distribute, print,
>> > > or copy any part of this message if you are not
>> > the intended recipient.
>> > > The sender's company reserves the right to monitor
>> > all e-mail
>> > > communications through their networks. Any views
>> > expressed in this
>> > > message are those of the individual sender, except
>> > where the message
>> > > states otherwise and the sender is authorised to
>> > state them to be the
>> > > views of the sender's company. 
>> > > 
>> > >
>> >
>> ---------------------------------------------------------------------
>> > > 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
>> > > 
>> > 
>> > 
>> >
>> ---------------------------------------------------------------------
>> > 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
>> > 
>> 
>> 
>> __________________________________________________
>> Do you Yahoo!?
>> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
>> http://mailplus.yahoo.com
>> 
>> ---------------------------------------------------------------------
>> 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
>> 
>
>
>---------------------------------------------------------------------
>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
>
>

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


Mime
View raw message