我正在尝试创建一个 MAMP 虚拟主机,以便我可以更轻松地使用我的 Laravel 项目,但是无论我做什么,当输入 localhost 或我的 vh 名称(cms.dev)时,我都会得到“未找到请求的 URL/未在此服务器上找到” )
我试过这个:如何在 MAMP 中创建虚拟主机?而这个:http : //eppz.eu/blog/virtual-host-for-mamp-on-osx/
即使重新安装了 MAMP,我仍然有同样的问题,我按照这些文章中显示的方式做了所有事情。
这是我的 httpd-vhosts.conf 配置:
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "/Desktop/MAMP"
ServerName localhost
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-host.example.com-error_log"
CustomLog "logs/dummy-host.example.com-access_log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "/Desktop/MAMP/cms/public"
ServerName cms.dev
ErrorLog "logs/dummy-host2.example.com-error_log"
CustomLog "logs/dummy-host2.example.com-access_log" common
</VirtualHost>
大家知道怎么回事吗???
谢谢
你的DocumentRoot
路径是错误的。在 MacOS 中,桌面文件夹位于/Users/[yourusername]/Desktop
.
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句