RedHat: Add httpd service method cp/usr/local/apache2/bin/apachectl/etc/rc. d/init. d/httpd added the httpd service vi/etc/rc. d/init. d/httpd: Add # chkconfig:-2nd # description: ApacheisaWorldWideWebserver in row 8515. I
How to add httpd service in RedHat
Cp/usr/local/apache2/bin/apachectl/etc/rc. d/init. d/httpd add httpd service
Vi/etc/rc. d/init. d/httpd
Add in row 2nd
# Chkconfig:-85 15
# Description: Apache is a World Wide Web server. It is used to serve \
# HTML files and CGI.
1. Add the httpd service:
[Root @ localhost ~] # Chkconfig -- add httpd
2. view the httpd service:
[Root @ localhost ~] # Chkconfig -- list | grep httpd
Httpd 0: Close 1: Close 2: Close 3: Close 4: Close 5: Close 6: Close
3. Run the httpd service automatically at startup:
[Root @ localhost ~] # Chkconfig -- level 345 httpd on
4. view the httpd service status:
[Root @ localhost ~] # Chkconfig -- list | grep httpd
Httpd 0: Disable 1: Disable 2: Disable 3: Enable 4: Enable 5: Enable 6: Disable