繁体   English   中英

在Magento的Virtual Box(Win 7)上设置Ubuntu 12.04 LTS的问题

[英]Issue with setting up Ubuntu 12.04 LTS on Virtual Box (Win 7) for Magento

我正在尝试使用Virtual box(在Windows 7中)设置Ubuntu 12.04 LTS,以使我能够进行一些Magento开发。

我已经使用了《 Magento,开发人员指南》一书中的以下指南,并且就hosts文件(从本书直接获得)设置了以下内容:

我在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)对192.168.0.77地址执行ping操作,但是没有问题,但是对magento.localhost.com进行ping操作却无法正常进行吗? 我猜我的主机设置不正确,有什么想法吗?

看来您需要在Windows主机文件中添加一个条目。 可以在%SystemRoot%/system32/hosts找到该文件,并且条目应类似于:

192.168.0.77     vm

不要使用实际网站localhost.com ,也不要覆盖默认的localhost条目(127.0.0.1)

然后,您应该能够使用magento.vm访问您的站点。

让我知道这是否无效

好的,我通常在Windows 7的VirtualBox中使用Ubuntu Server,所以这是我的操作方法。

安装Ubuntu Server时,请确保检查ssh,LAMP,邮件和Samba选项。

安装后,我将VM的设置更改为具有另一个网络适配器-我在NAT上使用一个,仅在主机上使用一个。 在ubuntu中,我编辑文件/etc/network/interfaces并在重启后为192.168.56.x类中的第一个适配器添加一个动态地址,为第二个适配器添加一个静态地址(将x的值从1更改为255),然后重新启动网络服务时,运行ifconfig -a时,应该会看到类似eth0 10.0.2。*和带有192.168.56.x的eth1之类的内容

我在Samba /etc/samba/smb.conf设置了一个文件夹,以便可以在Windows中以新字母映射我的/var/www/site文件夹。 最后,我将Windows中的system32/hosts文件更改为具有VirtualHost配置中的ServerName或ServerAlias的静态IP192.168.56.x。

192.168.56.x magento.localhost.com

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM