如何在 OSX 中更改 xampp htdocs 目录? [英] how to change xampp htdocs directory in OSX?

查看:31
本文介绍了如何在 OSX 中更改 xampp htdocs 目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想更改 XAMPP 的 htdocs 目录.我按照说明从这个问题创建了一个虚拟主机:

I want to change XAMPP's htdocs directory. I followed the instructions to create a virtual host from this question:

在 htdocs 之外制作 XAMPP/Apache 服务文件

这在 Windows 7 上运行良好,但是当我在 OSX 上尝试时,转到 mysite.local 只会加载 xampp 启动画面 (mysite.local/xampp/index.html).我已经重新启动了 Web 服务器.我在 httpd-vhosts.conf 中声明的虚拟主机是:

this works fine on Windows 7, however when I try it on OSX, going to mysite.local just loads the xampp splash screen (mysite.local/xampp/index.html). I have restarted the web server. My virtual host declared in httpd-vhosts.conf is:

<VirtualHost *:80>

DocumentRoot Users/username/Documents/sitename.com

ServerName sitename.localhost

<Directory Users/username/Documents/sitename.com>

Order allow,deny 
Allow from all

</Directory>

推荐答案

通过编辑httpd.conf解决

solved by editing httpd.conf

我已经开始工作了.根据 http://www.acwolf.com/blog/2009/February/xampp-virtual-hosts-mac,在OSX中需要对httpd.conf做两处修改,一是取消注释

I have got this working. As per http://www.acwolf.com/blog/2009/February/xampp-virtual-hosts-mac, in OSX it is necessary to make two changes to httpd.conf, first, uncomment

#Include /Applications/xampp/etc/extra/httpd-vhosts.conf

然后,将用户从 nobody 更改为您用于登录 OSX 的用户名.您可能还需要删除浏览器的缓存.

and second, change the user from nobody to the username you use to log into OSX. You may also need to delete your browser's cache.

这篇关于如何在 OSX 中更改 xampp htdocs 目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