Apache无法启动故障一例
帮兔兔配置VPS,在VPS重启之后,发现站点无法访问。
在查看服务后,发现apache的服务httpd没有启动。
执行
|
[root@VPS123 ~]# service httpd start [root@VPS123 ~]# service httpd restart httpd not running, trying to start |
很坑爹。。。
仔细看了一下,发现主机名发生了变化,原始为VPS,重启后主机名变化为VPS123。
因主机名变化,所以Apache无法启动。遂修改/etc/hosts文件
|
[root@VPS123 ~]# vim /etc/hosts # Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 VPS localhost.localdomain localhost ::1 localhost6.localdomain6 localhost6 |
将第四行(高亮行)修改为
|
[root@VPS123 ~]# vim /etc/hosts # Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 VPS123 localhost.localdomain localhost ::1 localhost6.localdomain6 localhost6 |
修改后,:wq退出VIM。
执行
|
[root@VPS123 ~]# service httpd start |
即可。[......]
继续阅读