[svlug] Apache 1.3 and redirecting a virtual domain to a web page?

Drew Bertola drew at drewb.com
Fri Oct 25 18:23:00 PDT 2002


On Thu, Oct 24, 2002 at 10:43:17PM -0700, Daevid Vincent wrote:
> Anyone know how to set up Apache 1.3 (RH8.0) such that
> 
> http://resume.daevid.com will load the file
> http://daevid.com/resume.shtml

Assuming you have resume.daevid.com as a CNAME of daevid.com, and
daevid.com resolves to 12.228.95.58 (and some other obvious
assumptions), you could just do this:

As user daevid, with ~/ = /home/daevid, do:

# mkdir ~/resume
# ln -s ~/public_html/resume.shtml ~/resume/index.shtml

as root, edit httpd.conf:

NameVirtualHost 12.228.95.58

<VirtualHost 12.228.95.58>
      ServerName resume.daevid.com
      DocumentRoot /home/daevid/resume/
      ServerAdmin w-e-b-m-a-s-t-e-r at daevid.com
</VirtualHost>

Then restart apache.


> And while we're at it, how about 
> 
> http://foo.daevid.com to go to http://daevid.com/foo/

Same.
 
> This one I think I can do with a regular <VirtualHost *> like any
> others, but I have a feeling there may be a better way?

For IP based VirtualHost, * is the default IP.  I'm not sure if it
works with NameVirtualHost.  Probably, but I'd rather be
deterministic.

-- 
+---------------------- T h e C o o p . n e t ----------------------+
| Drew Bertola         Hosting - Colocation      Tel:  408-738-8337 |
| TheCoop.net      Programming - Administration  Mob:  408-887-0426 |
| drew at thecoop.net    Open Source Specialists    http://thecoop.net |
+-------------------------------------------------------------------+





More information about the svlug mailing list