删除MAMP后从终端启动apache时出错 [英] Error starting apache from terminal after removing MAMP
问题描述
我最近删除了MAMP.
I removed MAMP recently.
当我尝试使用以下方法从Terminal启动apache时:
When I try to start apache from Terminal using:
sudo apachectl -k restart
我收到消息
Warning: DocumentRoot [usr/docs/dummy-host.example.com] does not exist.
推荐答案
首先,通过发出以下命令,确保您实际上正在尝试执行apachectl的正确版本:
First, make sure you're actually trying to execute the proper version of apachectl by issuing the following command:
which apachectl
(您不想在那里看到任何MAMP引用).
(You don't want to see any MAMP references there).
下一步,找到您的虚拟主机配置(如果您的MAMP引用不存在,则可能在此处)
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>
((如果您使用的不是我上面定义的"localhost"以外的自定义服务器名称,只需确保您的/etc/hosts文件是该条目的最新内容,例如:
(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
别忘了重新启动apache!
Don't forget to restart apache!
sudo apachectl restart
这篇关于删除MAMP后从终端启动apache时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!