删除 MAMP 后从终端启动 apache 时出错
我最近删除了 MAMP。
当我尝试使用以下命令从终端启动 apache 时:
sudo apachectl -k restart
我收到消息
Warning: DocumentRoot [usr/docs/dummy-host.example.com] does not exist.
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
首先,通过发出以下命令确保您实际上正在尝试执行正确版本的 apachectl:(
您不希望在那里看到任何 MAMP 引用)。
接下来,找到您的虚拟主机配置(如果您的 MAMP 引用消失,则可能会出现在此处)
确保您的虚拟主机定义正确。 (听起来你引用的是一个坏的)。
(如果您使用的自定义服务器名称不是我上面定义的“localhost”,只需确保您的 /etc/hosts 文件与该条目是最新的,如下所示:
不要忘记重新启动 apache!
First, make sure you're actually trying to execute the proper version of apachectl by issuing the following command:
(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)
Make sure your virtual host definitions are good. (Sounds like you're referencing a bad one).
(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:
Don't forget to restart apache!
您可能需要转到 apache 配置文件(例如
etc/apache2/apache2.conf
)并将其设置为现有文档根目录。这通常是通过此文件中的DocumentRoot
指令或包含的虚拟主机配置定义之一来完成的。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 withDocumentRoot
directive in this file, or one of the included virtual host config definitions.确保注释掉 /etc/apache2/extra/httpd-vhosts.conf 文件中的所有行,否则会出现错误。
Make sure you comment out all the lines inside the /etc/apache2/extra/httpd-vhosts.conf file otherwise you will get the errors.