Page 1 of 1
Using VBox as a dedicated web server on Mac
Posted: 28. Oct 2015, 06:42
by vbox_web_servers
The goal is: type in a domain from external network, and deliver content from the VM, not the Host (my Mac)
I'm posting this to get my question started. Since I'm new on the forum, I can't post the details for another day. Many more details to come.
Re: Using VBox as a dedicated web server on Mac
Posted: 28. Oct 2015, 23:40
by vbox_web_servers
Here's the rest ...
I have setup my VBox to accept http requests (port forwarding in NAT), and I can SSH the VBox from my internal network via 192.168.0.10:12345 but how do I get a public domain to connect from the web to the VM?
I've run a standard CentOS 7 web server install, and configured "Host-Only Networks" with a static IP. I didn't customize any of the CentOS install, just went with the defaults, and disabled both Firewalld and SELinux. I also enabled the HTTPd
I can ping IP addresses on the VM and on the local network, from within the VM itself. I can SSH into the VM using the hosts static IP and the VMs designated port for SSH. ssh -p 12345 root@192.168.0.10
I can pull up the default Apache server welcome page using 192.168.0.10:56789 (http port forward setup on VM)
Here's what I'm using:
VirtualBox 5.0.6
CentOS 7 (1503)
Apple Mac OS X 10.9.5
NAT IP: 10.0.2.15
Host-Only IP: 192.168.0.20
Host Static IP (Physical Wired Ethernet): 192.168.0.10
VM Firewall is disabled
VM SELinux is disabled
Apache Server is enabled
Router is an AirPort Router
I have a FQDN registered and the public DNS points to my public static IP.
Currently using my Mac as a web server, but I'm seeking to move everything into a CentOS VM environment.
The goal is: type in a domain name from an external network, and deliver content from the VM, not the Host (my Mac)
I've tried several suggestions, but it's the port issue that I can't get around. As I understand it from Chapter 6 - Networking, the NAT network is supposed to work as a router. However, a router both opens a port and forwards it to the designated port number. Since I'm already using port 80 for my HTTP on the host, then how do I get port 80 opened for traffic to the VM? How do I change 192.168.0.10:56789 to my FQDN?