debian etch apache2 virtualhosts

Discussion in 'Server Operation' started by gabrix, Oct 3, 2007.

  1. gabrix

    gabrix New Member

    A blackhole in my apache2 knowledge is for sure the new way of configuring virtualhostes .In apache2.conf i don't write the virtalhosts directive down the botom as in the old httpd.conf , but i do this only in apache2/sites-avialable/firstsite and once configured the virtualhost
    Code:
    NameVirtualHost *:80
    <VirtualHost *:80>
    
    Everithing is sorted out .
    The problem rise once i want to add a second host ... virtual host and this is usually the result:
    Code:
    root@www:~# /etc/init.d/apache2 reload
    Reloading web server config...2620
    [Wed Oct 03 17:09:48 2007] [warn] NameVirtualHost noauth.gabrix.ath.cx:80 has no VirtualHosts
    [Wed Oct 03 17:09:48 2007] [warn] NameVirtualHost noauth.gabrix.ath.cx:443 has no VirtualHosts
    
    I configure so the first virtualhost:
    Code:
    NameVirtualHost first:80
    <VirtualHost first:80>
    and so i configure the second:
    Code:
    NameVirtualHost second:80
    <VirtualHost second:80>
    How do i have to configure them properly ?
     
  2. falko

    falko Super Moderator Howtoforge Staff

    Please use the IP address in the NameVirtualHost line, no the hostname.
     
  3. gabrix

    gabrix New Member

    This is the site avialable at http://www.gabrix.ath.cx
    This its ssl version:
    Second virtualhost same machine same apache2:
    I had an ssl version for this second virtualhost too but i give up , not
    necessary !
    Before the add of virtualhost noart there was only www.gabrix.ath.cx with " * " wildcard working great but what's the procedure when a second host gets added ?
    thanks !!!!
     
  4. gabrix

    gabrix New Member

    Allor:
    i have changed configurations as you said:
    first virtualhost it had a wildcard " * "
    Code:
    NameVirtualHost 10.0.0.4:80
    <VirtualHost www.gabrix.ath.cx:80>
            ServerAdmin [email protected]
    
    same virtualhost withssl support
    Code:
    NameVirtualHost 10.0.0.4:443
    <VirtualHost www.gabrix.ath.cx:443>
    this is a tird virtualhost :
    Code:
    NameVirtualHost 10.0.0.4:80
    <VirtualHost noart.gabrix.ath.cx:80>
    This is the result of the above configurations:
    Code:
    root@www:~# /etc/init.d/apache2 restart
    Forcing reload of web server (apache2)...[Sat Oct 13 18:52:03 2007] [warn] NameVirtualHost 10.0.0.4:80 has no VirtualHosts
     waiting [Sat Oct 13 18:52:05 2007] [warn] NameVirtualHost 10.0.0.4:80 has no VirtualHosts
    What do you recon ????
     

Share This Page