ubuntu系统下关于apache2重启问题

来源:互联网 发布:淘宝免费赠品网 编辑:程序博客网 时间:2024/05/01 06:24

现象

服务器掉电,重启服务器虚拟系统后,客户端开SVN链接,提示服务器无法链接,此时,服务器的ip,虚拟系统ip都可以ping通。后来发现可能是重启服务器过程中,操作不当,恢复了某些配置,导致如下问题:

1、apache未启动 。于是执行service apache2 restart 命令时,出现以下报错:

apache2: Syntax error on line 207 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/httpd.conf: No such file or directory
Action 'configtest' failed.
The Apache error log may have more information.
   ...fail!

 2、domain name恢复成以前的修改。执行ervice apache2 restart 命令时,出现以下报错,且在apache重启成功后,从客户端依然无法连接到服务器URL,原因是domain name错误,导致URL连接指向错误:   

* Restarting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name, using 192.168
.217.6 for ServerName

 ... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 192.168.217.6 for ServerName


解决方法:

问题1:在报错目录下,重新创建httpd.conf文件(vim httpd.conf)即可;执行service apache2 restart 时重启可成功

问题2:sudo echo ServerName 192.168.218.6 >> /etc/apache2/httpd.conf      /*192.168.218.6为新的domain name*/

          

 再次重启apache,不报任何错误,重启成功!

原创粉丝点击