[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] Domain Aliasing



Jim Scott wrote:

> Jeff can you give an example of how to setup the server alias in the
> httpd.conf file.

I think you'd find it in the archives, but sure, I'll do it again...

> NameVirtualHost 209.126.157.69
> <VirtualHost 209.126.157.69>
> ServerName www.mailtraqna.com
> ServerAdmin admin
> ServerAlias mailtraqna.com

See the line directly above?  It's an alias for www.mailtraqna.com, so
that if you type just "mailtraqna.com" into the browser, it'll work, as
well.  The RaQ2 does this for all sites; the RaQ3 does it only for sites
for which you check Web Site for Domain Name (or something like that).

Let's look at the next two lines, which are NOT put in by the gui; I put
them in myself:

> ServerAlias www.mailtraqusa.com
> ServerAlias mailtraqusa.com

The first line points browsers looking for "www.mailtraqusa.com" to the
document root, and the second points browsers looking for
"mailtraqusa.com" without the "www" to the same place.

> DocumentRoot /home/sites/site5/web

The above line is where apache directs requests for the ServerLine name
or any of the ServerAlias names.

> RewriteEngine on
> RewriteCond %{HTTP_HOST}                !^209.126.157.69(:80)?$
> RewriteCond %{HTTP_HOST}                !^www.mailtraqna.com(:80)?$
> RewriteRule ^/(.*)                      http://www.mailtraqna.com/$1 [L,R]
> RewriteOptions inherit

See those five lines above?  If you comment them out two things happen. 
First thing that happens is that the location you typed into the browser
doesn't automatically change to the ServerName, as it does if you leave
these lines in.

The second thing that happens is that siteadmins and users cannot use
the gui to change their own services.  It locks them out of the gui. 
Since we lock our customers out of the gui, for us it's a no-brainer. 
This site hasn't commented these lines out because we own this site. 
Customer sites get them commented out.

I've left the rest of the lines in below, so you can see 'em.  This
entire block of quoted code represents one domain added to
/etc/httpd/conf/httpd.conf.  It's a "virtual host".

> AliasMatch ^/users/([^/]+)(/(.*))? /home/sites/site5/users/$1/web/$3
> AddHandler cgi-wrapper .cgi
> AddHandler cgi-wrapper .pl
> AddHandler server-parsed .shtml
> AddType    text/html     .shtml
> ScriptAlias /_vti_bin/_vti_adm/ /home/sites/site5/web/_vti_bin/_vti_adm/
> ScriptAlias /_vti_bin/_vti_adm/ /home/sites/site5/web/_vti_bin/_vti_aut/
> ScriptAlias /_vti_bin/ /home/sites/site5/web/_vti_bin/
> AliasMatch ^/~([^/]+)(/(.*))? /home/sites/site5/users/$1/web/$3
> </VirtualHost>

Jeff
-- 
Jeff Lasman <jblists@xxxxxxxxxxxxx>
nobaloney.net
P. O. Box 52672
Riverside, CA  92517
voice: (909) 787-8589  *  fax: (909) 782-0205