FAQ
Hi,

I keep getting a "NameVirtualHost *:80 has no VirtualHosts" warning with
the configuration below. Apache version 2.2.16. It is on server named
"jana", 192.168.1.103, accessible only from my LAN.

I read the following documentation sections:
- Name-based Virtual Host Support
- VirtualHost Examples
- An In-Depth Discussion of Virtual Host Matching

I couldn't see any relevant messages in the error.log
I searched Bugzilla for "NameVirtualHost has no VirtualHosts" and it
answered "Zarro Boogs found."

Please help me by giving your opinion about what might be wrong!

Luc

Content of /etc/apache2/sites-available/default
------------
NameVirtualHost *:80
ServerName jana
ServerAdmin webmaster@localhost
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel debug
CustomLog ${APACHE_LOG_DIR}/access.log combined

WSGIApplicationGroup %{GLOBAL}

<VirtualHost *:80>
ServerName dsbe.jana
DocumentRoot /usr/share/apache2/default-site

<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>

WSGIDaemonProcess dsbe processes=2 threads=15
WSGIProcessGroup dsbe

WSGIScriptAlias / /usr/local/django/dsbe_eupen/wsgi.py
Alias /media/ /usr/local/django/dsbe_eupen/media/
<Location /media/>
SetHandler none
</Location>

DavLockDB /tmp/DavLock

<Location /media/webdav/>
DAV On
# ForceType text/plain
AuthType Basic
AuthName "WebDAV dsbe_eupen@jana"
AuthUserFile /usr/local/django/dsbe_eupen/htpasswd/passwords
AuthGroupFile /usr/local/django/dsbe_eupen/htpasswd/groups
#<LimitExcept GET>
#Require group dav
#</LimitExcept>
</Location>

<Location />
AuthType Basic
AuthName "dsbe_eupen@jana"
AuthUserFile /usr/local/django/dsbe_eupen/htpasswd/passwords
AuthGroupFile /usr/local/django/dsbe_eupen/htpasswd/groups
Require group lino
# AllowOverride None
</Location>

</VirtualHost>

<VirtualHost *:80>
ServerName wsl.jana
DocumentRoot /usr/share/apache2/default-site

<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>


WSGIDaemonProcess wsl processes=2 threads=15
WSGIProcessGroup wsl

WSGIScriptAlias / /usr/local/django/wsl/apache/django.wsgi
Alias /media/ /usr/local/django/wsl/media/
<Location /media/>
SetHandler none
</Location>

</VirtualHost>

<VirtualHost *:80>

ServerName aze.jana
DocumentRoot /usr/share/apache2/default-site

WSGIApplicationGroup %{GLOBAL}

WSGIDaemonProcess aze processes=2 threads=15
WSGIProcessGroup aze

WSGIScriptAlias / /usr/local/django/aze/wsgi.py

Alias /media/ /usr/local/django/aze/media/
<Location /media/>
SetHandler none
</Location>

<Directory /usr/local/django/aze>
Order deny,allow
Allow from all
</Directory>

<Location />
AuthType Basic
AuthName "aze@jana"
AuthUserFile /usr/local/django/aze/htpasswd/passwords
AuthGroupFile /usr/local/django/aze/htpasswd/groups
Require group lino
# AllowOverride None
</Location>

</VirtualHost>
------------

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

