Linux 下 Apache 以服务级别运行

[ 2005/12/17 18:32 | by gOxiA ]
| |

Apache以服务级别在系统启动时自动启动的方法找了很长时间都没有找到,最近因为在连续学习Linux翻看了很多资料,偶然间从 Discuz 官方论坛上找到了如果将 Apache 加入到服务中的办法:

1.cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/httpd

2.vi /etc/rc.d/init.d/httpd

3.在httpd文件的第三行下面,插入以下两句话:
# chkkconfig: 345 85 15
# description: Starts and stops the Apache HTTP Server.

4.chmode +x /etc/rc.d/init.d/httpd          //把httpd变成可执行文件

5.chkconfig --add httpd

6.chkconfig --list          //也可以使用 ntsysv 命令来检查是否载入到启动服务列表中

成功后,就可以用 service httpd start or restart or stop 来启动、重启、停止 Apache服务。

开源系统 | 评论(1) | 引用(0) | 阅读(6305)
发表评论
昵称 [注册]
密码 游客无需密码
网址
电邮
打开HTML 打开UBB 打开表情 隐藏 记住我