通过 MAC 上的 VMWare Fusion 在 Windows 上运行 XAMPP,如何配置 apache 以使用我的共享文件夹 (Z:) 作为 Web 根目录?

发布于 2024-09-12 08:57:09 字数 675 浏览 1 评论 0原文

环境:

主平台:MAC OSX 10.6

通过 VMWare Fusion 的辅助平台:Windows 7 64 位

背景:我在 MAC 端运行 MAMP Pro,Webroot 位于“/www”。我需要在 IE 中测试网站,因此需要安装 Windows。我在 Windows 端安装了 XAMPP,并将 apache 根目录更改为“Z:\www”,这是我的 MAMP webroot 的位置,它是 MAC 和 Windows 之间的共享文件夹。

当我尝试从 Windows 访问本地站点 (http://localhost/asite) 时,出现 403 Forbidden 错误:


禁止访问!

您无权访问所请求的对象。它要么是读保护的,要么是服务器无法读取的。

如果您认为这是服务器错误,请联系网站管理员。 错误403 本地主机 2010 年 7 月 30 日 14:21:07 Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1


如果它能工作,还需要进行哪些其他配置更改才能工作?

谢谢,

克里斯

Environment:

Main platform: MAC OSX 10.6

Secondary platform via VMWare Fusion: Windows 7 64-bit

Background: I'm running MAMP Pro on the MAC side with a webroot at "/www". I need to test websites in IE thus requiring a Windows installation. I installed XAMPP on my Windows side and changed the apache root directory to "Z:\www", the location of my MAMP webroot which is a shared folder between MAC and Windows.

When I try to access a local site from windows (http://localhost/asite) I get a 403 Forbidden error:


Access forbidden!

You don't have permission to access the requested object. It is either read-protected or not readable by the server.

If you think this is a server error, please contact the webmaster.
Error 403
localhost
07/30/10 14:21:07
Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1


What other configuration changes need to be made for this to work if it will work at all?

Thanks,

Chris

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

迷你仙 2024-09-19 08:57:09

感谢那些回复的人。我对网络连接的类型做了一些研究,以下是我如何在不使用 XAMPP 的情况下解决该问题的方法。

回顾一下,我通过 VMWare Fusion 作为虚拟机在 Mac 上运行 Win7。我有 MAMP 在我的 Mac 上运行本地 Web 服务器,Web 根目录位于 /www,并且我希望也能够从 Windows 中的浏览器访问 Web 服务器。

简而言之,我希望能够从 Safari (Mac) 或 IE (视窗)。

  1. 由于我在家庭办公室工作,因此将我的 Fusion 网络适配器更改为桥接。
  2. 使用命令提示符中的 ipconfig 命令刷新我的网络连接。
  3. 编辑我的 Windows 主机文件以反映: 192.168.1.102 localhost

完成。

我希望其他人能发现这很有用。

  • 克里斯

Thanks to those who responded. I did a little research on the types of network connections and here's how I resolved the issue without using XAMPP at all.

To recap, I'm running Win7 on my Mac via VMWare Fusion as a virtual machine. I have MAMP running a local web server on my Mac with a webroot at /www and I want to be able to also access the web server from browsers in Windows.

In short, I want to be able to go to http://localhost/mysite from Safari (Mac) or IE (Windows).

  1. Changed my Fusion Network Adapter to Bridged, since I am working from a home office.
  2. Refreshed my network connections using the ipconfig commands in the command prompt.
  3. Edited my windows hosts file to reflect: 192.168.1.102 localhost

Done and done.

I hope someone else can find this useful.

  • Chris
潇烟暮雨 2024-09-19 08:57:09

您尝试通过 XAMPP 而不仅仅是 MAMP 为您的网站提供服务有什么具体原因吗?几年前我在类似的环境中工作过,我只是将虚拟机的网络类型设置为 NAT(以便来宾具有与主机不同的 IP),然后将 IE 指向运行 MAMP 的主机的 IP 地址。

Is there any specific reason you're trying to serve your site from XAMPP, rather than just MAMP? I worked in a similar environment a couple of years ago, and I simply set the virtual machine's networking type to NAT (so that the guest has a different IP from the host), and then pointed IE at the IP address of the host running MAMP.

混浊又暗下来 2024-09-19 08:57:09

也许我不太完全理解你的问题,但是:

我需要在 IE 中测试网站
您不需要设置 Web 服务器来执行此操作...
按照 peterjmag 的建议,继续在 Mac 主机上使用 Apache,并将 IE 从 Windows VM 指向主机 IP。
另外,不是有 Mac 版的 IE 吗?

再次,如果我误解了您,我深表歉意 - 我不想听起来傲慢;)

Z:\www ... MAC 和 Windows 之间的共享文件夹
这是什么——网络共享?如果您在虚拟机中使用本地文件夹(例如:C:\www),您是否会遇到相同的错误?

尝试从您的虚拟机安装/www - 转到它的设置> >选项选项卡>共享文件夹。。选择始终启用。单击添加并浏览到您的/www主机文件夹。这应该可以在您的虚拟机 Windows 中访问 /www

最后,以防万一:检查 www 文件夹的 Windows 权限。

希望有帮助!

Maybe I didn't quite understand your problem completely, but:

"I need to test websites in IE"
you don't need to setup a Web server to do that...
Keep using Apache on your Mac host and point IE from your Windows VM to the host machine IP, as peterjmag suggested.
Also, wasn't there a Mac version of IE?

Again, my apologies if i misunderstood you - I don't want to sound arrogant;)

"Z:\www ... a shared folder between MAC and Windows"
What's this - a network share? Do you get the same error if you use a local folder in your VM (eg: C:\www)?

Try mounting /www from your VM - go to it's settings > options tab > shared folders. Select Always Enabled. Click Add and browse to your /www host folder. This should make /www accessible in your VM Windows.

Finally, just in case: check Windows permissions on the www folder.

Hope that helps!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文