Help a new admin?
October 27, 2006 12:07 PM   Subscribe

Newb sysadmin filter: I've got an internal website 'blahblahblah/blah' that I want people to be able to get at by just typing 'blah' in their browser... where do I specify this? hosts?
posted by Cosine to Computers & Internet (11 answers total) 1 user marked this as a favorite
 
the lmhosts file
posted by dendrite at 12:12 PM on October 27, 2006


You need to put the host "blah" in their /etc/hosts or %WINDIR%/hosts file (or in DNS) and you need to set up a virtual host redirect on your webserver to make blah redirect to blahblahblah/blah. If you're not picky about performance and neatness you could just make the blah server only contain a single index.html with a meta refresh to blahblahblah/blah, otherwise look at your http server documentation for how to redirect.
posted by fvw at 12:13 PM on October 27, 2006


If you don't want to have to modify the hosts file on every machine, you can run an internal DNS server to handle the lookups. The problem, as stated, isn't too clear though. The way I've interpreted the question, fvw appears to have it.
posted by knave at 12:20 PM on October 27, 2006


What you need to change is the document root of the web server, not monkey around in DNS.

In IIS, right click the site name, select "Properties", and change the Local Path in the Home Directory tab.

In Apache, change the DocumentRoot directive in your config file.
posted by mkultra at 12:26 PM on October 27, 2006


Response by poster: Hmmm, maybe I will restate it. The site I want users to use has a long name, I don't want them to have to type it in that way all the time, I want a shorter alias to take them to the longer name.... as I said, newb.
posted by Cosine at 12:26 PM on October 27, 2006


simplest thing is to run a web server that listens on http://shortname/ and serves a redirect to http://long.name.foo/blah/blah
posted by Nelson at 12:34 PM on October 27, 2006


What they're saying, I think, is that you can do this, but it will take two steps.

First, put an entry in their lmhosts file, pointing blah at the ip address of your server.

Second, put a virtual host on your server that answers to that name, and does a redirect to the correct final location, which will probably be another virtual host.

There are two kinds of virtual hosting; IP-based, and name-based. With name-based, you can have a whole bunch of sites on the same machine with the same IP; it serves up different sites based on what the remote client asks for. That's probably what you want. If you're completely confused about how to do this, post back and I can give you an apache.conf snippet.

If you're using IIS or some other web server, I probably won't be much help, but I'm sure someone can.

There may be an easier way still, so pay attention to other replies, but this definitely should work.
posted by Malor at 12:40 PM on October 27, 2006


1. The hosts file on a individual machine can map a name to an IP. To map a name to an IP on a network you can use WINS or DNS if you are running them. Most people don't run WINS.

2a. If the machine has multiple IPs you could/would assign a lone IP to the web site in question and point the root of the web site to the root of the web content folder.

2b. If the machine only has one IP or you don't want to dedicate an IP to this one web site then you have to use host headers to share the IP but you would still point the root of the web site to the root of the web content folder.

If you go the 2a path above you can always trying using the direct IP to have the site load correctly to the correct folder and once you've got that working then do the name mapping.
posted by dgeiser13 at 1:24 PM on October 27, 2006


Doing this with the local machine's hostfile is a hack. The rfc-compliant, OS-independent way to do this is with a Cname (in dns) and a Vhost (on the web server). The Cname is a dns alias to your webserver and the vHost is a function of the webserver which redirects those cname requests to a specific directory on your webserver.

Cnames are created by whoever hosts DNS for your domain. This probably isn't your job, but you'll need to request it.

The Vhost probably is your job (basing this off the wording of the question). If you're running apache on a *nix system, the vhost is created in your conf files (v1.3 docs, v2 docs). I'm not an IIS admin, but you can create vhosts on IIS with ASAPI plugins.
posted by datacenter refugee at 1:32 PM on October 27, 2006


If you're using Apache, just put blah into DNS as an alias to the machine hosting the page. Then in the httpd.conf put blah in as a server alias. There are examples already in the file for you to follow.

You'll have to restart Apache for the change to take effect.
posted by lairc at 7:44 PM on October 27, 2006


Actually, if you have just a small number of users and they're using opera or firefox/mozilla, you can just create a bookmark and give that bookmark a nickname (not sure of the terminology under firefox, but I think it has something similar). When you type the name of the bookmark into the URL bar, it goes to that bookmark.

IE might have something like that too, but I've never heard of it.
posted by fvw at 4:07 AM on October 28, 2006


« Older How to find more money for school and living?   |   Too bad I already went as Eddie Munster Newer »
This thread is closed to new comments.