LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   How to publish a website running on apache server in virtual host to public ip (https://www.linuxquestions.org/questions/linux-networking-3/how-to-publish-a-website-running-on-apache-server-in-virtual-host-to-public-ip-4175612358/)

visuharsha 08-21-2017 08:37 AM

How to publish a website running on apache server in virtual host to public ip
 
Good evening,

I've configured a domain on apache server inside my virtualbox running with centos 7, i want this domain to be accessible on public ip.

i knew that port forwarding need to be done, but i don't have any idea hwow to do that, btw i use netgear router. can it be done by using port forwarding in netgear routers


Thanks in advance

lazydog 08-22-2017 10:16 AM

This will all depend on how your virtualbox nics are setup.

If setup as bridge then you only need to setup your netgear to forward the port to the ip address of the web server.

If setup as a NAT then you need to setup iptables on your VB server for nat to the inside to the VM IP Address and then setup your netgear to forward the port to the VB server.

TenTenths 08-22-2017 10:17 AM

Quote:

Originally Posted by visuharsha (Post 5750548)
i knew that port forwarding need to be done, but i don't have any idea hwow to do that, btw i use netgear router. can it be done by using port forwarding in netgear routers

So go use your favourite search engine and learn :) Then come back if you've any questions.

Steps will (roughly) be:
  • Log in to your router with the admin user/password.
  • Look for port forwarding or "DMZ" options.
  • Set up port 80 on the WAN interface to forward to port 80 in the internal IP of your virtualbox server.
  • I assume you've a STATIC IP from your ISP, if not then you'll have issues if your ISP has given you a DHCP address and it changes.

!!! 08-22-2017 10:29 AM

www-search magic keyword: rfc1918
You might need like step 6 of: http://www.noip.com/support/knowledg...ith-no-ip-com/
If VBox, try 'bridged'

Let us know!!!


All times are GMT -5. The time now is 01:24 PM.