LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1162|回复: 8

如何设置apache2为开机自动启动。

[复制链接]
发表于 2004-9-22 13:29:44 | 显示全部楼层 |阅读模式
我的rehat linux 9.0下安装了apache2,重启系统的时候必须手动启动apache2。我在setup->system services里也找到不到apache 和httpd服务项目。请各位仁兄帮忙。
发表于 2004-9-22 13:38:53 | 显示全部楼层
/etc/rc.d/rc.local

添加起动命令
 楼主| 发表于 2004-9-22 13:43:00 | 显示全部楼层

如何添加。

详细点。小弟对linux不熟。
发表于 2004-9-22 13:47:20 | 显示全部楼层
vi /etc/rc.d/rc.local


#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
                                                                                
touch /var/lock/subsys/local

/etc/init.d/httpd start   (按i插入此行)
~
~
~
~
~
~
~
~
~
~
~
~
~



按esc
输入:wq回车
发表于 2004-9-22 13:48:50 | 显示全部楼层
不应该啊,你确认安装成功了?
 楼主| 发表于 2004-9-22 14:16:28 | 显示全部楼层
当然成功了呀。我手动可以呀。/usr/local/apache2/bin/apachectl start
 楼主| 发表于 2004-9-22 14:52:07 | 显示全部楼层

谢谢了。

我搞好了。
我先将启动文件cp到/etc/rc.d/init.d/下。然后增加启动命令就好了。
但是还有一个问题,就是在setup的system service 里面没有httpd选项,所以很想知道这里面的项目是如何增加和删除的。
发表于 2004-9-23 13:21:36 | 显示全部楼层
系统启动时加载apache
cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/httpd
cd /etc/rc.d/rc3.d
ln -s ../init.d/httpd S80httpd
发表于 2004-9-23 16:32:49 | 显示全部楼层
/usr/local/apache2/bin/apachectl start

直接把这句添进rc.local不就行了..
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表