2011-03-15 68 views
-1

apache2.conf的实际目录是/etc/apache/apache.conf。并且有网站启用的目录。我将启用了网站的目录的目录路径更改为/ var/www/sites-enabled。更进一步,就可以改变的目录拍拍网站启用在apacche2.conf作为../../var/www/sites-enabled/apache2.conf错误

它引发错误

apache2: Syntax error on line 230 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/var/www/sites-enabled/: No such file or directory 
Action 'configtest' failed. 

任何想法我该如何解决这个问题?

放在正确的路径现在抛出这个错误

apache2: Syntax error on line 230 of /etc/apache2/apache2.conf: Could not open configuration file /var/www/sites-enabled/000-default: No such file or directory 
Action 'configtest' failed. 

感谢 让

回答

-3

这是由于权限错误 须藤的Apache2重启

1

你可能已经建立的晃来晃去,而前。你应该

d2dissite 000-default

取消关联然后用

a2ensite yoursite.com

0

我以前见过类似的错误,自己的网站添加别名。它发生在我安装新模块但配置错误的时候。我的解决方案是找到错误配置并删除配置文件。

如果错误是由相关的配置模块造成的,你可以尝试: /etc/init.d/apache2 -M 对我来说这产生错误信息 apache2: Syntax error on line 140 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/mods-enabled/ example.load: No such file or directory 我检查了目录,发现有一个example.load文件,我删除了它,并重新启动服务器,问题解决了。

一般情况下,我想你应该尝试:

  1. 定位这是错误的起源。 systemctl status apach2.status
  2. 如果它是由错误的模块配置产生的,请找到哪个配置文件是错误的来源。 /etc/init.d/apache2 restart

在你的情况下,可以通过网站上的配置错误引起的,您可以检查配置和正确地修改它。