ApacheApache

  Main Menu

Home: Linux: Apache: Run_apache_service
PHP Apache Home:

How to get Apache 2.xx to run as a service under Redhat 8.0. First, you have to get apache source. Go to www.apache.org and download it from a mirror near you, then follow the instructions. I have some simple compilation instructions here.

So, you have apache installed and can run it. But it won't auto-start on boot like you want it to, because you compiled it and and didn't get it setup like it would have if you installed it from rpm.

So, what you have to do is after the install (from ./configure; make; make install), do:
ln -s /usr/local/apache/bin/apachectl /etc/rc.d/init.d/httpd
cd /etc/rc3.d
ln -s ../httpd S90httpd

And it works just like downtown.

So, what is going on is, there is a startup script called /usr/local/apache/apachectl. There is a link to that file in /etc/rc.d/init.d, named httpd. And there is a link to that file in /etc/rc3.d called S90httpd.

The files again:
/usr/local/apache/bin/apachectl <--a real start-up script, created by the install
/etc/rc.d/init.d/httpd <-- a link you make to apachectl
/etc/rc3.d/S90httpd <-- a link you make to httpd

The even more better way is to use chkconfig. Checkout the chkconfig man page for details.

[root@www root]# chkconfig --help
chkconfig version 1.3.8 - Copyright (C) 1997-2000 Red Hat, Inc.
This may be freely redistributed under the terms of the GNU Public License.

usage:   chkconfig --list [name]
	chkconfig --add 
	chkconfig --del 
	chkconfig [--level ]  )

Under debian, you use update-rc.d.

 

Thus spake the master programmer:

``When the program is being tested, it is too late to make design changes.''