Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Setting up Apache for lan
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
Herodot
Guru
Guru


Joined: 29 Jul 2002
Posts: 429
Location: Professor Xavier's school for gifted youngsters

PostPosted: Sun Oct 13, 2002 10:32 pm    Post subject: Setting up Apache for lan Reply with quote

Hi,

I've got Apache up and running on one machine. It works fine, I can see it from another machine when I browse to the IP-number. But I'd like to just enter the machine name (say, "apaserv"), and go there directly.

I've tried entering the name in /etc/hosts but that didn't help. Yes, I restarted. And also in /etc/apache/conf/apache.conf. Other computers on the network don't see the name on the local net, they just try http://www.apaserv.com - which is wrong, obviously.

This probably has to do with dns, servernames, domainnames and more, and I'm pretty lost at the moment.

Herodot
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Sun Oct 13, 2002 10:41 pm    Post subject: Reply with quote

The best long-term solution is to create a (fictional if necessary) domain, and set up a DNS server somewhere on it. For example, you being Herodot, how about the .hero domain (sorry, bad pun). So then you would have it be apasrv.hero, and as long as the other clients also looked at your DNS server for the .hero domain, they would find the right IP address.

In the meantime, put an entry in /etc/hosts that says "1.2.3.4 apasrv.hero apasrv" (replacing 1.2.3.4 with IP address), and a "search .hero" in /etc/resolv.conf. These steps need to be done on the client machines, as well as on apasrv itself. This may be easier to do if you don't want to set up a DNS server right now.

Does this work?
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
Herodot
Guru
Guru


Joined: 29 Jul 2002
Posts: 429
Location: Professor Xavier's school for gifted youngsters

PostPosted: Sun Oct 13, 2002 11:06 pm    Post subject: Reply with quote

Quote:
For example, you being Herodot, how about the .hero domain (sorry, bad pun).


Great idea! :D

If I use a DNS server, then everybody would have to manually enter that IP in their settings on their windows and macs - right? That wouldn't be very convenient in my situation. Could I set a dns server to sort of "steal" requests to 192.168.1.1 (the gateway) or something?

Your second idea also requires changing settings on all client machines. I'm almost certain I once got a similar setup to work on a default Debian install without any such changes.
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Sun Oct 13, 2002 11:34 pm    Post subject: Reply with quote

Herodot wrote:
If I use a DNS server, then everybody would have to manually enter that IP in their settings on their windows and macs - right?

They would have to enter it once in their list of nameservers, yes. Once that's done once, you could add new names and aliases in a single place without having to do anything on client machines.

Quote:
That wouldn't be very convenient in my situation. Could I set a dns server to sort of "steal" requests to 192.168.1.1 (the gateway) or something?

Not that I know of. What nameserver are your clients configured to use now? If you have a local caching-only nameserver, you might have a chance to tell it to look to your local nameserver for the .hero domain.

Quote:
Your second idea also requires changing settings on all client machines. I'm almost certain I once got a similar setup to work on a default Debian install without any such changes.

I don't see how that would be possible. Each client has to know that apasrv.hero has IP address a.b.c.d, and you either have to tell them all that manually or tell them who to consult (i.e. a local DNS server).
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
Herodot
Guru
Guru


Joined: 29 Jul 2002
Posts: 429
Location: Professor Xavier's school for gifted youngsters

PostPosted: Sun Oct 13, 2002 11:49 pm    Post subject: Reply with quote

Quote:
What nameserver are your clients configured to use now? If you have a local caching-only nameserver, you might have a chance to tell it to look to your local nameserver for the .hero domain.

The dns is automatically provided by dhcp - nobody has manually entered the IPs.

Quote:
Each client has to know that apasrv.hero has IP address a.b.c.d, and you either have to tell them all that manually or tell them who to consult (i.e. a local DNS server).

True. But if it was common practice for a machine to look on the internal net first, then wouldn't the machine named "apasrv" respond?

Could windows users add an entry to their hosts file to solve this problem?
Back to top
View user's profile Send private message
Plaz
Tux's lil' helper
Tux's lil' helper


Joined: 15 Sep 2002
Posts: 101
Location: Portland, OR

PostPosted: Mon Oct 14, 2002 7:05 am    Post subject: Reply with quote

If your clients are getting nameserver addresses via DHCP, you could set up your own DHCP server and have it point them to your own DNS server. This is a little complicated, but I was able to set up the following:

Code:

    Internet <-->firewall/gw<--+-->DHCP server/DNS server/DNS cache (Linux)
       via                     |
     Cable Modem               +-->Linux systems
                               |
                               +-->Windows clients
                               |
                               +-->Print servers, NAS devices, etc.


I turned off the built-in DHCP services provided by my off-the-shelf firewall/gateway and set up my own DHCP and DNS server. Using tinydns and djbupdate_update, I get the DCHP clients automatically added to my DNS server so everybody can ping everybody else without any mucking about with /etc/hosts. Having a shared DNS cache for my entire network has made a noticeable improvement in response times. Let me know if you want more details the set-up.
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Mon Oct 14, 2002 7:17 am    Post subject: Reply with quote

Herodot wrote:
The dns is automatically provided by dhcp

Oh, then maybe Plaz's setup will work for you.

Quote:
if it was common practice for a machine to look on the internal net first, then wouldn't the machine named "apasrv" respond?

In DNS-land, there isn't really a notion of "internal net" - the link layer (everybody on the same hub) doesn't necessarily map directly to domain namespace. This is one of the problems that Zero-Configuration Networking (http://zeroconf.org), Apple's implementation of which is called Rendezvous, is designed to solve.

With clients running Zeroconf-capable OSes, they could just say "anybody running a webserver on this local network?", and apasrv would come up in a window automatically. No names, no Herodot setting up DNS, no hacking DHCP servers. Multicast DNS would save the day.

But I expect that Plaz's setup is more practical for you in the short run.
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
Herodot
Guru
Guru


Joined: 29 Jul 2002
Posts: 429
Location: Professor Xavier's school for gifted youngsters

PostPosted: Sun Oct 20, 2002 3:20 pm    Post subject: Reply with quote

OK, I understand your points. I have the system running, and people can browse to the IP-number or edit their /etc/hosts or whatever.

On a Windows machine, isn't this solved somehow by NetBIOS? I don't pretend to fully understand it, but from what I hear, a windows machine running Apache would be reachable by its name alone, without setting hosts or dns. If so, can that be done on Linux? (netbios, I mean)

Thanks for your answers!
Herodot
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