Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error starting apache from terminal after removing MAMP

I removed MAMP recently.

When I try to start apache from Terminal using:

sudo apachectl -k restart

I am getting the message

Warning: DocumentRoot [usr/docs/dummy-host.example.com] does not exist.
like image 361
redconservatory Avatar asked Jul 12 '11 20:07

redconservatory


1 Answers

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
like image 153
Jared Cobb Avatar answered Nov 08 '22 07:11

Jared Cobb