How to start Apache automatically at boot

General support questions including new installations

How to start Apache automatically at boot

Postby satimis » 2008/02/02 14:40:58

Hi folks,


VMWare Server
Ubuntu 7.04 server amd64 (Host)
CentOS 5 x86_64 (Guest)


I need to start Apache2 at boot. I have xinetd installed and could not figure out how to set it for such a function.


# ls /etc/xinetd.d/
Code: Select all
chargen-dgram   discard-stream  gssftp          tcpmux-server
chargen-stream  echo-dgram      klogin          time-dgram
daytime-dgram   echo-stream     krb5-telnet     time-stream
daytime-stream  eklogin         kshell         
discard-dgram   ekrb5-telnet    rsync 



# ls -l /etc/rc.d/init.d/ | grep xinetd
Code: Select all
-rwxr-xr-x 1 root root  2497 Mar 15  2007 xinetd



Besides I tried to reconfigure Apache2 and cound not find dpkg-reconfigure which is Debian package. What will be its equivalent on CentOS? Is there yum repo providing this package? TIA


B.R.
satimis
satimis
 
Posts: 112
Joined: 2006/11/14 14:24:08

How to start Apache automatically at boot

Postby friguyb » 2008/02/02 15:36:48

in a terminal session execute the command ntsysv , this will show you all the services started at bootime, select httpd
friguyb
 
Posts: 16
Joined: 2005/09/11 13:40:08
Location: Paris, France

Re: How to start Apache automatically at boot (SOLVED)

Postby satimis » 2008/02/02 16:13:46

friguyb wrote:
in a terminal session execute the command ntsysv , this will show you all the services started at bootime, select httpd

Thanks for your advice. I got it done now.


I have been playing around with ntsysv on Xterm before unable to run it as root.

# yum list installed | grep ntsysv
Code: Select all
ntsysv.x86_64                            1.3.30.1-1             installed


The package has been installed. Now I found the trick. It must be run as super root (su -).


B.R.
satimis
satimis
 
Posts: 112
Joined: 2006/11/14 14:24:08

Re: How to start Apache automatically at boot

Postby ThinkingGuy » 2008/02/04 19:35:27

You can also change whether services start at boot with the [font=Courier]chkconfig[/font] command. For example, to have Apache (which Centos calls httpd instead of apache2 as in Debian/Ubuntu) start only in runlevels 3,4, and 5, use this command:

[font=Courier]chkconfig --level 234 httpd on[/font]

This command will list the current setting for httpd:

[font=Courier]chkconfig --list httpd[/font]

Centos usually defaults to booting to runlevel 3 (standard multi-user) or 5 (multi-user with graphical logon).
You can display the previous and current runlevels with the [font=Courier]runlevel[/font] command.

Oh yeah, the [font=Courier]chkconfig[/font] command will have to be run as root.

Hope this helps.
ThinkingGuy
 
Posts: 4
Joined: 2008/01/28 18:51:47


Return to CentOS 5 - General Support

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot], Google [Bot] and 9 guests