Page 1 of 1

How to start Apache automatically at boot

Posted: 2008/02/02 14:40:58
by satimis
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]
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
[/code]


# ls -l /etc/rc.d/init.d/ | grep xinetd[code]
-rwxr-xr-x 1 root root 2497 Mar 15 2007 xinetd
[/code]


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

How to start Apache automatically at boot

Posted: 2008/02/02 15:36:48
by friguyb
in a terminal session execute the command ntsysv , this will show you all the services started at bootime, select httpd

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

Posted: 2008/02/02 16:13:46
by satimis
[quote]
friguyb wrote:
in a terminal session execute the command ntsysv , this will show you all the services started at bootime, select httpd[/quote]
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]
ntsysv.x86_64 1.3.30.1-1 installed
[/code]

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


B.R.
satimis

Re: How to start Apache automatically at boot

Posted: 2008/02/04 19:35:27
by ThinkingGuy
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.