ispconfig3 Multiple Sites (Domains) in one Server

Discussion in 'General' started by dcarlos, Mar 14, 2009.

Thread Status:
Not open for further replies.
  1. dcarlos

    dcarlos New Member

    I'm trying to figure out how to use ispconfig3 to host two different Sites (Domains) in a single Server.

    First of all I should say I'm not a server admin expert :)

    I can add the two Sites, for example:
    www.mydomain1.com and www.mydomain2.com

    However this seams to generate two equal VirtualHosts in the httpd configuration.
    mydomain1.com.vhost:
    ...
    <VirtualHost *:80>
    ...

    mydomain2.com.vhost:
    ...
    <VirtualHost *:80>
    ...
    In apache one will overlap the other, right?
    Am I supposed to use Virtual IP addresses to do this?

    Shouldn't ispconfig3 use domain names in the VirtualHost directive instead of ip addresses?
    If so we would have:
    <VirtualHost mydomain1.com:80>

    Thanks in advance,
    duarte
     
    Last edited: Mar 14, 2009
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Just click on new domain, enter the domain and click on save. You can add hundreds or thousands of domains like this to the same server.

    No. They are not equal as the domain of the vhost does not has to be set in the virtualhost directive. Just try it and you see that it works.

    No.

    No.

    No.
     
  3. dcarlos

    dcarlos New Member

    Thanks

    Correct. Thanks for the help!
     
  4. OvrFlote

    OvrFlote New Member

    Not exactly true

    I came to this forum for some help and found this thread. It seemed to be right on track with the problem I am having, but his issue seems to be resolved and I'm still having the issue.

    I installed ispconfig3 over opensuse 11.1 on an old box I had laying around.
    I have 2 domain names from dyndns.com (one for me, and one for my wife)
    I set her site up first everything works great, then I set my site up, and the problem begins.

    when i run the command:

    /etc/init.d/apache2 restart

    this is what i get now:

    [Thu Jun 18 07:55:37 2009] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
    Syntax OK
    Shutting down httpd2 (waiting for all children to terminate) done
    Starting httpd2 (prefork) [Thu Jun 18 07:55:38 2009] [warn] _default_ VirtualHost overlap on port 80, the first has precedence

    so it seems as though, the original post about the virtualhosts overlapping is true.

    so now i recieve the generic ispconfig "Welcome!" when i go to either site. I have racked my brain for months on this so i decided to post.

    and if you can't tell I am a Newb. so go easy if i am doing something stupid.:D
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    Thats fine as this message is only shown when your sites are working. So now just upload the content of your sites and delete the default index.html file created by ispconfig.
     
  6. OvrFlote

    OvrFlote New Member

    Nevermind

    Ok so this is what I did to fix the issue, hope this helps some other fellow linux newbs.

    cd /etc/apache2

    vi listen.conf

    delete the # in front of "NamedVirtualHost *:80"

    ==========================================
    # Use name-based virtual hosting
    #
    # - on a specified address / port:
    #
    #NameVirtualHost 12.34.56.78:80
    #
    # - name-based virtual hosting:
    #
    NameVirtualHost *:80
    #
    # - on all addresses and ports. This is your best bet when you are on
    # dynamically assigned IP addresses:
    #
    #NameVirtualHost *
    ===============================================

    Then,

    cd vhosts.d
    cp vhost.template YourDomain1.com.conf
    cp vhost.template YourDomain2.com.conf
    vi YourDomain1.com.conf

    Now, you need to replace all the "dummy-site.com's" with YourDomain1.com, but that is it, do not uncomment anything unless you know what you are doing.

    vi YourDomain2.com.conf

    Now, you need to replace all the "dummy-site.com's" with YourDomain2.com, but that is it, do not uncomment anything unless you know what you are doing.

    Finally, restart apache

    /etc/init.d/apache2 restart

    you should see

    Syntax OK
    Shutting down httpd2 (waiting for all children to terminate) [my wife hates that terminology, lol]
    Starting httpd2 (prefork)

    there should not be anymore overlapping errors.

    this is my own newb strategy and it worked for me, I now have two sites running on one server with one ip.

    My setup is the perfect server opensuse 11.1 ispconfig 3 [thank you sourceforge]

    my question is, why doesn't ispconfig 3 do this automatically??

    Anyway, hope this helps someone. thanks again everyone.
     
    Last edited: Jun 18, 2009
  7. OvrFlote

    OvrFlote New Member

    well, the problem was that my wife's site was setup and working fine (with content), but upon me adding my site VIA ispconfig 3, did both pages start showing the same default "Welcome!" html.

    it was because apache2 was defaulting to serving only one site on both domains.
     
    Last edited: Jun 18, 2009
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    ISPConfig uses the directory sites-enabled and not vhosts.d. You will find all vhosts in the sites-eanbled subdirectory. The directory vhosts.d must be empty or ispconfig will not work properly anymore.

    If the vhost files are not in the directory sites-enabled then there is aerror in your configuration and you have to check the mintor why the files could not be written.
     
  9. OvrFlote

    OvrFlote New Member

    Right, and the .vhost files are in the sites-enabled directory, but it did not work that way for me.

    in the vhosts.d directory, there are not .vhost files but they are .conf files.

    and please advise how to fix the issue because i do not want to lose anything or break my ispconfig 3 setup.

    simply adding the sites through ispconfig admin panel does not work on my setup. I was only able to host one site before i did what was in the other post.

    is there settings i can post from my server so that you could tell me where I am going wrong?
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    1) Delete all files in vhosts.d directory.
    2) Did you select * or the IP address for the sites in the ispconfig settings?
    3) Make sure that all domains point with a dns A-Record to your server IP. Dont use any redirects.
     
  11. OvrFlote

    OvrFlote New Member

    The DNS settings / setup is another struggle entirely for me, absolutely clueless as to how to set this up. If I need to go to another thread for this, please advise.
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    1) Yes, might be the case.
    2) IP addresses can be added in the administration module. But as it works now, there is no need to do that. IP addresses are only needed if you want to use e.g. ssl or add an ip based vhost.
    3) If the sites work now then DNS is correct. So no need to do anything additionally with DNS.
     
  13. OvrFlote

    OvrFlote New Member

    so if i wanted to use ssl (probably will) what would i need to do?
     
  14. OvrFlote

    OvrFlote New Member

    Okay, now we are back to square one, I deleted my site with ispconfig, then readded my site.

    both sites are defaulting again, so i checked listen.conf and NamedVirtualHost *:80 is still uncommented

    restarted apache and got the following error:

    Syntax error on line 70 of /etc/apache2/sites-enabled/kreativkakes.hobby-site.com.vhost:
    Invalid command 'ReWriteModule', perhaps misspelled or defined by a module not included in the server configuration


    so i edited the vhost at the very bottom and commented out the "ReWriteModule On", then restarted again.

    apache started but still getting default on both sites

    so when i add a site, apache begins serving only that sites content on all domains. so maybe there is more to the DNS settings that i am just too dumb to figure out.

    getting frustrated, please help
     
  15. dclardy

    dclardy Member

    I am having the same issue. I added a new domain to my server, and the site caused my other site to go back to the default index file. How do I fix this? I am a complete noob to linux. So please be as thorough as possible?

    The sites are drewclardy.info. This one worked fine until I added the new site last night.

    Other site is www.clardyfamily.co.cc. It is also pointing to the new site page.
     
  16. OvrFlote

    OvrFlote New Member

    to solve the multiple issues I was having with ispconfig3 among other software, and I hope this doesn't make anyone mad, but I switched to CentOS 5.3, Now EVERYTHING works, no more fighting with OpenSUSE.

    Don't get me wrong, if you are a newb, (like myself) there is no other distro you need to be with than openSUSE, I truly believe that suse has user friendly down to a science. It just lacks in certain areas. So i would say, play with suse, get a feel for the power of a linux server, then change to CentOS. some commands are a little different and take a little getting used to. but You will be pleasantly surprised at how easy it is to maintain a cent box (as opposed to Suse.) I was.

    In otherwords, i think SUSE is great for desktop environments (winblows replacement OS) but for servers, RedHat has it, hands down. (centos is redhat enterprise, without the support.)

    now before anyone starts bashing me, I am a newb as well, and these are just my opinions. You are of course free to choose to stick with suse, but i went down that road faithfully, and you are in for some heartaches with suse as your server if you want to run ispconfig3.
     
  17. dclardy

    dclardy Member

    I think that I have taken care of the issue that I was having. For some reason, ISPConfig is placing an .html file in the home directory of all the websites when I add a new one. I am having to go in and delete the index.html file that is being written. Is this a none issue?

    Thanks.
     
  18. till

    till Super Moderator Staff Member ISPConfig Developer

    ISPConfig is adding the index.html file into the sites home directory when the site is created. That is the intended behaviour.
     
  19. OvrFlote

    OvrFlote New Member

    you are misunderstanding till

    Yes we all know the html file is supposed to be created when you add a site.
    BUT,
    it is not supposed to write that html file into all other previously installed and working sites. causing malfunctions with other sites when you add a new site is, hopefully, not standard procedure.
     
  20. dclardy

    dclardy Member

    It is doing it to the already established websites.

    Say I have website 1. It is up and running.

    I go in and add website 2. The server is placing a .html file there. That is fine I understand that action.

    It is also adding another .html file in the directory of website 1.
     
Thread Status:
Not open for further replies.

Share This Page