ubuntu系统下关于apache2重启问题

现象

服务器掉电,重启服务器虚拟系统后,客户端开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,不报任何错误,重启成功!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值