Pointing Domain to Home Server?

AZDiablo

Distinguished
Dec 30, 2006
15
0
18,510
I have been searching for the answer to this question all over the web and think I am really close. :bounce:

I have a LAMP server running Centos 5. I have a domain name superstave.com. My server I hanging out on my network behind a router. In the router I have done single port forwarding to the static IP address I assigned to the LAMP server. On the router it has drop downs on the left that say FTP, HTTP, or etc. I chose the first one FTP and it assigned port 21 to the address I entered. In the instructions I found it said to also open port 80 which I did in the custom section of port forwarding.

The LAMP server is called server5. I looked up my IP address via some website and it told me the address going to the modem. My domain is registered with 1and1.com. On the domain website I have directed the domain name to my IP address.

So the reason I am posting is that I cannot connect my server using the domain name. I can connect using the IP address I assigned on the network.

In the hosts file the static IP of the server is 192.168.1.121 server5.superstave.com server5
 
On the DNS server for your domain is there a record for server5.superstave.com (or whatever name your website and FTP site are using) pointing to the IP address of your router? You say that you have directed the domain name, but you need to direct the name that Apache is expecting (www.superstave.com, perhaps).
 

AZDiablo

Distinguished
Dec 30, 2006
15
0
18,510
I have changed my router to use the static ip address.

Here is the information for domain host company and my Linux server.

DNS Check Result

Domain name superstave.com
IP address (A record) 98.165.xxx.xxx
Name server 1 ns51.1and1.com
Name server 2 ns52.1and1.com
Mail server 1 mx00.1and1.com, 10
Mail server 2 mx01.1and1.com, 10

Router single port forwarding:
Name: Server5
External Port: 80
Internal port: 80
IP address: 192.168.1.xxx

Linux ifconfig info:
eth0 Link encap:Ethernet HWaddr 00:E0:18:79:33:5D
inet addr:192.168.1.xxx Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::2e0:18ff:fe79:335d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2902 errors:0 dropped:0 overruns:0 frame:0
TX packets:2218 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:366829 (358.2 KiB) TX bytes:613768 (599.3 KiB)
Interrupt:193 Base address:0x8000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:560 (560.0 b) TX bytes:560 (560.0 b)

I can login to Webmin I enter the server IP address: https://192.168.1.xxx:10000

I cannot access Webmin using the domain name. server5.superstave.com or superstave.com
 

randomizer

Champion
Moderator
Well the nameserver is pointing to the correct IP address based on the info you've provided. My guess is that your Apache configuration may not be correct. I think by default it is set up to only accept requests from localhost (127.0.0.1), but it probably depends on the distribution as to what the default config is. Your router may also not be forwarding correctly. I can't ping or complete a full traceroute to your router but it may simply be configured to ignore ICMP packets.
 
A few things:

1. I would say that you really need an A record in your domain hosting company's DNS for server5 (or www if you prefer to call it that) pointing to your router's IP address. It depends upon what you have called the web server in the Apache configuration.

2. You need to port forward, on the router, any ports that you wish to access the server with. So that's port 80 at a minimum, port 10000 if you want to access webmin from the outside world, and any other ports that the web server will accept connections on.

3. There's a difference between connecting from inside your network and from the outside world. On your network the server address is 192.168.1.xxx - to the outside world it is 98.165.xxx.xxx (the address of the router). That external address will not work from within your network. To get name resolution within your network to work you need a DNS server (probably the router) which has an A record for server5 (or www, or ...) pointing to 192.168.1.xxx.