LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] VHost for httpd2.

[ILUG] VHost for httpd2.

Colm MacCarthaigh colm at stdlib.net
Fri May 20 13:04:25 IST 2005


On Fri, May 20, 2005 at 12:58:30PM +0100, Jason Corcoran wrote:
> I am trying to set up some subdomains on the machine so www.example.com  goes to /var/www/html  and test.example.com goes to /var/www/testhtml


You need something like:

<VirtualHost *>
	ServerName www.example.com
	DocumentRoot /var/www/html/
</VirtualHost>

<VirtualHost *>
	ServerName test.example.com
	DocumentRoot /var/www/testhtml/
</VirtualHost>

> <VirtualHost *>
> # primary vhost
>  DocumentRoot /var/www/html
>  RewriteEngine On
>  RewriteRule ^/.* /var/www/html/index.html
> # # ...
>  </VirtualHost>

Without a Servername, this becomes the default vhost, but that's no
problem.

> #
> # <VirtualHost *>
>  DocumentRoot /var/www/html/sub1
>  ServerName test.jcorcoran.net
>  ServerPath /sub1/

Is the <VirtualHost> line really commented out? Do you really 
need ServerPath? 

>  RewriteEngine On
>  RewriteRule ^(/sub1/.*) /var/www/html$1

These rules are probably not what you want either. Either way, you
never point anything at a testhtml directory :)

-- 
Colm MacCárthaigh                        Public Key: colm+pgp at stdlib.net



More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell