在centos中 将apache httpd 服务加入系统服务
2012-09-13 22:06
471 查看
昨天安装完成apache的安装,傻了吧唧还想用service httpd start 发现没有这个服务,老老实实的去度娘了下,也算是有了一点点的经验。
如果没有httpd 服务的时候,每次启动都要/usr/local/apache/bin/apachectl start好难受的说,下面就将httpd装到服务中,同理也可以用到其他服务的操作。
1.将apachectl文件copy一分到/etc/rc.d/init.d中,然后再/etc/rc.d/rc5.d中加入链接。
其中init.d中的脚本就相当于window中的注册表,在系统启动的时候某些指定的脚本被执行。而rc5.d就和rc3.d差不多吧。也都是一些脚本只是执行级别不同。
命令如下:
cp /usr/local/apache/bin/apachectl /etc/init.d/httpd
ls -s /etc/init.d/httpd /etc/rc.d/rc5.d/S85httpd
2.运行chkconfig --list 发现列表中没有httpd,通过chkconfig --add httpd来添加,可能会提示httpd服务不支持chkconfig,需要编辑/etc/rc.d/init.d/httpd
添加以下注视信息:
#chkconfig 345 85 15
# description: Activates/Deactivates Apache Web Server
345代表哪些linux级别需要启动httpd 启动序号是85 关闭序号是15
保存以后执行 chkconfig --add httpd 添加成功
3.运行chkconfig --list httpd 基本就存在了。然后就可以用了。service httpd start 和 service httpd stop
完成喽。比较肤浅,太高深的我也不会。。。
如果没有httpd 服务的时候,每次启动都要/usr/local/apache/bin/apachectl start好难受的说,下面就将httpd装到服务中,同理也可以用到其他服务的操作。
1.将apachectl文件copy一分到/etc/rc.d/init.d中,然后再/etc/rc.d/rc5.d中加入链接。
其中init.d中的脚本就相当于window中的注册表,在系统启动的时候某些指定的脚本被执行。而rc5.d就和rc3.d差不多吧。也都是一些脚本只是执行级别不同。
命令如下:
cp /usr/local/apache/bin/apachectl /etc/init.d/httpd
ls -s /etc/init.d/httpd /etc/rc.d/rc5.d/S85httpd
2.运行chkconfig --list 发现列表中没有httpd,通过chkconfig --add httpd来添加,可能会提示httpd服务不支持chkconfig,需要编辑/etc/rc.d/init.d/httpd
添加以下注视信息:
#chkconfig 345 85 15
# description: Activates/Deactivates Apache Web Server
345代表哪些linux级别需要启动httpd 启动序号是85 关闭序号是15
保存以后执行 chkconfig --add httpd 添加成功
3.运行chkconfig --list httpd 基本就存在了。然后就可以用了。service httpd start 和 service httpd stop
完成喽。比较肤浅,太高深的我也不会。。。
相关文章推荐
- 在Centos中 将apache httpd 服务加入系统服务
- Linux系统CentOS 7修改httpd服务Apache网站根目录/var/www/html
- Linux(CentOS)系统下安装好apache(httpd)服务后,其他电脑无法访问的原因
- centos 下 apache启动脚本加入系统服务列表
- Linux(CentOS)系统下安装好apache(httpd)服务后,其他电脑无法访问的原因
- Linux(CentOS)系统下安装好apache(httpd)服务后,其他电脑无法访问的原因
- 将httpd加入centos的系统服务
- Linux下把Mysql和Apache加入到系统服务里
- CentOS7.2配置Apache服务(httpd)--上篇
- Centos上将编译的apache加人系统服务
- Linux下将Mysql和Apache加入到系统服务里的方法
- linux下将apache和mysql加入系统服务
- centos6.4下安装apache的httpd服务
- Centos 6.5上Apache + PAM + SVN服务安装配置(使用本地系统用户认证)
- ECS CentOS 6.5系统下Apache配置https服务
- 在CentOS 7上利用systemctl加入自己定义系统服务
- Linux下将Mysql和Apache加入到系统服务里的方法
- Linux中将Apache加入到系统服务
- Linux下将Apache(httpd)新增为系统服务及开机自启动
- CentOS 7.2配置Apache服务httpd(下)