When using auto-subdomain set to www web site get error server not found

Discussion in 'Installation/Configuration' started by MrCompTech, Jul 11, 2010.

  1. MrCompTech

    MrCompTech New Member

    This server was setup according to Perfect Server Fedora 13 - ISPConfig 3

    I have two web sites each with it's own domain.

    If I set either or both web sites "Auto-Subdomain" to "www." then when I try to go to
    www.rtmdfanc.com
    or
    www.mrcomptech.com

    I receive "Server cannot be found" error message.

    If using rtmdfanc.com or mrcomptech.com both web sites come up, display the "Welcome to your website" page.

    If on the DNS tab I add an "A" record for "www" to rtmdfanc.com then then page for mrcomptech.com" is displayed.

    mrcomptech.com was created first if that makes any difference.

    If I look in /etc/named/pri.rtmdfanc.com I can see that the "A" record is there.

    On the web sites page for each of these sites the IP-Address is set to "*".

    If I change it to the only IP address available 192.168.1.10 then www.rtmdfanc.com then the page that comes up is mrcomptech.com.

    If I create an "A" record for both for "www" again, i recieve the page from the first web site.

    I can use "nslookup rtmdfanc.com 192.168.1.10" and see that DNS is workgin correctly.

    Seems this has to be in Apache virtual host settings somewhere.

    In /etc/httpd/conf/httpd.conf "NameVirtualHost *:80" is NOT commented out but when I restart Apache (/etc/init.d/httpd restart) I receive a warning error saying that "[warn] NameVirtualHost *:80 has no VirtualHosts" and yet I have two web sites running on this same server.


    Any ideas anyone?
     
    Last edited: Jul 11, 2010
  2. MrCompTech

    MrCompTech New Member

    This is a work around to the problem but it has it's short comings.

    You can edit the virtual host configuration file and set the alias for the web site.

    Example: The web site is rtmdfanc.com
    The virtual hosts file can be found in /etc/httpd/conf/sites-available.
    It is named rtmdfanc.com.vhost

    Just under "ServerName rtmdfanc.com"

    Add - ServerAlias www.rtmdfanc.com"

    The problem with this is that if you use ISPConfig3 --> Sites --> select website
    To make any changes when ISPConfig3 writes the changes it will not put the serverAlias back in!

    It would seem there needs to be a way to add the ServerAlias to ISPConfig3.

    Or perhaps that is what the "Auto-Subdomain" is supposed to be for!

    Wait a minute! Let me try this....
    Yes! that is what the "Auto-Subdomain" does!!!!!

    Geez, without a manual it more like troubleshooting!

    OK, HERE IS A VERY HELPFUL TIP WHEN WORKING WITH ISPCONFIG3 -

    DON'T BE IN A HURRAY AND WAIT A COUPLE OF MINUTES FOR A CHANEG TO TAKE PLACE...

    OR

    to have the changes you just made in ISPConfig3 put into effect now!

    run

    /usr/local/ispconfig/server/server.sh

    If you forget where it is LOCATED use the locate command to find it -

    updatedb
    locate server.sh
     
  3. MrCompTech

    MrCompTech New Member

    There really wasn't a problem in the first place! Here's the explanation.

    The original problem:

    "When using "Auto-Subdomain" set to "www" web site get error server not found"
    was actually caused by using the "Auto-Subdomain" set to "www." AND NOT waiting long enough for the ISPConfig3 cron job to run to put into effect the changes.

    This also means that adding DNS records for "www" to a domain are not neccessary.

    A problem that can be fixed by using the "Auto-Subdomain" set to "www." is when you have more than one virtual web site setup and when you try to go to say www.rtmdfanc.com instead of rtmdfanc.com and a differnent web site on your server comes up.

    Also a condition to avoid - if you use subdomains DO NOT use the "Auto-Subdomain" set to "*" because this will mean the web site that will come up would be rtmdfanc.com instead of bikes.rtmdfanc.com or hiking.rtmdfanc.com.
     
  4. Agent_M

    Agent_M New Member

    I think "*." is just intended to be a wildcard, so if you want "anything.domain.tld" to go to "domain.tld" then you would use this, if you want specific subdomains to go to a subfolder or to be a separate site altogether, then you would use either the "subdomain for website" or "Website" sections respectively ( as well as setting up relevant DNS records ).
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    A server not found error is always caused by a missing dns record and never by site settings.

    Thats wrong. If you want to use the subdomain "www" of a domain, you have to create a dns recoird for it. If you used the dns wizard in ispconfig, this subdomain is created automatically, thats why you might have thought that it is not nescessary to create it.
     
  6. MrCompTech

    MrCompTech New Member

    Hi till,

    After you post it only took a moment of thought to realize your correct.

    The alias in apache is only used by apache so that it knows which web site to send the request to. If it doesn't know what to do with a web request, that has already been resolved to an IP, then it send to the first web site it finds. I am guessing that the default method the file system uses for sorting determines which web site is the 'default' web site.

    Thanks for keeping me from leading myself and others down a wrong path :)
     

Share This Page