2016-03-15 101 views
0

我試圖在我的桌面上爲我的本地環境設置LAMP,使用Guy Nathan's Installing LAMP stack on OSX Mavericks with Homebrew updated guide。由於我在RoR經歷,我繼續進行的自制軟件,但一路走來,看樣子,我錯誤配置的/usr/local/etc/apache2/2.2/httpd.conf文件,因爲每當我試圖用sudo apachectl start或測試與sudo apachectl configtest啓動Apache服務器,則不約而同地返回以下錯誤:如何重新配置​​本地LAMP環境的Apache httpd.conf文件?

httpd: Syntax error on line 482 of /usr/local/etc/apache2/2.2/httpd.conf: Could not open configuration file /Sites/httpd-vhosts.conf: No such file or directory 

由於'http.conf'文件的長度,我創建了一個gist of my 'httpd.conf file'供審閱。

在這一點上,我只想重置我的'httpd.conf'文件,或者任何必要的東西,所以我可以正確配置我的LAMP本地環境。我試過其他解決方案,涉及/private/etc/apache2/httpd.conf.pre-update的回覆,但無法生效。謝謝。

回答

1

由於httpd.conf文件指定包含/Sites/httpd-vhosts.conf(不存在),因此無法啓動。

通過在行的開頭加上#註釋掉第482行,或者創建一個空的/Sites/httpd-vhosts.conf文件,以便將其包含在內。如果它是空的,它不會有任何影響。

這是一些examples通常會在該文件中。

+0

謝謝,@ drew010。 – alexanderjsingleton

+0

@alexanderjsingleton很高興這是它! – drew010