Virtuall Host Problem

Alles, was den Apache betrifft, kann hier besprochen werden.

Virtuall Host Problem

Postby chris-berlin » 15. June 2007 21:43

Hallo zusammen,
habe ein problem mit meinen VHOST sobald ich ein Vhost Container aktiviere bekomme ich immer Zugriff verweigert.

Im Errorlog habe ich eine fehlermeldung die ich nicht richtig verstehe
[warn] NameVirtualHost Host 192.168.1.200:80 has ni VirtualHosts

Was soll mir das sagen ?

habe hier noch einen Apachen laufen auf einer anderen Maschine ohne Probleme


Chris
chris-berlin
 
Posts: 33
Joined: 29. April 2004 09:19

Postby Wiedmann » 15. June 2007 22:55

Was soll mir das sagen ?

Dass deine (namebased) VHosts falsch konfiguriert sind.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby chris-berlin » 16. June 2007 08:36

Hallo Wiedmann,
eigentlich sollte alles korrekt sein

Code: Select all

#
#
NameVirtualHost *:80
#
<VirtualHost *:80>
     ServerAlias subi.meinedomain.de
      DocumentRoot c:/home/subi
      ServerName subi.meinedomain.de
</VirtualHost>


der Rechner hat die IP 192.168.1.49, irgendwie stelle ich mich bei dem richtig unglücklich an...

Chris
chris-berlin
 
Posts: 33
Joined: 29. April 2004 09:19

Postby meutrich » 16. June 2007 09:37

Hallo,
ich hatte mit meinen Vhosts auch so ein Problem.
Bei mir sieht es z.B. so aus (Linux-System).

/srv/www/
...........|
...........| cgi/bin
...........|
...........|htdocs
...........|
...........| cgi/bin
...........|
...........|serverName1
.................................|
.................................|htdocs
.................................|....
.................................| cgi/bin
.................................|....
...........|ServerName2
.................................|
.................................|htdocs
.................................|....
.................................| cgi/bin
.................................|....

Die Lösung war die, das der default Server auf das oberste Verzeichnis zeigen muß also auf /srv/www/. Denn unterhalb dieses Verzeichnisses sucht er nach den anderen Servern. Bei mir stand da noch /srv/www/htdocs und deshalb klappte es nicht. Nach der Änderung war alles ok.
Übrigens ich habe für jeden Vhost im Verzeichnis vhosts.d eine eingene .conf Datei angelegt und es muß in der httpd.conf vor dem Eintrag "include (pfad)/vhosts.d/*.conf die Raute entfernt werden.
Hoffe es hilft Dir

CU
meutrich
 
Posts: 4
Joined: 12. June 2007 16:50

Postby Wiedmann » 16. June 2007 10:04

eigentlich sollte alles korrekt sein
[Code]
der Rechner hat die IP 192.168.1.49,

Deine Angaben hier, passen nciht zu der Fehlermeldung die du gepostet hast. Da sind bestimmt noch wo weitere VHosts konfiguriert...
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby chris-berlin » 16. June 2007 16:43

So nun habe ich nochmals alles neu Installiert, und bekomme jetzt folgenden Fehler im errorlog.

[Sat Jun 16 13:36:51 2007] [error] [client 0.0.0.0] client denied by server configuration: C:/server/user1/graph.gif
[Sat Jun 16 13:36:52 2007] [error] [client 0.0.0.0] client denied by server configuration: C:/server/user1/favicon.ico

Die Passende httpd-vhost.conf sieht so aus

Code: Select all
#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
NameVirtualHost *:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
##<VirtualHost *:80>
##    ServerAdmin webmaster@dummy-host.example.com
##    DocumentRoot /www/docs/dummy-host.example.com
##    ServerName dummy-host.example.com
##    ServerAlias www.dummy-host.example.com
##    ErrorLog @rel_logfiledir@/dummy-host.example.com-error_log
##    CustomLog @rel_logfiledir@/dummy-host.example.com-access_log common
##</VirtualHost>

<VirtualHost *:80>
    DocumentRoot c:/server/user1
    ServerName user1.meinedomain.de
</VirtualHost>



System : Windows 2000 Prof SP4 mit XAMP 1.6.1

Chris
chris-berlin
 
Posts: 33
Joined: 29. April 2004 09:19

Postby Wiedmann » 16. June 2007 19:37

Du brauchst für den DocumentRoot auch einen dazugehörigen Directory-Block. Darin kannst du dann mit "Allow" den Zugriff freischalten.

(Schau dir an, wie das für den Hauptserver in der httpd.conf gemacht wird.)
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany


Return to Apache

Who is online

Users browsing this forum: No registered users and 39 guests