=OTS=G-Man 26 Light Poster

Hello everyone,

Im trying to get my server setup for a small web hosting type system (for friends). everything is working except subdomains

ive used vhost_alias for ever when i was just hosting my site to do wildcard subdomains. But I can'e seem to get it working on more then my domain, even though they all have the same configuration.

here are my vhost files

site1.com (main site, working wildcard subdomains)

<VirtualHost *:80>
    DocumentRoot "/home/www/site1_com/public_html"
    ServerName site1.com
    ServerAlias www.site1.com
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "/home/www/site1_com/subdomain"
    ServerName everything.site1.com
</VirtualHost>

<VirtualHost *:80>
   ServerAlias *.site1.com
   UseCanonicalName Off

   LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon
   CustomLog /home/www/site1_com/logs/subdomains.access.log vcommon
   ErrorLog /home/www/site1_com/logs/subdomains.error.log

   VirtualDocumentRoot /home/www/site1_com/subdomain/%1

</VirtualHost>

here is site2 (subdomains do not work, no errors in logs)

<VirtualHost *:80>
    ServerName site2.com
    ServerAlias www.site2.com
    DocumentRoot /home/www/site2_com/public_html/
    CustomLog /home/www/site2_com/logs/access.log combined
    ErrorLog /home/www/site2_com/logs/error.log
</VirtualHost>

<VirtualHost *:80>
   ServerAlias *.site2.com
   UseCanonicalName Off

   LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon
   CustomLog /home/www/site2_com/logs/subdomains.access.log vcommon
   ErrorLog /home/www/site2_com/logs/subdomains.error.log

   VirtualDocumentRoot /home/www/site2_com/subdomain/%1

</VirtualHost>

Is it just not possible to do this with name based virtual hosting ??

Thanks in advance
Don G.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.