Search code examples
ubuntuweb-hostingvirtualhostrouterportforwarding

Trying to Host Server for External Access - Apache, VirtualBox & Portforwarding


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?

Thanks!


Solution

  • Got it! My connection in Ubuntu (eth0) wasn't using the right default gateway. It should be set to your router's IP address. Hope this saves someone else a day of headache.