Linux注册apache服务开机启动
2014-04-18 10:57
561 查看
将apache添加为开机启动有两个方法:
1、在/etc/rc.d/rc.local内加入启动命令
/usr/local/apache2/bin/apachectl start
2、将http添加为系统服务
httpd 0:关闭 1:关闭 2:关闭 3:关闭 4:关闭 5:关闭 6:关闭
[root@localhost ~]# chkconfig --level 345 httpd on
[root@localhost ~]# chkconfig --list|grep httpd
httpd 0:关闭 1:关闭 2:关闭 3:启用 4:启用 5:启用 6:关闭
如果出现
root@localhost ~]# chkconfig --add httpd
httpd 服务不支持 chkconfig
解决过程如下:
编辑/etc/rc.d/init.d/httpd
[root@localhost ~]# chkconfig --add httpd
[root@localhost ~]# chkconfig --list|grep httpd
httpd 0:关闭 1:关闭 2:关闭 3:关闭 4:关闭 5:关闭 6:关闭
[root@localhost ~]# chkconfig --level 345 httpd on
[root@localhost ~]# chkconfig --list|grep httpd
httpd 0:关闭 1:关闭 2:关闭 3:启用 4:启用 5:启用 6:关闭
1、在/etc/rc.d/rc.local内加入启动命令
/usr/local/apache2/bin/apachectl start
2、将http添加为系统服务
cp /usr/local/apache2/bin/apachectl /etc/rc.d/init.d/httpd chmod +x /etc/rc.d/init.d/httpd [root@localhost ~]# chkconfig --add httpd [root@localhost ~]# chkconfig --list|grep httpd
httpd 0:关闭 1:关闭 2:关闭 3:关闭 4:关闭 5:关闭 6:关闭
[root@localhost ~]# chkconfig --level 345 httpd on
[root@localhost ~]# chkconfig --list|grep httpd
httpd 0:关闭 1:关闭 2:关闭 3:启用 4:启用 5:启用 6:关闭
如果出现
root@localhost ~]# chkconfig --add httpd
httpd 服务不支持 chkconfig
解决过程如下:
编辑/etc/rc.d/init.d/httpd
#chkconfig:345 61 61 //此行的345参数表示,在哪些运行级别启动,启动序号(S61);关闭序号(K61) #description:Apache httpd //此行必写,描述服务.添加上面2行就可以了。
[root@localhost ~]# chkconfig --add httpd
[root@localhost ~]# chkconfig --list|grep httpd
httpd 0:关闭 1:关闭 2:关闭 3:关闭 4:关闭 5:关闭 6:关闭
[root@localhost ~]# chkconfig --level 345 httpd on
[root@localhost ~]# chkconfig --list|grep httpd
httpd 0:关闭 1:关闭 2:关闭 3:启用 4:启用 5:启用 6:关闭
相关文章推荐
- Apache Isis 1.4.0 发布,领域驱动开发框架
- Linux快速构建apache web服务器
- Awstats处理多apache日志
- 安装perl模块小窍门
- PHP+Apache在Windows 9x下的安装和配置
- Apache服务器配置全攻略
- Apache Web让JSP“动”起来
- Linux Apache+MySQL+PHP
- 建立Apache+PHP+MySQL数据库驱动的动态网站
- apache 环境下 php 的配置注意事项
- 在RedHat下安装apache jserv 1.1.2方法
- windows中PHP5.2.14以及apache2.2.16安装配置方法第1/2页
- 解析阿里云ubuntu12.04环境下配置Apache+PHP+PHPmyadmin+MYsql
- apache rewrite防盗链三例
- Apache 配置详解(最好的APACHE配置教程)
- Apache+php+mysql在windows下的安装与配置(图文)第1/2页
- apache rewrite_module模块使用教程
- Apache rewrite重写规则的常见应用
- 关于Apache默认编码错误 导致网站乱码的解决方案
- Linux Apache Web 服务器(续一)