You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Peter N Lewis <pe...@stairways.com.au> on 2006/06/07 04:29:14 UTC

[users@httpd] Running multiple httpd daemons

On my server, I run the httpd daemon twice, using almost identical 
httpd.conf files, one on the main port (the live server) and one on a 
high numbered port (my working draft).  Then I edit the 
files/configuration of the working draft server, restarting it as 
necessary.  When all changes are in place, I rsync the working files 
to the live files, update the live server's httpd.conf file (by 
script, based on the working draft version) and restart the live 
server.

This all works fine, but one issue I have is running multiple copies. 
I do this by having two copies of apachectl with different 
configuration.  The problem is, apachectl is really part of the 
apache install, and so any time it is upgrade, I need to grab a new 
copy of apachectl and reconfigure the two different versions.  In 
fact, what I do is patch apacheclt by adding:

while [ $# -ne 0 ]
do
         case "$1" in
                 --pidfile=*) PIDFILE=`echo "$1" | sed -e 's/^[^=]*=//'` ;;
                 --httpd=*) HTTPD=`echo "$1" | sed -e 's/^[^=]*=//'` ;;
                 --lynx=*) LYNX=`echo "$1" | sed -e 's/^[^=]*=//'` ;;
                 --statusurl=*) STATUSURL=`echo "$1" | sed -e 's/^[^=]*=//'` ;;
                 *)
                         break
                 ;;
         esac
         shift
done

after the configuration section, and having my own apachectl-live and 
apachectl-work that just call apachectl with parameters.

Is there a better way to do this without patching or duplicating 
apachectl, or alternatively, can I request that apachectl be modified 
to support receiving parameters so that it doesn't need to be patched?

I use 1.3.x, but I checked the latest 2.x source and it looks like 
apachectl still doesn't receive parameters, although it has a complex 
data driven chunk of code to generate the config parameters so adding 
the above code would require understanding that data driven stuff, 
presumably not hard for whoever maintains it.

Thanks,
    Peter.

-- 
Check out Interarchy 8, just released.
<http://www.stairways.com/>  <http://download.stairways.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


Re: [users@httpd] Running multiple httpd daemons

Posted by Peter N Lewis <pe...@stairways.com.au>.
At 21:48 -0500 6/6/06, William A. Rowe, Jr. wrote:
>apachectl should not change significantly, why not just leave it alone
>between minor subversion bumps?

That's true, and I could just copy apachectl twice, configure both 
and then hope nothing changes, but it disturbs me to copy something 
out of the distribution and then not update it.  If someone fixes a 
bug or changes a parameter, I wont pick up the change.

At 9:41 -0600 7/6/06, David Salisbury wrote:
>Perhaps you can educate me on this one Peter.  Why use apachectl at all?
>You could write a script outside of the install, that centers around :
>
>/path/to/httpd -f  /path/httpd.conf.name -k  [stop,start,restart]

httpd -k [stop,start,restart] appears to be a new feature of 2.x. 
It's not in 1.3 as far as I can see.

It just seems to me that apachectl taking parameters is better than 
having to modify apachectl, but I guess there wont likely be many 
changes to 1.3 that would affect apachectl, and from the looks of it, 
apachectl is no longer really needed under 2.x, just use httpd -k 
directly, so I guess I just live with the issue until I upgrade to 
2.x, and then switch to httpd instead of apachectl.

Thanks,
    Peter.

-- 
Check out Interarchy 8, just released.
<http://www.stairways.com/>  <http://download.stairways.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


Re: [users@httpd] Running multiple httpd daemons

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
apachectl should not change significantly, why not just leave it alone
between minor subversion bumps?

