Running runlevel command on my centos linux machines displays default run level as 5.You must be wondering what runlevel has to do with by autostarting apache server. There is reason for that Linux uses different run levels to boot and you should know default runlevel where you would like to configure apache to autostart during boot.
Next you have to use magic command called chkconfig on fedora to list the apache (httpd) services runlevel:
[root@node12 ~]# chkconfig --list httpd httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off |
In chkconfig output off means apache (httpd) service is set with no autostart for associated runlevels. Since my default runlevel is 5 , I need to set apache to autostart in runlevel 5 using chkconfig. Here is how you can turn apache autostart for your default run level :
[root@node12 ~]# chkconfig --level 5 httpd on |
If your default run level is 3 then you should use 3 in above command. You can also run
[root@node12 ~]# chkconfig --level 235 httpd on
to make ur apache run on level 2,3 and 5.
Now to check if autostart is set as on during boot
Run checkconfig again :
[root@node12 ~]# chkconfig --list httpd httpd 0:off 1:off 2:off 3:off 4:off 5:on 6:off |
No comments:
Post a Comment