LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-21-2017, 08:37 AM   #1
visuharsha
LQ Newbie
 
Registered: Jul 2017
Posts: 13

Rep: Reputation: Disabled
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
 
Old 08-22-2017, 10:16 AM   #2
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
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.
 
Old 08-22-2017, 10:17 AM   #3
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,476

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Quote:
Originally Posted by visuharsha View Post
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.
 
Old 08-22-2017, 10:29 AM   #4
!!!
Member
 
Registered: Jan 2017
Location: Fremont, CA, USA
Distribution: Trying any&ALL on old/minimal
Posts: 997

Rep: Reputation: 382Reputation: 382Reputation: 382Reputation: 382
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!!!

Last edited by !!!; 08-23-2017 at 01:34 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to create virtual host in apache web server Mr.Tinkss Linux - Server 4 06-03-2012 12:01 PM
publish a website on local server hussain6001 Linux - Networking 8 09-27-2010 10:14 AM
apache server not recognizing virtual host Fedora 12 daudiam Linux - Server 10 04-19-2010 09:28 AM
Running server on an old computer to host a website Darthomir Linux - Networking 6 03-31-2006 06:57 PM
About Virtual Host of Apache Server tommyliu Linux - General 5 06-17-2004 10:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration