2011-03-15 67 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

在你的情況下,可以通過網站上的配置錯誤引起的,您可以檢查配置和正確地修改它。