Virtual sites and root site

Discussion in 'General' started by tyre, Sep 25, 2009.

  1. tyre

    tyre New Member

    [SOLVED] Virtual sites and root site

    I'm sure this is something easy I missed, but am having a heck of a time figuring it out. The scenario is this:

    -- The details --
    I have ISPconfig3.0.1.4 setup on Ubuntu 9.04 and it's running great. I have my main domain (lets say domain.com) registered with name servers (ns1.domain.com, etc).

    I have created sites via ispconfig and after added them to the dns manager, they are running as expected with the ISPconfig generic template. (e.g. domainA.com is using name server ns1.domain.com and is being served the right domain.)

    -- The Question --
    However, my main site (domain.com) is pulling the default apache2 site (/var/www/ instead of /var/www/domain.com/web/) displaying the "It Works!" page. Is this by design or did I miss something? It seems weird to have the vhost sites in the root of my main site...

    Additionally, if anyone would care to shed light - are my actions of adding the site to ISPconfig as well as using the dns wizard to add the DNS entries the correct way to go? Is ISPconfig supposed to do the DNS automatically, such as plesk or cpanel might? I ask so incase the two issues are related, and because finding direct into about this was difficult.

    Thank you for your time :)
     
    Last edited: Sep 26, 2009
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    There is no such thing as a mian site and virtual sites in ispconfig. Just create a new website "domain.com" in ISPConfig if you want to have a website domain.com.

    Not at all. Because suexec is compiled in apache statically and will work only in subfolders of /var/www

    No.
     
  3. tyre

    tyre New Member

    I'm sorry, I re-read my post and noticed that I failed to mention that. I tried that already, with no success. There is a folder called 'domain.com' in my /var/www/ folder that isn't being used when the site is pulled up via domain.com or by IP. The default apache document is instead.

    I meant it seeming weird all the sites being in var/www when my root site was running in there, like index.html, contact.html, domain2.com folder, etc.. instead of how i want it:
    /var/www/domain.com/www/
    /var/www/domainA.com/www/

    I really apreciate you taking the time to help me out with this; I'm sorry for the lack of information in my prior post, I was sure I had included that in there.

    Also, for information sakes here's my settings for domain.com in ISPConfig:

    Sites | Websites
    server - domain.com in dropdown
    client - blank
    ip - *
    domain - domain.com
    quota, cgi, etc stuff
    auto-subdomain - www.
    ssl off
    active checked

    DNS Entries
    server - domain.com in dropdown
    client - blank
    zome - domain.com.
    ns - ns1.domain.com.
    email - mail.domain.com.
    default times
    allow zone transfers - static ip of box (nothing works without this on this particular/root domain i've noticed)
    active - yes

    Type Name Data Priority
    A domain.com. 1.2.3.4 0
    MX - these are set to the google apps settings and work for this domain as expected. ([email protected] goes to google )
    NS domain.com. ns1.domain.com. 0
    NS domain.com. ns2.domain.com. 0
     
    Last edited: Sep 25, 2009
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    The server must be empty before you install ispconfig and you may not copy any sites directly into the /var/www folder!
    You have to create the sites in ISPConfig and then add the content in the folders that ISPConfig created. Do not create any folders manually in /var/www or upload content directly to the /var/www folder.

    Instead of * you should select the IP address for the site if the site does not get displayed.
     
  5. tyre

    tyre New Member

    Well, the server was empty as far as it could be. The "It Works!" index.html is placed there by apache by default. I used this guide explicitly http://www.howtoforge.com/perfect-server-ubuntu-9.04-ispconfig-3.

    I created no folders and edited no content. I was using the index.html, contact.html as an example of what I don't want to have to do when domain.com goes live.

    In the IP-Address drop down box that has an asterisk, that is the only choice. (If I edit the site or create a new, it only shows an asterisk). So perhaps that's the root of my problem?

    Just to make sure i'm communicating clearly, and I apologize if i'm not doing a good job with that:

    I have a fresh jaunty install with apache2 and ispconfig3.
    I created the domain.com site and domain.com dns entries, added ns1.domain.com and ns2.domain.com pointing to my ip with my registrar and now domain.com goes to my server.
    I added additional domains, added their dns zones, and set their name servers to ns1.domain.com and ns2.domain.com via the registrar and they work as expected. (going to domainA.com loads /var/www/domainA.com/www/index.html )
    But although I've created domain.com via ISPconfig (and can thus see the folder sitting there) the server is still serving the default apache document. Which is how it was i first installed everything and hadn't even loaded ispconfig.. just went to http://1.2.3.4/ (ip of website).

    Thank you so much for your help and patience.
     
    Last edited: Sep 25, 2009
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Add all IP addresses that you want to use for websites under system > edit server ip and then select the correct IP that corresponds with the dns record of the domain in the website settings.
     
  7. tyre

    tyre New Member

    Thank you Till - That was the issue. domain.com is now loading the correct folder. I altered the index.html file in domain.com/web just to make sure and it is indeed working.

    I have one lingering issue however. I have about 4 domains setup to play around with - and so now that I have set the IP in the site setup on each of them, they work. (I edited the titles of the template page to say 'welcome to domainA' and it worked.)..

    However when I went to the IP (like http://1.2.3.4) it was serving the domainA.com site, not the domain.com site. So I deleted domainA.com and it's DNS entries (And verified there weren't any misplaced ones in domain.com) and now the i'm getting an 'The requested URL / was not found on this server' error page. (just like if i go to domainA.com).

    It seems weird that it's defaulting to domainA.com when i go to the IP - even when the site and it's DNS entries have been removed (like, i'd more likely assume it'd go to domainB.com). Did I miss something here?
     
  8. tyre

    tyre New Member

    Figured it out. Thanks you so much Till for your patience and valuable information.

    I had "Allow zone transfers to these IPs" filled in with the server IP - which was allowing it to seem like it was working before because I hadn't put the server IP into the settings. But was was happening is that all the sites that looked like they were working (the default 'Welcome to your website!' page) were actually all of the root domain, and not the sub domains. (i.e. all were routing to the zone transfer ip solely).

    So here's what I did to make it all work:

    Add the IP of the server to the "Edit Server IP" section under "System".

    Added the root site (i.e. domain.com) to the "Sites" section. I made sure the server IP was selected, checked my checkboxes for cgi/php/etc and clicked SAVE.

    Then added my domain into the DNS settings. Selected the only server, whatever client if any, the zone 'domain.com.' (don't forget the trailing dot), ns of ns1.domain.com., email of mail.domain.com and Allow zone transfers was blank. Made sure active is checked and clicked SAVE.

    Opened that same DNS entry on the list and clicked records. added NS records zone: domain.com. nshostname: ns1.domain.com. - repeated with ns2.

    This domain is hosted through godaddy, so i was sure to add the ns1.domain.com and ns2.domain.com into the host summary pointing to the server ip.

    It all works! :) Thanks again Till
     

Share This Page