NameVirtualHost *:80 has no VirtualHosts

Nemesis

Nemesis

N3RD
hi,

wenn ich meinen apache2 starte, bringt er mir genannte fehlermeldung
Code:
NameVirtualHost *:80 has no VirtualHosts

ich habe gelesen, dass das daran liegen soll, dass in der httpd.conf der eintrag des virtualhosts auch nochmal steht, er aber nur einmal vorkommen darf.
meine httpd.conf ist komplett leer.

meine /etc/apache2/sites-available/default:
Code:
NameVirtualHost *:80
<VirtualHost *:80>
        ServerAdmin webmaster@localhost

        DocumentRoot /var/www/
#       <Directory />
#               Options FollowSymLinks
#               AllowOverride AuthConfig
#       </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride none
                #AuthConfig
                Order allow,deny
                allow from all
                # This directive allows us to have apache2's default start page
                # in /apache2-default/, but still have / go to the right place
                #RedirectMatch ^/$ /apache2-default/
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog /var/log/apache2/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/access.log combined
        ServerSignature On

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>

thx!
 
virtualhost darf tausendmal vorkommen .. nur namevirtualhost nicht ;)

diese config schluckt mein apache

/etc/apache2/sites-enabled/000-default
Code:
  1 NameVirtualHost *:80
  2 <VirtualHost *:80>
  3         ServerAdmin root@server.ralf-basche.local
  4         ServerName www.ralf-basche.home
  5         DocumentRoot /srv/www/htdocs
  6
  7         <Directory "/srv/www/htdocs">
  8                 Options FollowSymLinks Indexes MultiViews
  9                 AllowOverride All
 10                 Order allow,deny
 11                 allow from 192.168.160.0/24
 12         </Directory>
 13
 14         ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
 15         <Directory "/usr/lib/cgi-bin">
 16                 AllowOverride None
 17                 Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
 18                 Order allow,deny
 19                 Allow from all
 20         </Directory>
 21
 22         ErrorLog /var/log/apache2/error.log
 23         LogLevel warn
 24         CustomLog /var/log/apache2/access.log combined
 25
 26         ServerSignature Off
 27
 28         Alias /doc/ "/usr/share/doc/"
 29         <Directory "/usr/share/doc/">
 30                 Options Indexes MultiViews FollowSymLinks
 31                 AllowOverride None
 32                 Order deny,allow
 33                 Deny from all
 34                 Allow from 127.0.0.0/255.0.0.0 ::1/128
 35         </Directory>
 36 </VirtualHost>
 37
 38 <VirtualHost *:80>
 39         ServerName *******.dnsuser.de
 40         ServerAlias *******.dnsuser.de *.******.dnsuser.de
 41         DocumentRoot /srv/www/htdocs/web/websites/private
 42
 43         ErrorLog /var/log/apache2/error_******.dnsuser.de.log
 44         LogLevel warn
 45         CustomLog /var/log/apache2/access_*****.dnsuser.de.log combined
 46
 47
 48         <Directory "/srv/www/htdocs/web/websites/private">
 49                 Options FollowSymLinks Indexes MultiViews
 50                 AllowOverride All
 51                 Order allow,deny
 52                 allow from all
 53         </Directory>
 54
 55         Alias /download/ "/srv/www/htdocs/web/download/"
 56 </VirtualHost>
 57
 58 <VirtualHost *:80>
 59         ServerName email.anime-naruto.dyndns.org
 60         DocumentRoot /srv/www/htdocs/web/roundcubemail
 61
 62         <Directory "/srv/www/htdocs/web/roundcubemail">
 63                 Options FollowSymLinks Indexes MultiViews
 64                 AllowOverride All
 65                 Order allow,deny
 66                 allow from all
 67         </Directory>
 68 </VirtualHost>