Search Discussions

  • Rainer Frey at Apr 10, 2012 at 7:26 am

    On 10.04.2012, at 09:12, Luc Saffre wrote:

    Hi,

    I keep getting a "NameVirtualHost *:80 has no VirtualHosts" warning with
    the configuration below. Apache version 2.2.16.
    Please help me by giving your opinion about what might be wrong!
    Content of /etc/apache2/sites-available/default
    2 ideas:
    * the default site is not enabled (see /etc/apache2/sites-enabled - there should be a 000-default symlink)
    * your apache starts with a completely different config

    You can verify with apachectl -S and apachectl -V

    Rainer


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
    For additional commands, e-mail: users-help@httpd.apache.org
  • Eric Covener at Apr 10, 2012 at 10:02 am
    You have another "NameVirtualHost *:80" in your configuration, try grep.

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
    For additional commands, e-mail: users-help@httpd.apache.org
  • Luc Saffre at Apr 10, 2012 at 11:09 am
    Thanks, Eric and Rainer, for your replies.
    On 10.04.2012 10:26, Rainer Frey wrote:
    2 ideas:
    * the default site is not enabled (see /etc/apache2/sites-enabled - there should be a 000-default symlink)
    * your apache starts with a completely different config
    I forget to mention that I had tested that possibility by putting some
    deliberate syntax error into the config file. This produced the expected
    error messages. Also the following seems correct and simple:

    # ls -l /etc/apache2/sites-enabled/
    total 0
    lrwxrwxrwx 1 root root 26 Jun 7 2011 000-default -> \
    ../sites-available/default

    And to answer to Eric's suggestion, no, there's no accidental second
    NameVirtualHost directive:

    # grep NameVirtual /etc/apache2/sites-enabled/*
    NameVirtualHost *:80
    You can verify with apachectl -S and apachectl -V
    Good idea. But also here I cannot see anything anormal. Maybe somebody
    else does:

    # apachectl -S
    [Tue Apr 10 10:50:43 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
    VirtualHost configuration:
    wildcard NameVirtualHosts and _default_ servers:
    *:80 is a NameVirtualHost
    default server dsbe.jana
    (/etc/apache2/sites-enabled/000-default:15)
    port 80 namevhost dsbe.jana
    (/etc/apache2/sites-enabled/000-default:15)
    port 80 namevhost wsl.jana
    (/etc/apache2/sites-enabled/000-default:66)
    port 80 namevhost aze.jana
    (/etc/apache2/sites-enabled/000-default:87)
    Syntax OK

    # apachectl -V
    Server version: Apache/2.2.16 (Debian)
    Server built: Sep 25 2011 22:18:56
    Server's Module Magic Number: 20051115:24
    Server loaded: APR 1.4.2, APR-Util 1.3.9
    Compiled using: APR 1.4.2, APR-Util 1.3.9
    Architecture: 32-bit
    Server MPM: Prefork
    threaded: no
    forked: yes (variable process count)
    Server compiled with....
    -D APACHE_MPM_DIR="server/mpm/prefork"
    -D APR_HAS_SENDFILE
    -D APR_HAS_MMAP
    -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
    -D APR_USE_SYSVSEM_SERIALIZE
    -D APR_USE_PTHREAD_SERIALIZE
    -D APR_HAS_OTHER_CHILD
    -D AP_HAVE_RELIABLE_PIPED_LOGS
    -D DYNAMIC_MODULE_LIMIT=128
    -D HTTPD_ROOT="/etc/apache2"
    -D SUEXEC_BIN="/usr/lib/apache2/suexec"
    -D DEFAULT_PIDLOG="/var/run/apache2.pid"
    -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
    -D DEFAULT_LOCKFILE="/var/run/apache2/accept.lock"
    -D DEFAULT_ERRORLOG="logs/error_log"
    -D AP_TYPES_CONFIG_FILE="mime.types"
    -D SERVER_CONFIG_FILE="apache2.conf"
    #

    Best regards,
    Luc
    (still locked, and still hoping for your ideas)

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
    For additional commands, e-mail: users-help@httpd.apache.org
  • Eric Covener at Apr 10, 2012 at 11:25 am

    # grep NameVirtual /etc/apache2/sites-enabled/*
    NameVirtualHost *:80
    try a more comprehensive search?

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
    For additional commands, e-mail: users-help@httpd.apache.org
  • aparna Puram at Apr 10, 2012 at 11:25 am
    Hi,

    Did u try rebuilding the apache config file using the following script?

    /scripts/rebuildhttpdconf

    On Tue, Apr 10, 2012 at 4:38 PM, Luc Saffre wrote:

    Thanks, Eric and Rainer, for your replies.
    On 10.04.2012 10:26, Rainer Frey wrote:
    2 ideas:
    * the default site is not enabled (see /etc/apache2/sites-enabled -
    there should be a 000-default symlink)
    * your apache starts with a completely different config
    I forget to mention that I had tested that possibility by putting some
    deliberate syntax error into the config file. This produced the expected
    error messages. Also the following seems correct and simple:

    # ls -l /etc/apache2/sites-enabled/
    total 0
    lrwxrwxrwx 1 root root 26 Jun 7 2011 000-default -> \
    ../sites-available/default

    And to answer to Eric's suggestion, no, there's no accidental second
    NameVirtualHost directive:

    # grep NameVirtual /etc/apache2/sites-enabled/*
    NameVirtualHost *:80
    You can verify with apachectl -S and apachectl -V
    Good idea. But also here I cannot see anything anormal. Maybe somebody
    else does:

    # apachectl -S
    [Tue Apr 10 10:50:43 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
    VirtualHost configuration:
    wildcard NameVirtualHosts and _default_ servers:
    *:80 is a NameVirtualHost
    default server dsbe.jana
    (/etc/apache2/sites-enabled/000-default:15)
    port 80 namevhost dsbe.jana
    (/etc/apache2/sites-enabled/000-default:15)
    port 80 namevhost wsl.jana
    (/etc/apache2/sites-enabled/000-default:66)
    port 80 namevhost aze.jana
    (/etc/apache2/sites-enabled/000-default:87)
    Syntax OK

    # apachectl -V
    Server version: Apache/2.2.16 (Debian)
    Server built: Sep 25 2011 22:18:56
    Server's Module Magic Number: 20051115:24
    Server loaded: APR 1.4.2, APR-Util 1.3.9
    Compiled using: APR 1.4.2, APR-Util 1.3.9
    Architecture: 32-bit
    Server MPM: Prefork
    threaded: no
    forked: yes (variable process count)
    Server compiled with....
    -D APACHE_MPM_DIR="server/mpm/prefork"
    -D APR_HAS_SENDFILE
    -D APR_HAS_MMAP
    -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
    -D APR_USE_SYSVSEM_SERIALIZE
    -D APR_USE_PTHREAD_SERIALIZE
    -D APR_HAS_OTHER_CHILD
    -D AP_HAVE_RELIABLE_PIPED_LOGS
    -D DYNAMIC_MODULE_LIMIT=128
    -D HTTPD_ROOT="/etc/apache2"
    -D SUEXEC_BIN="/usr/lib/apache2/suexec"
    -D DEFAULT_PIDLOG="/var/run/apache2.pid"
    -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
    -D DEFAULT_LOCKFILE="/var/run/apache2/accept.lock"
    -D DEFAULT_ERRORLOG="logs/error_log"
    -D AP_TYPES_CONFIG_FILE="mime.types"
    -D SERVER_CONFIG_FILE="apache2.conf"
    #

    Best regards,
    Luc
    (still locked, and still hoping for your ideas)

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
    For additional commands, e-mail: users-help@httpd.apache.org
  • Luc Saffre at Apr 10, 2012 at 2:40 pm
    Tilt, I got it! Thanks again, Eric, and Aparna.

    To try your suggestions I dived more into the details of Apache config
    specials on Debian
    (http://www.control-escape.com/web/configuring-apache2-debian.html) and
    finally found that there was indeed another "NameVirtualHost *:80" in
    `/etc/apache2/ports.conf`.
    So the solution was simply to remove my NameVirtualHost directive from
    `default`.

    Luc
    On 10.04.2012 14:24, aparna Puram wrote:
    Hi,

    Did u try rebuilding the apache config file using the following script?

    /scripts/rebuildhttpdconf


    On Tue, Apr 10, 2012 at 4:38 PM, Luc Saffre wrote:

    Thanks, Eric and Rainer, for your replies.
    On 10.04.2012 10:26, Rainer Frey wrote:
    2 ideas:
    * the default site is not enabled (see /etc/apache2/sites-enabled
    - there should be a 000-default symlink)
    * your apache starts with a completely different config
    I forget to mention that I had tested that possibility by putting some
    deliberate syntax error into the config file. This produced the expected
    error messages. Also the following seems correct and simple:

    # ls -l /etc/apache2/sites-enabled/
    total 0
    lrwxrwxrwx 1 root root 26 Jun 7 2011 000-default -> \
    ../sites-available/default

    And to answer to Eric's suggestion, no, there's no accidental second
    NameVirtualHost directive:

    # grep NameVirtual /etc/apache2/sites-enabled/*
    NameVirtualHost *:80
    You can verify with apachectl -S and apachectl -V
    Good idea. But also here I cannot see anything anormal. Maybe somebody
    else does:

    # apachectl -S
    [Tue Apr 10 10:50:43 2012] [warn] NameVirtualHost *:80 has no
    VirtualHosts
    VirtualHost configuration:
    wildcard NameVirtualHosts and _default_ servers:
    *:80 is a NameVirtualHost
    default server dsbe.jana
    (/etc/apache2/sites-enabled/000-default:15)
    port 80 namevhost dsbe.jana
    (/etc/apache2/sites-enabled/000-default:15)
    port 80 namevhost wsl.jana
    (/etc/apache2/sites-enabled/000-default:66)
    port 80 namevhost aze.jana
    (/etc/apache2/sites-enabled/000-default:87)
    Syntax OK

    # apachectl -V
    Server version: Apache/2.2.16 (Debian)
    Server built: Sep 25 2011 22:18:56
    Server's Module Magic Number: 20051115:24
    Server loaded: APR 1.4.2, APR-Util 1.3.9
    Compiled using: APR 1.4.2, APR-Util 1.3.9
    Architecture: 32-bit
    Server MPM: Prefork
    threaded: no
    forked: yes (variable process count)
    Server compiled with....
    -D APACHE_MPM_DIR="server/mpm/prefork"
    -D APR_HAS_SENDFILE
    -D APR_HAS_MMAP
    -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
    -D APR_USE_SYSVSEM_SERIALIZE
    -D APR_USE_PTHREAD_SERIALIZE
    -D APR_HAS_OTHER_CHILD
    -D AP_HAVE_RELIABLE_PIPED_LOGS
    -D DYNAMIC_MODULE_LIMIT=128
    -D HTTPD_ROOT="/etc/apache2"
    -D SUEXEC_BIN="/usr/lib/apache2/suexec"
    -D DEFAULT_PIDLOG="/var/run/apache2.pid"
    -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
    -D DEFAULT_LOCKFILE="/var/run/apache2/accept.lock"
    -D DEFAULT_ERRORLOG="logs/error_log"
    -D AP_TYPES_CONFIG_FILE="mime.types"
    -D SERVER_CONFIG_FILE="apache2.conf"
    #

    Best regards,
    Luc
    (still locked, and still hoping for your ideas)

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
    For additional commands, e-mail: users-help@httpd.apache.org

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
    For additional commands, e-mail: users-help@httpd.apache.org

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupusers @
categoriesapache
postedApr 10, '12 at 7:13a
activeApr 10, '12 at 2:40p
posts7
users4
websitehttpd.apache.org
irc#httpd

People

Translate

site design / logo © 2022 Grokbase