Macports MAMP Yosemite无法加载vhost - vhost无法正常工作

时间:2015-05-21 11:02:14

标签: macos mamp vhosts yosemite

我遇到macports vhost问题,我无法加载site.local

我的行动: 我安装了yosemite osx(全新安装) 2.然后我从app store下载了最新版本的xcode 2.1。同意终端中的Xcode许可证:sudo xcodebuild -license 3.通过苹果开发者网站安装命令行工具 4.并按照macports官方网站安装apache,mysql和php(网站:https://trac.macports.org/wiki/howto/MAMP

我可以打开localhost(顺便说一下127.0.0.1无法正常工作),但直接访问我的site.local不起作用。请你帮助我好吗。我的conf文件如下:

文件:/ etc / hosts

day_iterator itr(time_from.date());
while (itr <= time_to.date()) {
  std::cout << (*itr) << std::endl;
  ++itr;
}

文件:/opt/local/apache2/conf/extra/httpd-vhosts.conf

127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost

127.0.0.1 localhost.com www.localhost.com

127.0.0.1 site.local
127.0.0.1 www.site.local

文件:/opt/local/apache2/conf/httpd.conf

NameVirtualHost *:80

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot "/opt/local/apache2/htdocs"
    ServerName localhost.com
    ServerAlias www.localhost.com
    ErrorLog "logs/localhost-error_log"
    CustomLog "logs/localhost-access_log" common
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin webmaster@mh.local
    DocumentRoot "/opt/local/apache2/htdocs/site"
    ServerName site.local
    ServerAlias www.site.local
    ErrorLog "logs/site.local-error_log"
    CustomLog "logs/site.local-access_log" common
</VirtualHost>

提前感谢您提供解决方案。

1 个答案:

答案 0 :(得分:-1)

在httpd.conf中,尝试更改(在Directory /下)

AllowOverride None

AllowOverride All

然后

sudo apachectl restart

此外,您的路径以:

开头
 /opt/local/apache2/conf/

尝试更改以下文件:

/etc/apache2/