Linux下设置apache开机启动 - onlyfu's Blog
linux apache开启伪静态

Linux下设置apache开机启动

onlyfu posted @ 2011年10月15日 05:24 in Linux , 779 阅读

测试环境:
1、apache 2.2.9,安装在/usr/local/apahce2下
2、red hat enterprise linux 5
第一步:
cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/httpd //如果有其他的版本的Apache存在,也可以直接覆盖掉
第二步:
使用编辑器打开httpd文件,并在第一行#!/bin/sh下增加两行文字如下
# chkconfig: 35 70 30
# description: Apache
接着注册该服务
chkconfig –add httpd
一切OK了,启动服务
service httpd start
其中所增加的第二行中三个数字第一个表示在运行级别3和5下启动apache,第二、三是关于启动和停止的优先级配置,无关紧要。


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter