标题:Linux 下 Apache 以服务级别运行 出处:gOxiA=苏繁=SuFan Blog 时间:Sat, 17 Dec 2005 18:32:56 +0000 作者:gOxiA 地址:https://goxia.maytide.net/read.php/796.htm 内容: 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服务。 Generated by Bo-blog 2.1.1 Release