1

Banging my head on the wall at this stage... Trying to host my Apache site on Ubuntu 12.10 with VirtualBox. Running Windows 8 host.

Things I've done:

  • Ensured Apache is listening on ports 80, 443 and 8080 (for thoroughness)

    tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      3355/httpd      
    tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN      3355/httpd      
    tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      3355/httpd      
    tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      681/sshd 
    
  • VM is using bridged network connection

  • Assigned a static IP to my Ubuntu VM, which can be accessed fine from within network.
  • Forwarded TCP ports 80, 8080, 443 on the static IP of VM on my router
  • Given my VM a static NAT Address
  • Turned off Ubuntu firewall and router firewall
  • Read on forums that my ISP (Eircom) allow port 80 to be used

And I still can't access my site using the WAN/External IP (checked internally and using CanYouSeeMe.org). It says all the ports I mentioned are closed.

I'm really at a loss of what to try next... Am I missing something silly here?

Note: I haven't assigned a static IP address within the router, on within the VM. And DHCP server is enabled. Is that bad?

1
  • Virtualbox has a portforwarding function too. The question seems to somewhat confusing Vbox-bridge with Vbox-nat. A bridged Vbox cant host webcontent on the external ip in front of the router, for this pupose a dydns would be required in my understanding.
    – user20874
    Jun 4, 2013 at 7:07

1 Answer 1

1

Please double check all of the following: (assume aaa.bbb.ccc.ddd is the LAN IP of the HOST operating system (Windows 8).

If you are going to use NAT (safest) then proceed to step 2. If you are using 'Bridging' instead of 'NAT' then you can skip to step 6, but instead of forwarding the ports to the HOST's LAN IP then you'll forward directly to the LAN IP of the Guest VM. MAKE SURE THAT YOU DO NOT MIX THESE UP!

  1. Don't skip any steps, and don't rush over them.
  2. Make sure the guest OS is running. Run ifconfig to find the address that VirtualBox's DHCP assigns (likely 10.0.2.15, but still check)
  3. Open the Network Settings tab for the Ubuntu guest, make sure it says 'NAT' and then click 'Port Forwarding'
  4. Make sure you have an entry like this: Rule 01 | TCP | aaa.bbb.ccc.ddd | 80 | 10.0.2.15 | 80 where '10.0.2.15' is the IP of the GUEST (Ubuntu).
  5. Save these settings, and add any other ports you desire with the safe format.
  6. Go to the Metro Menu, begin typing 'firewall' and make sure you're under the 'Settings' tab. Click 'Allow an app through the firewall'
  7. Click 'Change Settings' at the top corner of the windows; this is just an extra layer to keep you out.
  8. Click 'Allow Another App' and then find 'Oracle VM VirtualBox' then click 'Network Types' and allow both on Public and Private networks. Click 'Add'
  9. Make sure all settings are saved. Open up the Command Prompt and run 'ipconfig' to find your LAN IP address (of the HOST). Test that you can indeed access a web page via any other computer on the network, via that IP. If you have TeamViewer running, you may need to change the settings in that to NOT run on port 80, restart TeamViewer, restart the ENTIRE VirtualBox software, and try again. If you still don't see the web page, check that it's actually being served by the guest VM.
  10. If you DO see the web page over your LAN, then also check that you can visit the site from your WAN IP. (http://icanhazip.com) If it works, then you're done.
  11. If you cannot see the page via WAN but CAN see it over LAN, then you need to re-do your port forwarding in the ROUTER.
  12. If you cannot see the page via ANY IP address, restart the entire host computer (as well as the guest VM). If it still fails, then you'll need to post more details.

To answer your question regarding DHCP and whether or not you should have a static IP address. If you plan to run a website out of your house, then you might want to look into investing in one of the following: 1) a static WAN address for your house, or 2) a real hosting company (whether it is VPS rentals or standard). You want to do one of the following: assign a static LAN IP to the guest VM as well as to the HOST operating system. You can either disable DHCP and assign addresses manually, or lock IP addresses to the MAC addresses.

Note: this community is tailored to Professional Webmasters. This does not necessarily mean you won't find any help, but if you do need help, please try to phrase it in a way that sounds more professional. If you still need help, you can contact me by clicking my username, clicking 'homepage' and then go to the 'Contact' page. I'd be more than happy to assist.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.