Error starting apache from terminal after removing MAMP

半腔热情 提交于 2019-12-03 07:07:20

First, make sure you're actually trying to execute the proper version of apachectl by issuing the following command:

which apachectl

(You don't want to see any MAMP references there).

Next, find your virtual hosts config (which is likely here if your MAMP references are gone)

/etc/apache2/extra/httpd-vhosts.conf

Make sure your virtual host definitions are good. (Sounds like you're referencing a bad one).

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot "/Users/yourusername/Sites/mysite"
    ServerName mysite.local
    ErrorLog "/private/var/log/apache2/mysite-error_log"
    CustomLog "/private/var/log/apache2/mysite-access_log" common
</VirtualHost>

(If you're using a custom server name other than 'localhost' like I've defined above, just be sure your /etc/hosts file is up to date with that entry like this:

127.0.0.1          mysite.local

Don't forget to restart apache!

sudo apachectl restart

You probably need to go to apache config file (something like etc/apache2/apache2.conf) and set it an existing document root directory. That is usually done with DocumentRoot directive in this file, or one of the included virtual host config definitions.

Make sure you comment out all the lines inside the /etc/apache2/extra/httpd-vhosts.conf file otherwise you will get the errors.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!