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

Re: NameVirtualHost and dynamic subdomains on apache.



On Tue, 1 Apr 2008 11:58:24 -0400
"Michael Habashy" <mjh2000@gmail.com> wrote:

> i had created this file called www.XXX.com and placed it into the
> /etc/apache2/sites-available directory.
> <VirtualHost *>
>         ServerAdmin webmaster@XXX.com
>         ServerName  XXX.com
>         ServerAlias *.XXX.com
> 
>         # Indexes + Directory Root.
>         DirectoryIndex index.php index.html
>         DocumentRoot /var/www/html/websites/XXX.com/public_html/
> 
>         # CGI Directory
>         #
> ScriptAlias /cgi-bin/ /var/www/html/websites/XXX.com/cgi-bin/ #
> <Location /cgi-bin> #         Options +ExecCGI
>         # </Location>
> 
> 
>         # Logfiles
>         ErrorLog  /var/log/apache2/www.XXX.com/logs/error.log
>         CustomLog /var/log/apache2/www.XXX.com/logs/access.log
> combined </VirtualHost>


Using a *.XXX.com won't work.  You need to define a virtual host for
each and every website on your server including all sub-domains and
then place the files in the appropriate directories.

Once you have the configuration files in place, execute 

a2ensite $sitename$ 

and then reload Apache

/etc/init.d/apache2 reload

Hope this helps,

Matt.

-- 
|Matthew Macdonald-Wallace
|Tiger Computing Ltd
|"The Linux Specialists"
|
|Tel: 0330 088 1511
|Web: http://www.tiger-computing.co.uk
|
|Registered in England. Company number: 3389961
|Registered address: Wyastone Business Park,
| Wyastone Leys, Monmouth, NP25 3SR


Reply to: