Forum Moderators: phranque

Message Too Old, No Replies

Setting up web sites on a server.

         

Montezuma45

7:38 am on Feb 5, 2011 (gmt 0)

10+ Year Member



After looking through the post, I think I found a forum that can help me.

I have 2 Gentoo linux servers I run out of my house. The first server (CSMN1) works and I can access the web sites (4 of them) on it. The second server (CSMN2) does not allow me to access the web sites. They are on two different static IP addresses. I had originally copied the files from CSMN1 to CSMN2 but that didn't work. Since then the CSMN2 files have been modified some.

I need someone with more expertise to guide me in the debugging process. I've been working with computers for over 30 years but Apache is new to me and I'm afraid I might be looking in the wrong place to begin with.

Ask what you need to know and I'll do my best to find the answers.

Thanks.

Key_Master

6:26 pm on Feb 5, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'll try to give it a shot but first we'll need to know how your network is configured. I'm assuming you have configured the computer that runs server1 with an internal network ip of (let's say) 192.168.1.1 and and the computer that runs server2 has been configured with it's own internal network ip of (let's say) 192.168.1.2. Your multi-nat supported router should be configured to forward traffic from static ip1 to 192.168.1.1:80 and forward traffic from static ip2 to 192.168.1.2:80. Apache on server1 listens for traffic on 192.168.1.1:80 and Apache on server2 is listening for traffic on 192.168.1.2:80. Does that sound like your configuration?

Montezuma45

3:03 am on Feb 6, 2011 (gmt 0)

10+ Year Member



LOL. Okay, let me see if I can make this sensible. First the good news, I wiped out Apache and re-installed it. I can now reach the basic web page that says it works via /var/www/localhost/htdocs/index.html.

Each server has two NIC cards. One set for the intranet (192.168.x.x) and the other is set for the static IP on the internet (CSMN1 - 70.x.x.10) and (CSMN2 - 70.x.x.9). This way, I can access both servers via the Windows machine using WinSCP, Putty and SQLyog.

CSMN1 works but I need to take it apart and fix the fan that is driving me crazy. My hearing is such that I can't tell which fan.

Since I able to do [70.x.x.10...] and get to a default web page, does that mean that the basic setup should be working? If so, let's continue to the main reason I'm here, otherwise, let's figure out where I need to be.

What the web site structure should be is:
1. Personal web site to host photo gallery, pet projects and such. www.xyz.com/photo, www.xyz.com/petproj, www.xyz.com/?

2. A business site with it's own e-mail setup. (separate domain name).

3. A friends business site with no email.

Since my son setup the original site over 6+ years ago, I'm not sure we have the right structure. Should these all be virtual-hosted or how should I set it up?

I'm hoping to pick the brains of the experts that have a clue of what is best. I hope that answers the question too.

Montezuma45

3:13 am on Feb 6, 2011 (gmt 0)

10+ Year Member



Will this help too?


csmn2 htdocs # netstat -an
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 52 192.168.1.21:22 192.168.1.100:50258 ESTABLISHED
tcp6 0 0 :::80 :::* LISTEN
tcp6 0 0 :::22 :::* LISTEN
tcp6 0 0 :::443 :::* LISTEN
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags Type State I-Node Path
unix 2 [ ACC ] STREAM LISTENING 4711 /var/run/mysqld/mysql d.sock
unix 2 [ ACC ] STREAM LISTENING 3528 /var/run/syslog-ng.ct l
unix 2 [ ACC ] STREAM LISTENING 431696 /var/run/cgisock.2053 9
unix 2 [ ] DGRAM 1038 @/org/kernel/udev/ude vd
unix 2 [ ACC ] STREAM LISTENING 3525 /dev/log
unix 3 [ ] STREAM CONNECTED 431367 /dev/log
unix 3 [ ] STREAM CONNECTED 431365
unix 3 [ ] STREAM CONNECTED 5073 /dev/log
unix 3 [ ] STREAM CONNECTED 5072
unix 3 [ ] DGRAM 1041
unix 3 [ ] DGRAM 1040

Key_Master

5:33 am on Feb 6, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What kind of modem/router are you using and how is it configured?

Montezuma45

5:48 am on Feb 6, 2011 (gmt 0)

10+ Year Member



Comcast modem. No firewall. Other than that I can't remember. What do I need to look for?

Montezuma45

5:02 pm on Feb 6, 2011 (gmt 0)

10+ Year Member



As far as I could find out, Comcast handles the static IP on their end (I could be wrong) for Workplace accounts. Since I have nothing on my end that I can see. They may have set the modem up on their end and I don't have access to it. I know it has worked for about 6 years but when CSMN1 fan started to make loud noises, I shut it down with the thought that CSMN2 would take over. Then I had the rude awakening that it never worked in that way. Now I'm trying to bring it into the current world of knowledge and gain some too.

Montezuma45

11:48 pm on Feb 7, 2011 (gmt 0)

10+ Year Member



Also, strange thing. [localhost...] fails but [192.168.x.x...] and [70.x.x.9...] both work via /var/www/localhost/htdocs/index.html.

Montezuma45

3:27 pm on Feb 10, 2011 (gmt 0)

10+ Year Member



Solved the localhost issue, it should not work the way I approached it.

Since I can get to the server for one web site, it looks like I'm dealing with a problem with the DNS server translating to the server. I still think it has to do with my setup but not sure where.

CSMN1 use to be a DNS server but I can't think that shutting it off would eliminate the other DNS servers from converting it.

The second thought is that I've messed up something with NAMED or resolv.conf (still not sure on the formatting).

This is the resolv.conf

search blue-xx-xx.com
search cs-xx.com
search fxx.com
search rexx-xx-xx.com

nameserver 70.xx.xx.9
nameserver 127.0.0.1

search wp.comcast.net
nameserver 68.87.77.130
nameserver 68.87.72.130


Amazing how many times I looked at this and never saw what could be the obvious.
Am I telling the server to look at 70.xx.xx.9 & 127.0.0.1 to be DNS servers? Is that what this is doing?

Please explain this code to me, if you can.