将apache添加为开机启动与编译的httpd不支持chkconfig的解决方法
2012-08-21 14:20
375 查看
将apache添加为开机启动有两个方法:
一、在/etc/rc.d/rc.local内加入启动命令 /usr/local/apache2/bin/apachectl -k start
二、将apache添加为系统服务
将apachectl文件拷贝到/etc/rc.d/init.d 中,然后在/etc/rc.d/rc5.d/下加入链接即可。
命令如下:
cp /usr/local/apache2/bin/apachectl /etc/rc.d/init.d/apache
chmod +x /etc/rc.d/init.d/apache
ln -s /etc/rc.d/init.d/apache /etc/rc.d/rc5.d/S85apache //建立链接(85的意义后面介绍)
编辑/etc/rc.d/init.d/apache,添加以下注释信息:
# chkconfig: 2345 85 15
# description: Activates/Deactivates Apache Web Server #必须有!
第一行3个数字参数意义分别为:哪些Linux级别需要启动httpd(2,3,4,5);启动序号(85);关闭序号(15)。
3、运行chkconfig apache on
在rc2.d、rc3.d、rc4.d、rc5.d路径中会出现S85httpd的链接文件
[root@cccc httpd]# ls /etc/rc.d/rc2.d/|grep apache
S85apache
此时Apache就可以自动启动了。
本文出自 “Fate” 博客,请务必保留此出处http://yyzll.blog.51cto.com/4283444/968172
一、在/etc/rc.d/rc.local内加入启动命令 /usr/local/apache2/bin/apachectl -k start
二、将apache添加为系统服务
将apachectl文件拷贝到/etc/rc.d/init.d 中,然后在/etc/rc.d/rc5.d/下加入链接即可。
命令如下:
cp /usr/local/apache2/bin/apachectl /etc/rc.d/init.d/apache
chmod +x /etc/rc.d/init.d/apache
ln -s /etc/rc.d/init.d/apache /etc/rc.d/rc5.d/S85apache //建立链接(85的意义后面介绍)
编辑/etc/rc.d/init.d/apache,添加以下注释信息:
# chkconfig: 2345 85 15
# description: Activates/Deactivates Apache Web Server #必须有!
第一行3个数字参数意义分别为:哪些Linux级别需要启动httpd(2,3,4,5);启动序号(85);关闭序号(15)。
3、运行chkconfig apache on
在rc2.d、rc3.d、rc4.d、rc5.d路径中会出现S85httpd的链接文件
[root@cccc httpd]# ls /etc/rc.d/rc2.d/|grep apache
S85apache
此时Apache就可以自动启动了。
本文出自 “Fate” 博客,请务必保留此出处http://yyzll.blog.51cto.com/4283444/968172
相关文章推荐
- 将apache添加为开机启动与编译的httpd不支持chkconfig的解决方法
- 编译的httpd不支持chkconfig的解决方法
- 编译的httpd不支持chkconfig的解决方法
- Apache启动错误Permission denied: httpd: could not open error log file解决方法
- 编译apache报错:httpd-2.4.4/support/ab.c:2271: undefined reference to `TLSv1_1_client_method'解决方法
- apache不支持chkconfig的解决方法
- tomcat 服务不支持 chkconfig 以及其他服务不能添加到开机启动时的操作
- centos 7 添加 nfs 开机启动失败解决方法
- apache 不支持 chkconfig 解决方法
- 用VS编译QT工程,启动公共语言支持后,QT的drag和drop失常解决方法
- apache不能启动的解决方法
- UBUNTU添加开机自动启动程序方法
- 安装XAMPP时启动Apache失败解决方法 xampp-win32-1.8.3-1-VC11-installer
- 电脑开机后多了OneKey Ghost启动选项解决方法
- tomcat 5.5启动时出现The Apache Tomcat Native library which allows optimal performance 错误的解决方法
- linux开机启动服务和chkconfig使用方法(自定义服务路径启动)
- java+tomcat+apache安装整合,启动/关闭,添加开机启动服务
- 解决第三方类库无法通过armv7s编译的方法、添加Default-568h@2x.png
- wamp Apache和mysql服务无法启动的终极解决方法!!!!!!
- phpstudy 中apache无法启动 启动一下就关闭的解决方法