Networking Setup

Issues related to configuring your network
xarc
Posts: 49
Joined: 2014/11/14 23:49:14

Networking Setup

Post by xarc » 2014/12/18 22:29:19

I got Centos running and several virtualboxes running on it.

Each virtualbox has its own internal IP address and has apache running each have their own virtualhost and domain setup. But whenever I got to any domain it does not go anywhere, what am I doing wrong?

igsmigs88
Posts: 29
Joined: 2014/07/23 20:46:29

Re: Networking Setup

Post by igsmigs88 » 2014/12/19 10:27:43

on each virtual machine put ip and domain in /etc/hosts, like this ( 127.16.151.1 www.example.org ) so that machines can resolve the page

xarc
Posts: 49
Joined: 2014/11/14 23:49:14

Re: Networking Setup

Post by xarc » 2014/12/19 14:26:00

What if that particular server is supposed to have that domain should it just be

Code: Select all

127.0.0.1 example.com
then?

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: Networking Setup

Post by gerald_clark » 2014/12/19 15:25:21

You are not clear in what you want.
If you are referring to public domain names with public WAN access you have a problem.
Your single public IP address can only be forwarded to a single local IP per port.

If you are referring to local network machine names for local access only you need to configure your local DNS server or
use entries in /etc/hosts on each machine.

igsmigs88
Posts: 29
Joined: 2014/07/23 20:46:29

Re: Networking Setup

Post by igsmigs88 » 2014/12/19 16:16:00

xarc wrote:What if that particular server is supposed to have that domain should it just be

Code: Select all

127.0.0.1 example.com
then?
i suppose that you doing that for local network, just edit /etc/hosts (put ip from virtual machine and domain name)

xarc
Posts: 49
Joined: 2014/11/14 23:49:14

Re: Networking Setup

Post by xarc » 2014/12/19 21:54:41

I have a physical server with one public IP address (WAN), I have several virtual servers running on that physical server with their own virtualhost such as example1.com example2.com

But the problem I am running into is that whenever I visit any of these domains see the same default apache page.

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: Networking Setup

Post by gerald_clark » 2014/12/19 21:58:18

You can only forward that public IP address port 80 to a single virtual machine, so that is to be expected.
Read about httpd's virtual domains and put all your webnsites on one VM.

igsmigs88
Posts: 29
Joined: 2014/07/23 20:46:29

Re: Networking Setup

Post by igsmigs88 » 2014/12/19 22:25:24

if u see apache default site, try comment all in /etc/httpd/conf.d/welcome.conf or put +Indexes in welcome.conf...also restart httpd, delete cache from your browser
did u edit /etc/hosts on all machines?

xarc
Posts: 49
Joined: 2014/11/14 23:49:14

Re: Networking Setup

Post by xarc » 2014/12/19 22:56:51

I am probably doing something wrong with the hosts, so my internal IP of the server is 192.168.9.108 and I know the external, how do I properly write this into the hosts file?

igsmigs88
Posts: 29
Joined: 2014/07/23 20:46:29

Re: Networking Setup

Post by igsmigs88 » 2014/12/19 23:08:19

if u host for example -- example.com on 192.168.9.108 ip
edit hosts in all machines including host machine
as root run

#vi /etc/hosts
hit a for write
in the end put
192.168.9.108 example.org
hit esc
hit :wq enter :)

Post Reply