created site with IPs still get "NameVirtualHost has no VirtualHosts"

Discussion in 'Installation/Configuration' started by paul_xedos, Sep 11, 2010.

  1. paul_xedos

    paul_xedos New Member

    Hi,
    I realise this is a commonly asked question but I've run out of ideas on this one despite trawling the forums and trying various suggestions

    I'm runnnig ISPconfig3 with 2 sites that use IP addresses in their config. All resolve, none point to the correct site and on httpd stop/start receive the NameVirtualHost has no virtualhosts error

    httpd.conf
    Code:
    #NameVirtualHost *:80
    NameVirtualHost 78.46.106.188:80
    NameVirtualHost 78.46.106.188:443
    Include /etc/httpd/conf/sites-enabled/
    .vhosts file
    Code:
    <Directory /var/www/glebegallery.com>
        AllowOverride None
        Order Deny,Allow
        Deny from all
    </Directory>
    
    <VirtualHost 78.46.106.188:80>
        DocumentRoot /var/www/clients/client3/web19/web
    
        ServerName glebegallery.com
    	
        <Directory /var/www/glebegallery.com/web>
            Options FollowSymLinks
            AllowOverride All
            Order allow,deny
            Allow from all
            
            # ssi enabled
            AddType text/html .shtml
            AddOutputFilter INCLUDES .shtml
            Options +Includes
        </Directory>
        <Directory /var/www/clients/client3/web19/web>
            Options FollowSymLinks
            AllowOverride All
            Order allow,deny
            Allow from all
            
            # ssi enabled
            AddType text/html .shtml
            AddOutputFilter INCLUDES .shtml
            Options +Includes
        </Directory>
    
        # cgi enabled
    	<Directory /var/www/clients/client3/web19/cgi-bin>
          Order allow,deny
          Allow from all
        </Directory>
        ScriptAlias  /cgi-bin/ /var/www/clients/client3/web19/cgi-bin/
        AddHandler cgi-script .cgi
        AddHandler cgi-script .pl
        # suexec enabled
        SuexecUserGroup web19 client3
        # suphp enabled
        <Directory /var/www/clients/client3/web19/web>
            suPHP_Engine on
            # suPHP_UserGroup web19 client3
            AddHandler x-httpd-suphp .php .php3 .php4 .php5
            suPHP_AddHandler x-httpd-suphp
        </Directory>
    
    
    </VirtualHost>
    
    [root@ww1-02 sites-enabled]# apachectl -S
    [Fri Sep 10 23:06:37 2010] [warn] NameVirtualHost *:80 has no VirtualHosts
    VirtualHost configuration:
    78.46.106.188:80 is a NameVirtualHost
    default server gacycles.co.uk (/etc/httpd/conf/sites-enabled/gacycles.co.uk.vhost:7)
    port 80 namevhost gacycles.co.uk (/etc/httpd/conf/sites-enabled/gacycles.co.uk.vhost:7)
    port 80 namevhost glebegallery.com (/etc/httpd/conf/sites-enabled/glebegallery.com.vhost:7)
    78.46.106.188:443 is a NameVirtualHost
    default server gacycles.co.uk (/etc/httpd/conf/sites-enabled/gacycles.co.uk.vhost:75)
    port 443 namevhost gacycles.co.uk (/etc/httpd/conf/sites-enabled/gacycles.co.uk.vhost:75)
    wildcard NameVirtualHosts and _default_ servers:
    _default_:443 ww1-02.osit.com (/etc/httpd/conf.d/ssl.conf:81)
    *:8080 is a NameVirtualHost
    default server ww1-02.osit.com (/etc/httpd/conf/sites-enabled/000-ispconfig.vhost:10)
    port 8080 namevhost ww1-02.osit.com (/etc/httpd/conf/sites-enabled/000-ispconfig.vhost:10)
    Syntax OK

    I've also tried adding a default site with wildcard instead of IP address to stop the error (which it does) but it does not stop the the other sites from not picking up their correct Docuement Root locations

    Thanks
    Paul
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Thats absolutely ok and not an error. It just means that you can assign SSL certificates to some of the IP addresses.
     
  3. paul_xedos

    paul_xedos New Member

    Hi Till,
    Thanks for the reply. The problem is more an issue of the correct sites not being pointed to with apache not finding http://glebegallery.com and instead falling through to the lower in the alphabet site. If I add a site called default.com everything points to that. Pointing the site to the IP address does not seemed to have helped on this occasion
    Thanks
    Paul
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    1) Check the DNS Records of all sites and ensure that they point to the exact same IP address that you selected for that domain in the website settings.
    2) Do not mix * and IP's in the website settings on the same server. Either all websites have to use * or all websites have to use the IP.
     
  5. paul_xedos

    paul_xedos New Member

    Till,

    Thanks for your reply. I don't know how you manage to answer so many questions but I'm very glad that you do as that was the fix.

    Thanks
    Paul
     
  6. stevegjacobs

    stevegjacobs New Member

    I think this relates to my problem

    I only have one site, and when i changed it from * to <ip_address>, the domain points everything to the root server file in /var/www/ instead of to the appropriate /var/www/client1/web1/web folder
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    This happens when apache does not find a matching vhost for the website, e.g. when the IP address that you selected for the website does not match with the IP address of the dns records. If your server is behind a router, then the dns has to point to the external IP address instead and you have to select the IP address in the website settings where your router forwards port 80 and 443 to.
     

Share This Page