-2

I have Ubuntu 14.04.2 installed as a virtual machine (VirtualBox) in my MacBook Pro. I am trying to get my LAMP (Linux,Apache, MySQL and PHP) stack to run a web server, but I just cant get not even the Apache welcome page (by typing my IP address in my browser).

I suspect that this is due to a network misconfiguration. I tried to edit the /etc/network/interfaces config to:

$ sudo nano /etc/network/interfaces
auto eth0
iface eth0 inet manual

auto br0
iface br0 inet static
    address 192.168.0.100
    netmask 255.255.255.0
    gateway 192.168.0.1
    bridge_ports eth0 vbox0 vbox1

# The loopback network interface
auto lo
iface lo inet loopback

As the Ubuntu documentation suggests, but I had no success in getting my Apache server to work. Whenever I installed Ubuntu, I pre-installed the OpenSSH, LAMP and MailServer bundles, so I do not know if this somehow interferes with the configuration a little bit.

Also, my MacBook Pro is a recent model so I only have Wi-Fi. I am configuring the Network of the Virtual Machine in VirtualBox under “Settings > Network” and I am choosing Attached To: “Bridged Adapter” and selecting my Wi-Fi adapter (AirPort) like so -> Name: en0: Wi-Fi (airport)

Does anybody have a clue why I cannot type my static IP and get the Apache welcome page?

3
  • You can't bridge to Wi-Fi. You'll have to use a routed or NAT network instead. Commented Apr 8, 2015 at 4:00
  • @MichaelHampton Thanks for clarifying. Do you mind to elaborate on that topic?
    – idelara
    Commented Apr 8, 2015 at 4:12
  • @JakeGould I am trying to access it from another computer through the internet. Say, as a remote server. How should I configure my network settings then? Thanks in advance!
    – idelara
    Commented Apr 8, 2015 at 4:13

1 Answer 1

0

as per comments - your problem spans from the fact that you've configured wrong interface for your VM. While unfamiliar with the VirtualBox inner workings I will suggest general workflow (that is widely used nowadays with containers and such):

  • create VM with a "normal" non-routable IP as per usual. For example RedHat family assigns default network of 192.168.122/24 as a default network for VMs
  • use your host's firewall (be it Mac's ipw or whatever they use today or Linux iptables if you installed Linux for your host) and "nat" any inbound traffic on *:80 over to the IP of your VM.

    • as an option to this you may install some simple reverse proxy like nginx pound etc. and make it listen on

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .