问题描述
我最近删除了MAMP。
当我尝试使用从终端启动Apache:
须藤apachectl中-k重启
我收到消息
警告:DocumentRoot的[USR /文档/ dummy-host.example.com]不存在。
首先,确保你实际上是试图通过发出以下命令来执行apachectl中的正确版本:
这apachectl中
(你不希望看到有任何MAMP参考资料)。
接下来,找到你的虚拟主机的配置(这是很可能在这里,如果你的MAMP引用都消失了)
/etc/apache2/extra/httpd-vhosts.conf
请确保您的虚拟主机定义都不错。 (听起来你引用一个坏的)。
<虚拟主机*:80>
站长的ServerAdmin @本地
的DocumentRoot/用户/您的用户名/网站/ mysite的
服务器名mysite.local
错误日志/私营/无功/日志/的Apache2 / mysite的,error_log中
的CustomLog/私营/无功/日志/的Apache2 / mysite的,访问日志共同
< /虚拟主机>
(如果你使用的不是'localhost'的像我上面定义的其他自定义服务器名称,只是确保你的/ etc / hosts文件是最新的,像这样的条目:
127.0.0.1 mysite.local
不要忘了重新启动Apache!
须藤apachectl中重启
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.
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
这篇关于错误删除MAMP之后开始从终端的Apache(使用豹)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!