httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wilda, Jet" <Jet.Wi...@ChasePaymentech.com>
Subject RE: [users@httpd] RE:How to start apache daemon in apache 2.2.8 on RHEL 5.1
Date Fri, 02 May 2008 17:45:15 GMT
Hi,

	We run multiple Apache httpd instances on Red hat all with
different server roots and here is how we do it  (I hope this is what
your asking,-).  Below are the steps we do to create a new server root
and binary (or symlink of a new binary to the old).  $ORIG_APACHE=httpd
and $NEW_APACHE=whatever_you_want and $BINDIR=/usr/sbin.

OLD_CONF=$ETC/$ORIG_APACHE
NEW_LOG=$APPLOG/$NEW_APACHE
NEW_CONF=$ETC/$NEW_APACHE

# create the new directory for the configuration files
mkdir $ETC/$NEW_APACHE

# create a logging directory
mkdir $NEW_LOG

# OK, now build out the configuration directory
ln -s $NEW_LOG $NEW_CONF/logs
ln -s /usr/lib/$ORIG_APACHE/modules $NEW_CONF/modules
ln -s $VAR/run $NEW_CONF/run

# link in a new executable
ln -s $BINDIR/$BINNAME $BINDIR/$NEWBINNAME

# copy in the configuration files
mkdir $NEW_CONF/conf
cp -Rp $OLD_CONF/conf/* $NEW_CONF/conf/

# make modifications to the configuration files
sed -e "s/$ORIG_APACHE\.pid/$NEW_APACHE\.worker\.pid/g" \
    -e "s/\/$ORIG_APACHE/\/$NEW_APACHE/g" --in-place
$NEW_CONF/conf/httpd.conf

# copy in the subordinate configuration files
mkdir $NEW_CONF/conf.d
cp -Rp $OLD_CONF/conf.d/* $NEW_CONF/conf.d/

# add 2 lines into /etc/sysconfig/$NEW_APACHE
echo "HTTPD=/usr/sbin/$NEWBINNAME" >> $ETC/sysconfig/$NEW_APACHE
echo "OPTIONS=\"-d $ETC/$NEW_APACHE\"" >> $ETC/sysconfig/$NEW_APACHE

# Copy the rc start script
cp $ETC/init.d/$ORIG_APACHE $ETC/init.d/$NEW_APACHE

#Add the the automatic startup scripts and set to start on boot
chkconfig --add $NEW_APACHE
chkconfig $NEW_APACHE on

Then just edit the $ETC/$NEW_APACHE/conf/httpd.conf and/or the
$ETC/$NEW_APACHE/conf.d/ssl.conf and as root 'service $NEW_APACHE
start'.  NOTE this assumes that you are using the default structure that
Red Hat lays it's Apache httpd down as.

One thing to NOTE is that we had to over-ride the killproc function in
'/etc/init.d/functions' because of the way it tries to find the pid of
what is running.  Since we symlink the binarys it would kill all the
running apache instances.

Hope that helps :-)
~Jet

-----Original Message-----
From: Eric Covener [mailto:covener@gmail.com] 
Sent: Friday, May 02, 2008 11:26 AM
To: users@httpd.apache.org
Subject: Re: [users@httpd] RE:How to start apache daemon in apache 2.2.8
on RHEL 5.1

On Fri, May 2, 2008 at 10:12 AM, Vinay Purohit
<Vinay.Purohit@trianz.com> wrote:
>  Thanks Eric :-)
>
>  Can you please provide little more detail on this. Precisely, I want
to
>  run multiple httpd based on the httpd.conf supplied as start
parameter.

Create a set of init scripts based on the one supplied by redhat, and
modify the invocation of apachectl or httpd within the script to pass
different -f parameters.

-- 
Eric Covener
covener@gmail.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
----------
Learn more about Chase Paymentech Solutions,LLC payment processing services at www.chasepaymentech.com.

THIS MESSAGE IS CONFIDENTIAL.  This e-mail message and any attachments are proprietary and
confidential information intended only for the use of the recipient(s) named above.  If you
are not the intended recipient, you may not print, distribute, or copy this message or any
attachments.  If you have received this communication in error, please notify the sender by
return e-mail and delete this message and any attachments from your computer.


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