LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-21-2010, 06:50 AM   #1
MeccaOz
LQ Newbie
 
Registered: Mar 2010
Posts: 5

Rep: Reputation: 0
Subdomains not working


Hi everyone i recently had my hosts make a dns change and add a subdomain to their dns and now my subdomains all point to the main website, I think it may be a problem ive caused with my virtual hosts. I have several ips the subdomains that are ip based are fine they resolve as expected.

here is my main sites virtual host file

Code:
<VirtualHost 64.xx.xxx.xx:80>
        ServerAdmin webmaster@example.com
        ServerName  www.exampledomain.com
        ServerAlias exampledomain.com

        # Indexes + Directory Root.
        DirectoryIndex index.html index.php
        DocumentRoot /var/www/exampledomain.com/htdocs/
</VirtualHost>
and here is the subdomain in questions file

Code:
<VirtualHost *>
        ServerAdmin webmaster@example.com
        ServerName  subdomain.exampledomain.com
        ServerAlias subdomain.exampledomain.com

        # Indexes + Directory Root.
        DirectoryIndex index.html index.php
        DocumentRoot /var/www/exampledomain.com/subdomains/subdomain/htdocs/

</VirtualHost>
Im assuming it has to do with the subdomain using the wildcard "<VirtualHost *>" but if so, i have no idea what to do I have tried several things like <VirtualHost subdomain.exampledomain.com> and <VirtualHost 64.xx.xxx.xx:80>.
I have even put the subdomain into the main sites virtual host file, and being debian i a2ensite'ed it restarted the server, reloaded it etc.
My hosts say they have wildcarded all subdomains in their dns, but knowing very little about dns Im not sure what effect that would have?

Any clues as to how i can get my subdomains pointing to the right directories again without ip basing them all?
 
Old 03-21-2010, 09:02 AM   #2
MeccaOz
LQ Newbie
 
Registered: Mar 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Got them back working, thought id post how for anyone else.

Code:
<VirtualHost *>
        ServerAdmin webmaster@example.com
        ServerName  www.exampledomain.com
        ServerAlias exampledomain.com

        # Indexes + Directory Root.
        DirectoryIndex index.html index.php
        DocumentRoot /var/www/exampledomain.com/htdocs/
</VirtualHost>
I replaced the ip in the main domain file back to the wildcard * EG <VirtualHost *>
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
subdomains behind single IP dawonn Linux - Networking 2 05-05-2009 12:26 PM
Virtual subdomains? timothyb89 Linux - Server 4 10-04-2007 06:44 AM
subdomains tommytomato Ubuntu 9 06-20-2007 07:30 AM
Subdomains tommytomato Linux - Newbie 5 02-04-2004 09:48 AM
Subdomains papaj Linux - General 7 04-26-2003 04:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration