I have an Ubuntu vm setup as a LAMP and I would like to access the localhost page of that machine and use that to test my websites. How can I access it?
Best network settings are:
bridge-networking attached to your actual ethernet interfaces
in the vm verify your network settings
ifconfig
if wrong, edit it here: /etc/resolv.con
and /etc/network/interfaces
and /etc/host*
You could also setup Virtual Hosts in your Virtual Machine:
# edit the Apache config
$ sudo nano /etc/apache2/apache2.conf
# in apache2.conf, add these virtual host settings below the files node NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /var/www
ServerName www.ubuntu.vm
ServerAlias ubuntu.vm
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /var/www/wordpress
ServerName www.wordpress.vm
ServerAlias wordpress.vm
</VirtualHost>
Much more info on how to setup a LAMP Development Environment in a Virtual Machine available in my blog post at: http://jimfrenette.com/2013/11/virtual-machine-for-lamp-development/
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.