3 chkconfig --add apache 表5APACHE服务启动的方法 把服务加入系统 序号 1 2 3 命令 find / -name apachectl ***路径/apachectl start ***路–version 径 /apachectl 备注 查看apachectl命令的位置 运行apachectl命令 查看版本 表6配置APACHE服务设置开机自启动 序号 命令 备注 1 grep -v \以apachectl脚本/usr/local/apache-2.2.15/bin/apachectl > 为模板生成/etc/init.d/apache Apache服务控制 2 vi /etc/init.d/apache #!/bin/sh # chkconfig: 2345 85 15 脚本 用vi编辑Apache服务控制脚本 在文件里添加该3条命令 增加Apache服务控制脚本执行权限 将Apache服务加入到系统服务 检查Apache服务是否已经生效 启动Apache服务 停止Apache服务 3 # description: Apache is a World Wide Web server. chmod +x /etc/init.d/apache 4 5 6 7 8 chkconfig --add apache chkconfig --list apache service apache start service apache stop 9
echo \设置开机自启/usr/local/apache45/bin/apachectl/apachectl 动,把apache启start\动命令加到 /etc/rc.loacl文件