March 16, 2006

Mini howto for Red Hat Linux Network and Internet Services

Mini howto for Linux Network and Internet services, using chkconfig
and service commands.

Easy way in Red Hat is by using the service command.
Swith to user root. su -
If you don't you will get bash: chkconfig: command not found

# service httpd stop
# service httpd start

This will not make permanent changes in you run control directories.
So if you want to make a permanent change to the run control
for a service, you will have to issue the chkconfig command.

Like this,

# chkconfig httpd off

Verify it with

# chkconfig --list httpd

You will see something like this in your output.

httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off

So the next time you reboot, httpd will not start by
the run control scripts. You may of course be able to start it
manually with the command (as user root)

# service httpd start

If you really want to make sure the httpd process is up,
you can check the daemon and if it is listening on your network
interface. (Ready to accept connections from the network)

$ ps -ef | grep httpd
$ netstat -ap | grep http

The output from the ps command should look something like this
root 23291 1 0 Mar11 ? 00:00:02 /usr/sbin/httpd
apache 22444 32227 0 Mar 11 ? 00:00:34 /usr/sbin/httpd

The output should look something like this. (netstat)
tcp 0 0 *:http *:* LISTEN -

These command goes for all services listed by the
# chkconfig --list