This page will describe a couple of ways in which you can get Linux (specifically RedHat) to start certain applications (any application really) at boot time. Some of the common apps that people may want to configure to start automatically are Apache, MySQL, Tomcat, JBoss, Zope, xinetd, etc. Most versions of RedHat should come with this handy tool called chkconfig

You may find that it is not in your path by default (eg: on my linux box, chkconfig is in /sbin, but I did not have /sbin in my path by default. So I added /sbin to my path first, in order to gain access to chkconfig easily on the commandline, without having to type /sbin/chkconfig. The first thing you might want to try is something like the following:

netfs           0:off   1:off   2:off   3:on    4:on    5:on    6:off
network 0:off 1:off 2:on 3:on 4:on 5:on 6:off
iptables 0:off 1:off 2:on 3:on 4:on 5:on 6:off
sshd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
nfs 0:off 1:off 2:off 3:off 4:off 5:off 6:off
sendmail 0:off 1:off 2:on 3:on 4:on 5:on 6:off
crond 0:off 1:off 2:on 3:on 4:on 5:on 6:off
httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
xinetd 0:off 1:off 2:off 3:on 4:on 5:on 6:off
xinetd based services:
chargen-udp: off
rsync: off
chargen: off
daytime-udp: off
daytime: off
echo-udp: off
echo: off
services: off
servers: off
time-udp: off
time: off
cups-lpd: off
sgi_fam: on
ktalk: off
cvspserver: on

The output above is a partial output of the command

chkconfig —list

What the output is basically telling you is which apps that have startup scripts in /etc/init.d are configured to be in an on/off state at which run level. In my example, I want to configure my linux machine to have httpd (which is Apache) start on boot, so the command I want to type to get this to happen is:

chkconfig httpd on

This will ensure that my service httpd from /etc/init.d is in a started state at (by default) run levels 2, 3, 4, and 5 (for all intents and purposes, these run levels indicate a “normal” machine state, describing what all of the run levels mean is much beyond the scope of this document). Now if I reboot my machine, I will notice that httpd was started automatically at boot.