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

Re: [cobalt-users] testing virtual domain before cutover



> Dan and all,
> Thanks for the tip. I did try searching the archives for 'testing virtual
> domain' and a few other searches. I came up with nothing. Is there a
> better way to search? I always try to search before posting.
>
> Thanks,
>
> Ashby

Setup a site for a domain you already have on your server like
"test.yourdomain.com" and setup your DNS for it... then edit your httpd.conf
file and add the following line to it..

AliasMatch ^/([^/]+)(/(.*))? /home/sites/$1/web/$3

After you add that line, you can access it like this:
http://testing.yourdomain.com/www.sitename.com

httpd.conf is located at "/etc/httpd/conf" and make sure to back it up
first!  Then restart your web server with:
/etc/rc.d/init.d/httpd restart

A sample for mine would be:

<VirtualHost 000.000.000.000>
ServerName testing.wcnhosting.com
ServerAdmin admin
DocumentRoot /home/sites/site53/web
ServerAlias testing.wcnhosting.com
RewriteEngine on
RewriteCond %{HTTP_HOST}                !^000.000.000.000(:80)?$
RewriteCond %{HTTP_HOST}                !^testing.wcnhosting.com(:80)?$
RewriteRule ^/(.*)                      http://testing.wcnhosting.com/$1
[L,R]
RewriteOptions inherit
AliasMatch ^/~([^/]+)(/(.*))? /home/sites/site53/users/$1/web/$3
AliasMatch ^/([^/]+)(/(.*))? /home/sites/$1/web/$3
AddHandler cgi-wrapper .cgi
AddHandler cgi-wrapper .pl
AddHandler server-parsed .shtml
AddType    text/html     .shtml
AddType application/x-httpd-php .php4
AddType application/x-httpd-php .php
</VirtualHost>