Peter N Lewis wrote:
> On my server, I run the httpd daemon twice, using almost identical 
> httpd.conf files, one on the main port (the live server) and one on a 
> high numbered port (my working draft).  Then I edit the 
> files/configuration of the working draft server, restarting it as 
> necessary.  When all changes are in place, I rsync the working files to 
> the live files, update the live server's httpd.conf file (by script, 
> based on the working draft version) and restart the live server.
> 
> This all works fine, but one issue I have is running multiple copies. I 
> do this by having two copies of apachectl with different configuration.  
> The problem is, apachectl is really part of the apache install, and so 
> any time it is upgrade, I need to grab a new copy of apachectl and 
> reconfigure the two different versions.  In fact, what I do is patch 
> apacheclt by adding:
> 
> while [ $# -ne 0 ]
> do
>         case "$1" in
>                 --pidfile=*) PIDFILE=`echo "$1" | sed -e 's/^[^=]*=//'` ;;
>                 --httpd=*) HTTPD=`echo "$1" | sed -e 's/^[^=]*=//'` ;;
>                 --lynx=*) LYNX=`echo "$1" | sed -e 's/^[^=]*=//'` ;;
>                 --statusurl=*) STATUSURL=`echo "$1" | sed -e 
> 's/^[^=]*=//'` ;;
>                 *)
>                         break
>                 ;;
>         esac
>         shift
> done
> 
> after the configuration section, and having my own apachectl-live and 
> apachectl-work that just call apachectl with parameters.
> 
> Is there a better way to do this without patching or duplicating 
> apachectl, or alternatively, can I request that apachectl be modified to 
> support receiving parameters so that it doesn't need to be patched?
> 
> I use 1.3.x, but I checked the latest 2.x source and it looks like 
> apachectl still doesn't receive parameters, although it has a complex 
> data driven chunk of code to generate the config parameters so adding 
> the above code would require understanding that data driven stuff, 
> presumably not hard for whoever maintains it.
> 
> Thanks,
>    Peter.
> 

---------------------------------------------------------------------
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] Running multiple httpd daemons

Posted by David Salisbury <sa...@globe.gov>.
Perhaps you can educate me on this one Peter.  Why use apachectl at all?
You could write a script outside of the install, that centers around :

/path/to/httpd -f  /path/httpd.conf.name -k  [stop,start,restart]

-ds

----- Original Message ----- 
From: "Peter N Lewis" <pe...@stairways.com.au>
To: <us...@httpd.apache.org>
Sent: Tuesday, June 06, 2006 8:29 PM
Subject: [users@httpd] Running multiple httpd daemons


> On my server, I run the httpd daemon twice, using almost identical 
> httpd.conf files, one on the main port (the live server) and one on a 
> high numbered port (my working draft).  Then I edit the 
> files/configuration of the working draft server, restarting it as 
> necessary.  When all changes are in place, I rsync the working files 
> to the live files, update the live server's httpd.conf file (by 
> script, based on the working draft version) and restart the live 
> server.
> 
> This all works fine, but one issue I have is running multiple copies. 
> I do this by having two copies of apachectl with different 
> configuration.  The problem is, apachectl is really part of the 
> apache install, and so any time it is upgrade, I need to grab a new 
> copy of apachectl and reconfigure the two different versions.  In 
> fact, what I do is patch apacheclt by adding:
> 
> while [ $# -ne 0 ]
> do
>         case "$1" in
>                 --pidfile=*) PIDFILE=`echo "$1" | sed -e 's/^[^=]*=//'` ;;
>                 --httpd=*) HTTPD=`echo "$1" | sed -e 's/^[^=]*=//'` ;;
>                 --lynx=*) LYNX=`echo "$1" | sed -e 's/^[^=]*=//'` ;;
>                 --statusurl=*) STATUSURL=`echo "$1" | sed -e 's/^[^=]*=//'` ;;
>                 *)
>                         break
>                 ;;
>         esac
>         shift
> done
> 
> after the configuration section, and having my own apachectl-live and 
> apachectl-work that just call apachectl with parameters.
> 
> Is there a better way to do this without patching or duplicating 
> apachectl, or alternatively, can I request that apachectl be modified 
> to support receiving parameters so that it doesn't need to be patched?
> 
> I use 1.3.x, but I checked the latest 2.x source and it looks like 
> apachectl still doesn't receive parameters, although it has a complex 
> data driven chunk of code to generate the config parameters so adding 
> the above code would require understanding that data driven stuff, 
> presumably not hard for whoever maintains it.
> 
> Thanks,
>    Peter.
> 
> -- 
> Check out Interarchy 8, just released.
> <http://www.stairways.com/>  <http://download.stairways.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