LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 02-08-2005, 06:18 PM   #1
nrambeck
LQ Newbie
 
Registered: Aug 2003
Distribution: Ubuntu (Breezy)
Posts: 10

Rep: Reputation: 0
Alias for local web server


Is there a way to create an alias for a local Linux web server so that I can connect to it using htp://aliasname/ rather than using the ip address (ie. htp://192.168.1.1)

As an example, localhost is an alias for 127.0.0.1. Thanks!

BTW, I'm using Fedora Core 3 as the web server.
 
Old 02-08-2005, 06:56 PM   #2
comprookie2000
Gentoo Developer
 
Registered: Feb 2004
Location: Fort Lauderdale FL.
Distribution: Gentoo
Posts: 3,291
Blog Entries: 5

Rep: Reputation: 54
You can add it to /etc/hosts
# /etc/hosts: This file describes a number of hostname-to-address
# mappings for the TCP/IP subsystem. It is mostly
# used at boot time, when no name servers are running.
# On small systems, this file can be used instead of a
# "named" name server. Just add the names, addresses
# and any aliases to this file...
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/hosts,v 1.8 2003/08/04 20:12:25 azarah Exp $
#

127.0.0.1 localhost
192.168.0.2 tux.localnetwork tux
192.168.0.1 abbottdavid.localnetwork abbottdavid
# IPV6 versions of localhost and co
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
 
Old 02-08-2005, 08:53 PM   #3
nrambeck
LQ Newbie
 
Registered: Aug 2003
Distribution: Ubuntu (Breezy)
Posts: 10

Original Poster
Rep: Reputation: 0
Thanks Rookie! I made changes to the /etc/hosts file like you suggested and it works on the Linux machine but not on the Windows machine I have it networked to. This is what the /etc/hosts file has:

127.0.0.1 localhost
192.168.1.1 fd3.webdev webdev

I am using WindowXP as a client and a FC3 Linux box as the webhost/fileserver. If I browse http://webdev/ on the linux box it pulls up the root web server files, but when I try the same on the Windows client it can't find anything.

Any ideas?
 
Old 02-09-2005, 09:51 AM   #4
nrambeck
LQ Newbie
 
Registered: Aug 2003
Distribution: Ubuntu (Breezy)
Posts: 10

Original Poster
Rep: Reputation: 0
Does anyone have any suggestion concerning the questions in the previous post?
 
Old 02-09-2005, 10:34 AM   #5
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,968

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
You must do the same in the Windows box.
The file is in: C:\WINDOWS\system32\drivers\etc\hosts

Last edited by bathory; 02-09-2005 at 11:03 AM.
 
Old 02-09-2005, 10:49 AM   #6
nrambeck
LQ Newbie
 
Registered: Aug 2003
Distribution: Ubuntu (Breezy)
Posts: 10

Original Poster
Rep: Reputation: 0
Perfect! You guys are great!
 
Old 02-09-2005, 12:28 PM   #7
pnellesen
Member
 
Registered: Oct 2004
Location: Missouri, USA
Distribution: Slackware 12.2, Xubuntu 9.10
Posts: 371

Rep: Reputation: 31
Quote:
Originally posted by bathory
You must do the same in the Windows box.
The file is in: C:\WINDOWS\system32\drivers\etc\hosts
So how would I get my Linksys Wireless Router to see my DHCP linux box(es)? By that I mean, when I bring up the router's config page and look at "DHCP Clients", I see all the IPs ok, but the only Hostnames I see are my Windows machines (and then only my XP boxes, which are in a Workgroup. I have a Win2000 laptop that's on a domain that doesn't show the Hostname either) This isn't a huge issue, more one of those nagging "MUST KNOW WHY" things

Oh, and is there a way to specify a range of ips in a hosts file, or does that not make any sense? I'd like to be able to see my DHCP boxes by name as well if possible... (I've got one box set up with a static IP as a web/file server, but the rest of my machines are all DHCP clients)

Thanks!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cant make web server run my local web page... Nik0s Linux - Newbie 22 10-08-2006 11:30 PM
problem starting web server from rc.local juanb Linux - General 2 10-13-2005 09:56 AM
my web server can't be reached by local network tiang_ono Linux - Software 4 07-14-2005 09:02 PM
Local webserver -- How to deny all client install their local web server--Please help b:z Linux - Networking 13 04-16-2005 08:11 PM
Local Web Server amdawi Linux - Networking 15 09-30-2003 05:25 PM


All times are GMT -5. The time now is 08:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration