vhosts funktionieren nicht

Irgendwelche Probleme mit XAMPP für Linux? Dann ist hier genau der richtige Ort um nachzufragen.

vhosts funktionieren nicht

Postby leibnitz » 22. February 2007 09:49

Hallo ich hab folgendes Problem,

ich möchte gerne unter Xampp für Linux virtual Hosts einrichten.

1. Ich hab in der /opt/xampp/etc/httpd.conf die Virtual hosts aktiviert.
2. Die /opt/xampp/etc/extra/httpd-vhosts.conf hab ich an meine bedürfnisse angepasst, siehe Code:

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 *>
#    ServerAdmin webmaster@domain.info
#    DocumentRoot /srv/www/htdocs/
#    ServerName domain.info
#    ErrorLog /srv/logs/error_log
#    CustomLog /srv/logs/access_log common
#</VirtualHost>

<VirtualHost site1.domain.info:80>
    ServerAdmin webmaster@site1.domain.info
    DocumentRoot /srv/www/htdocs/cms1/
    ServerName site1.domain.info
    ErrorLog /srv/logs/site1-error_log
    CustomLog /srv/logs/site1-access_log common
</VirtualHost>

<VirtualHost site2.domain.info:80>
    ServerAdmin webmaster@site2.domain.info
    DocumentRoot /srv/www/htdocs/cms2/
    ServerName site2.domain.info
    ErrorLog /srv/logs/site2-error_log
    CustomLog /srv/logs/site2-access_log common
</VirtualHost>

<VirtualHost site3.domain.info:80>
    ServerAdmin webmaster@site3.domain.info
    DocumentRoot /srv/www/htdocs/cms3/
    ServerName site3.domain.info
    ErrorLog /srv/logs/site3-error_log
    CustomLog /srv/logs/site3-access_log common
</VirtualHost>

<VirtualHost site4.domain.info:80>
    ServerAdmin webmaster@site4.domain.info
    DocumentRoot /srv/www/htdocs/cms4/
    ServerName site4.domain.info
    ErrorLog /srv/logs/site4-error_log
    CustomLog /srv/logs/site4-access_log common
</VirtualHost>

<VirtualHost xampp.domain.info:80>
    ServerAdmin webmaster@xampp.domain.info
    DocumentRoot /srv/www/htdocs/
    ServerName xampp.domain.info
    ErrorLog /srv/logs/xampp-error_log
    CustomLog /srv/logs/xampp-access_log common
</VirtualHost>


Wenn ich jetzt xampp starte und z.b. site1.domain.info aufrufe werde ich immer auf /srv/www/htdocs/ weitergeleitet anstatt auf /srv/www/htdocs/cms1/

Wenn ich mir die /opt/lampp/logs/apachestart.log anschaue da steht folgendes drin:

Code: Select all
linux:/opt/lampp/logs # cat apachestart.log
[Thu Feb 22 08:35:03 2007] [warn] VirtualHost site3.domain.info:80 overlaps with VirtualHost site4.domain.info:80, the first has precedence, perhaps you need a NameVirtualHost directive
[Thu Feb 22 08:35:03 2007] [warn] VirtualHost site2.domain:80 overlaps with VirtualHost site3.domain.info:80, the first has precedence, perhaps you need a NameVirtualHost directive
[Thu Feb 22 08:35:03 2007] [warn] VirtualHost site1.domain.info:80 overlaps with VirtualHost site2.domain.info:80, the first has precedence, perhaps you need a NameVirtualHost directive
[Thu Feb 22 08:35:03 2007] [warn] NameVirtualHost *:80 has no VirtualHosts


er beschwerd sich also das der Apache keine Virtual Hosts hat aber bemängelt die die drin stehen. Ist ja schon komisch.

Wenn ich Xampp beende erhalte ich selben Fehler:

Code: Select all
linux:/opt/lampp/logs # cat apachestart.log
[Thu Feb 22 08:35:03 2007] [warn] VirtualHost site3.domain.info:80 overlaps with VirtualHost site4.domain.info:80, the first has precedence, perhaps you need a NameVirtualHost directive
[Thu Feb 22 08:35:03 2007] [warn] VirtualHost site2.domain:80 overlaps with VirtualHost site3.domain.info:80, the first has precedence, perhaps you need a NameVirtualHost directive
[Thu Feb 22 08:35:03 2007] [warn] VirtualHost site1.domain.info:80 overlaps with VirtualHost site2.domain.info:80, the first has precedence, perhaps you need a NameVirtualHost directive
[Thu Feb 22 08:35:03 2007] [warn] NameVirtualHost *:80 has no VirtualHosts


kann mir da jemand helfen, brauch das ganze sehr bald. Würde gerne Xampp einsetzen da es einfach schneller geht als alles per hand zu installieren, aber so brauch man mehr Zeit als manuel.

Ich danke im voraus.

MfG Leibnitz
leibnitz
 
Posts: 4
Joined: 20. February 2007 11:29

Postby glitzi85 » 23. February 2007 10:58

Hallo,

<VirtualHost site1.domain.info:80>

Einfach bei allen vHosts in <VirtualHost *:80> ändern.

mfg glitzi
User avatar
glitzi85
 
Posts: 1920
Joined: 05. March 2004 23:26
Location: Dahoim


Return to XAMPP für Linux

Who is online

Users browsing this forum: No registered users and 5 guests