简体   繁体   中英

How to reconfigure apache httpd.conf file for local LAMP environment?

I was attempting to set-up my local environment for LAMP on my desktop with Guy Nathan's Installing LAMP stack on OSX Mavericks with Homebrew updated guide . Since I'm experienced with RoR, I proceeded with homebrews but along the way, evidently, I misconfigured the /usr/local/etc/apache2/2.2/httpd.conf file because whenever I try to start the apache server with sudo apachectl start or test with sudo apachectl configtest , the following error is invariably returned:

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

Due to the length of the 'http.conf' file, I've created a gist of my 'httpd.conf file' for review.

At this point, I would just like to reset my 'httpd.conf' file, or whatever is necessary so I can properly configure my local environment for LAMP. I've tried other solutions involving a reversion of /private/etc/apache2/httpd.conf.pre-update but was unable to effect. Thank you.

It is failing to start because the httpd.conf file is specifying an include of /Sites/httpd-vhosts.conf which doesn't exist.

Either comment out line 482 by putting a # at the beginning of the line, or create an empty /Sites/httpd-vhosts.conf file so it can be included. If its empty it won't have any effect.

Here are some examples of what would typically go in that file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM