Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Problem with hostname and domainname.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Tzeentch
n00b
n00b


Joined: 25 Feb 2004
Posts: 27
Location: Montreal, Qc, Canada

PostPosted: Thu Nov 18, 2004 10:03 pm    Post subject: Problem with hostname and domainname. Reply with quote

I have a problem with my web server (apache2) in regards to my hostname/domainname. I have a weird setup so this might be a lengthy post, sorry for that.

To start, here's my setup:

Code:
                     /    PC1 NIC1                -  NIC2  PC1           \
INTERNET -  Router -   PC2 NIC1                -  NIC2  PC2           -  SWITCH
                     \    PC3gentoo(server1)eth0  -  eth1  PC3(server1)  /


As you can see, I have 3 computer, each computer has 2 network card, the first one connected into the router (using NAT) and the second one connected into a switch. The nics connected to the router have ips in the 192.168 range and the ones in the switch have ips in the 172.16 (yeah, I used a class B for 3 computers... :twisted: )

Here's my /etc/hosts for my server (PC3) tzeentch.xxxxxx.xxx is my dyndns hostname (i replaced most of it by x to protect myself ;) )
Code:
127.0.0.1       localhost.localdomain   localhost
192.168.0.4     tzeentch.xxxxxx.xxx     tzeentch
172.16.0.10     server1.129A            server1


Here's the result of the "hostname" command
Code:
tzeentch@server1 tzeentch $ hostname
server1.129A
tzeentch@server1 tzeentch $


Here's the result of the "dnsdomainname" command
Code:
tzeentch@server1 tzeentch $ dnsdomainname
129A
tzeentch@server1 tzeentch $


Here's the result of the "domainname" command
Code:
tzeentch@server1 tzeentch $ domainname
(none)
tzeentch@server1 tzeentch $


Now for my problem: If I try to connect to my webpage from the internet using tzeentch.xxxxxx.xxx it works. But if I use tzeentch.xxxxxx.xxx/wfrp it doesn't work, the browser redirects itself to server1.129a/wfrp, and of course that adresse is impossible to reach from the internet. If I go to tzeentch.xxxxxx.xxx/wfrp/index.html, it works.
I'm pretty certain I did something wrong (or multiple things wrong), but I'm stuck on a rut right now and just can't figure it out.

Thank you all in advance for any and all help. Gentoo users are the best.
Back to top
View user's profile Send private message
steevdave
Retired Dev
Retired Dev


Joined: 25 Oct 2004
Posts: 73
Location: Tulsa, OK

PostPosted: Fri Nov 19, 2004 4:52 am    Post subject: Reply with quote

Try setting Servername in your apache2.conf file to fqdn - example, I run steev.net - i had been using the localhost name (leonid)

Code:
Servername leonid


And whenever someone would attempt to get to a sub page, or for example, my webmail directory, without the /, it would goto a random site linked to the name "leonid"

Upon changing the Servername, to

Code:
Servername steev.net


It works fine now. I don't know if this is the "proper" way, and I don't have an understanding of vhosts, but I know this works for me.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum