最近经常服务器要重启,一重启网站就跳到了apache的默认首页,猜想是没开机启动apache,而且上级又不知道搞了个什么主机宝在服务器上,所以跳到那里去
#重启服务器后发现httpd被另外一个httpd占用着
netstat -nlp |grep httpd

#只好杀掉了
killall httpd

#但是执行httpd重启又没有报错
service httpd restart

chkconfig httpd on
#返回service httpd does not support chkconfig


vi /etc/init.d/httpd  #或者vi /etc/rc.d/init.d/httpd
#在第二行加入
# chkconfig: 2345 10 90

# description: Activates/Deactivates Apache Web Server

#然后执行
chkconfig --add httpd
#没报错就行了
chkconfig httpd on

reboot #重启服务器

#访问网站发现成功了

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注