/etc/apache2/sites-enabled/001-ssl
Code:
  1 NameVirtualHost *:443
  2 <VirtualHost *:443>
  3         ServerName www.ralf-basche.home
  4         ServerAdmin root@server.ralf-basche.home
  5         DocumentRoot /srv/www/htdocs
  6
  7         SSLEngine on
  8         SSLCertificateFile /etc/apache2/ssl/***.crt
  9         SSLCertificateKeyFile /etc/apache2/ssl/***.key
 10
 11         <Directory "/srv/www/htdocs">
 12                 Options FollowSymLinks Indexes MultiViews
 13                 AllowOverride All
 14                 Order allow,deny
 15                 allow from all
 16         </Directory>
 17
 18         ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
 19         <Directory "/usr/lib/cgi-bin">
 20                 AllowOverride None
 21                 Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
 22                 Order allow,deny
 23                 Allow from all
 24         </Directory>
 25
 26         ServerSignature Off
 27
 28         Alias /doc/ "/usr/share/doc/"
 29         <Directory "/usr/share/doc/">
 30                 Options Indexes MultiViews FollowSymLinks
 31                 AllowOverride None
 32                 Order deny,allow
 33                 Deny from all
 34                 Allow from 127.0.0.0/255.0.0.0 ::1/128
 35         </Directory>
 36 </VirtualHost>
 37
 38 <VirtualHost *:443>
 39         ServerName ****.dnsuser.de
 40         ServerAlias ****.dnsuser.de *.********.dnsuser.de
 41         DocumentRoot /srv/www/htdocs/web/websites/private
 42
 43         <Directory "/srv/www/htdocs/web/websites/private">
 44                Options FollowSymLinks Indexes MultiViews
 45                AllowOverride All
 46                Order allow,deny
 47                allow from all
 48        </Directory>
 49
 50        Alias /download/ "/srv/www/htdocs/web/download/"
 51 </VirtualHost>
 
hm ... es kommt ja nur einmal vor, das ist ja das was mich wundert.
 
funktionieren den die ganzen virtuellen hosts??? kommt diese meldung immer wenn du den apache neustartest?? den ich bekomme keine fehlermeldung beim starten
 
ich hab nur einen virtuellen host ... nein, funktionieren tut er nicht.
 
der apache unter debian arbeitet doch NUR mit virtuellen hosts .. sprich auch das document_root ist ein virtueller host.
 
??? ich hab eben nur die default-seite und die funktioniert nicht.
 
füge mal ein ServerName ******** bei dir ein .. vllt gehts dann ja
 
hm ... apache gepurged und wieder installiert, nun tuts ... ;)

edit:

zu frü gefreut:
Code:
nemesis-svr:/etc# /etc/init.d/apache2 restart
Restarting web server: apache2apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[Mon Aug 25 20:05:26 2008] [warn] NameVirtualHost *:80 has no VirtualHosts
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[Mon Aug 25 20:05:27 2008] [warn] NameVirtualHost *:80 has no VirtualHosts
(98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
 failed!
 
Zuletzt bearbeitet:
sicher das nur einmal NameVirtualHost vorhanden ist?
du hast ja mehere dateien in /etc/apache2/sites-enabled/ drinne .. und all diese werden gelanden ;)

ServerName sollte auch ein FQDN sein ;)
Ein DNS-Server könnte da abhilfe schaffen, damit die Namen auch aufgelößt werden können
 
ne, ich hab nur eine seite in sites-enabled:
Code:
nemesis-svr:/home/nemesis# ls /etc/apache2/sites-enabled/
000-default

darin steht:
Code:
NameVirtualHost *
<VirtualHost *:80>
	ServerAdmin webmaster@localhost
	ServerName localhost 


	DocumentRoot /var/www/
	<Directory />
		Options FollowSymLinks
		AllowOverride None
	</Directory>
	<Directory /var/www/>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride None
		Order allow,deny
		allow from all
	</Directory>

        <Directory /var/www/files/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride AuthConfig
                Order deny,allow
                allow from all
                # This directive allows us to have apache2's default start page
                # in /apache2-default/, but still have / go to the right place
                #RedirectMatch ^/$ /apache2-default/
        </Directory>

	ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
	<Directory "/usr/lib/cgi-bin">
		AllowOverride None
		Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
		Order allow,deny
		Allow from all
	</Directory>

	ErrorLog /var/log/apache2/error.log

	# Possible values include: debug, info, notice, warn, error, crit,
	# alert, emerg.
	LogLevel warn

	CustomLog /var/log/apache2/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>

edit:

langsam komm ich der sache auf die spur ... wenn ich php5 nicht verwende, sondern php4 oder kein php, dann funktionierts.
 
Zuletzt bearbeitet:
NameVirtualHost *
sieht nicht richtig aus ;-)

NameVirtualHost *:80
das wäre richtig ;-)

bei mir klappt es mit php5 (auch debian)
 

Ähnliche Themen

NGINX bietet intern abgerufene Seiten nur zum Download an, extern geht's

Nginx als Reverse Proxy für Nextcloud und Emby

Zugriff Ubuntu 16.04. auf Freigabe 18.04. LTS nicht möglich

Probleme mit virtual hosts

Apache2 mod_proxy

Zurück
Oben