Problem with (manual) virtual hosts

Discussion in 'Installation/Configuration' started by ormente, Jan 26, 2011.

  1. ormente

    ormente New Member

    Hi !

    I'm trying to set-up a bunch of small websites, but don't want to creat each one in ISPconfig. So i created a "container" and put each subsite in a subfolder of the "main" web folder.

    So, i create a config file in /etc/apache2/sites-availlable, make a link to it in sites-enabled, and reload apache config. The DNS of each domain (2 external DNS servers, no zone set on my server) are corectly configured with A -> my server IP.

    But accessing the sites display the default welcome page ("It works!"), and I can't find where the problem is.

    Here is the conf file for one domain (later it will contain several similar vhosts) :

    (MYSITE is the site name, located in the web folder of MAINSITE)

    Code:
    <VirtualHost *:80>
        DocumentRoot /var/www/clients/client4/web13/web/MYSITE
    
        ServerName MYSITE.com
        ServerAlias www.MYSITE.com
        ServerAdmin [email protected]
    
        ErrorLog /var/log/ispconfig/httpd/MAINSITE/error.log
    	
        <Directory /var/www/MAINSITE.com/web/MYSITE>
            Options FollowSymLinks
            AllowOverride Indexes AuthConfig Limit FileInfo
            Order allow,deny
            Allow from all
        </Directory>
        <Directory /var/www/clients/client4/web13/web/MYSITE>
            Options FollowSymLinks
            AllowOverride Indexes AuthConfig Limit FileInfo
            Order allow,deny
            Allow from all
        </Directory>
        
        # suexec enabled
        SuexecUserGroup web13 client4
        # suphp enabled
        <Directory /var/www/clients/client4/web13/web/MYSITE>
            suPHP_Engine on
            # suPHP_UserGroup web13 client4
            AddHandler x-httpd-suphp .php .php3 .php4 .php5
            suPHP_AddHandler x-httpd-suphp
        </Directory>
        
    </VirtualHost>
    When i reload apache config, everything seems fine : no error, except if i introduce a syntax error in the conf file, showing that it is effectively loaded and parsed. No error, but doing nothing visible !

    If I declare MYSITE in ISPconfig as an alias of MAINSITE, everything work as exepcted : MYSITE.COM display MAINSITE.COM (this is not what i want to do).

    Anybody have a clue ?

    Great thanks !
     
    Last edited: Jan 26, 2011
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Replace:

    <VirtualHost *:80>

    with:

    <VirtualHost 192.168.0.100:80>

    where 192.168.0.100 is the IP of your server and then restart apache.
     
  3. ormente

    ormente New Member

    thanks Till, i just tried that.

    That worked... kind of...

    MYSITE.com was accesible... but all other sites on the server suddenly served the content of MYSITE.com!

    (all sites are configured qith * as IP-Adress in ISPconfig website panel)
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok. Then you have to use * for that vhost as well. as * and IP can not be mixed on a system.
     
  5. ormente

    ormente New Member

    Curiously, I checked and found one forgotten site with IP. But everything worked fine! Now i have * instead of IP for all my sites and :
    A - all "regular" ISPconfig declared sites are online.
    B - the (working) site that had the IP still works, but CGIs in main dir (not cgi-bin) does not run anymore (403)
    C - still, the site i declare with custom .vhost display the default "It works!" page :-(

    Thanks for your help, it's greatly apreciated.


    EDIT : for B, i added +ExecCGI in options/apache directives... CGIs are back.
     
    Last edited: Jan 26, 2011
  6. ormente

    ormente New Member

    Wow ! that was weird.... and somewhat logical !

    I happend to run cat MYSITE.vhost, and saw something very strange : a space just before the tld "com" :
    Code:
        ServerName videos2musique. com
        ServerAlias www.videos2musique. com
    
    the strange part is that these spaces were not visible in my text editor, even with "show spaces" turned on! (i double checked !)

    Everything is fine now.

    Big thanks for your kind help.
     

Share This Page