【发布时间】:2014-03-13 12:21:32
【问题描述】:
我正在尝试使用 Virtual box(在 Windows 7 中)设置 Ubuntu 12.04 LTS,以使我能够进行一些 Magento 开发。
我使用了“Magento,开发人员指南”一书中的以下指南,并针对主机文件设置了以下内容(直接来自该书):
我在 Ubunto 上的虚拟主机文件
$ sudo nano /etc/apache2/sites-available/magento.localhost.com
<VirtualHost *:80>
ServerAdmin magento@locahost.com
ServerName magento.localhost.com
DocumentRoot /srv/www/magento_dev/public_html
<Directory /srv/www/magento_dev/public_html/>
Options Indexes FollowSymlinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog /srv/www/magento_dev/logs/error.log
LogLevel warn
</VirtualHost>
Apache2、MySQL 和 PHP 已经在 Ubuntu 安装上进行了设置和配置,我已经通过 SVN 下载了 Magento 源代码(例如 /srv/www/magento_dev/public_html)
We just need to set up a local mapping into our host system host file by using any of the following:
• Windows
i. Open C:\system32\drivers\etc\hosts in notepad
ii. Add the following line at the end of the file: 192.168.43.95 magento.localhost.com
• Unix/Linux/OSX
i. Open /etc/hosts using nano: $ sudo nano /etc/hosts
ii. Add the following line at the end of the file: 192.168.43.95 magento.localhost.com
当我直接在 Windows 机器上的浏览器中加载 http://magento.localhost.com 时,我只会看到一个空白屏幕,但是如果我直接在 Ubuntu 的浏览器中访问 IP 192.168.43.95,它会显示“它可以工作” Web 服务器的默认页面。
有人知道我做错了什么以及为什么我无法通过 magento.localhost.com URL 访问它吗?
// 更新
在我的 Windows 7 机器上,我可以(使用 cmd)毫无问题地 ping 192.168.0.77 地址,但是 ping magento.localhost.com 永远不起作用?我猜我的主机设置不正确,有什么想法吗?
【问题讨论】:
-
你在 windows 的 hosts 文件中有什么?
标签: magento ubuntu virtualbox virtualization hosts