Virtuelle Host laufen nicht.... was nun???

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

Virtuelle Host laufen nicht.... was nun???

Postby Andreas Erdeli » 21. January 2004 12:57

Hallo,

ich hab' ein kleines Prblem:

Ich wollte Virtuelle Host einricht, aber irgenwie klappt das nicht.

Als erstes habe ich meine Netzwerkkarte konfiguriert:
Dann bin ich ins Kontrollzentrum und habe Hostnamen aufgerufen:

127.0 .0.1 localhost
192.168.0.192 linux.local linux
192.168.0.200 www.andy.de andy.de
192.168.0.201 andy andy
::1 localhost
fe00::0 ipv6-localnet
ff00::0 ipv6-mcastprefix
ff02::1 ipv6-allnodes
ff02::2 ipv6-allrouters
ff02::3 ipv6-allhost

Dann bin ich in den Schell und hebe die IP's vergeben:

ifconfig eth0 192.168.0.192 broadcast 192.168.0.255 netmask 255.255.255.0 up
ifconfig eth0:1 192.168.0.200 broadcast 192.168.0.255 netmask 255.255.255.0 up
ifconfig eth0:2 192.168.0.201 broadcast 192.168.0.255 netmask 255.255.255.0 up

Hat er auch akzeptiert:
Ein Ping akzeptiert 192.168.0.192, 192.168.0.200, 192.168.0.201

So und jetzt habe ich meine httpd.conf angepasst:

#***httpd.conf -- Apache HTTP server configuration file
##***Section 1: Global Environment

ServerType standalone

ServerRoot "/srv/www"

LockFile /var/lock/subsys/httpd/httpd.accept.lock

PidFile /var/run/httpd.pid

ScoreBoardFile /var/run/httpd.scoreboard

Timeout 300

KeepAlive On

MaxKeepAliveRequests 100

KeepAliveTimeout 15

MinSpareServers 1
MaxSpareServers 1

StartServers 1

MaxClients 150

MaxRequestsPerChild 0

#Listen 3000
#Listen 12.34.56.78:80

####################################
Listen 192.168.0.192:80
Listen 192.168.0.200:80
Listen 192.168.0.201:80
####################################

####################################
BindAddress *
####################################

....

Include /etc/httpd/suse_loadmodule.conf

....

Include /etc/httpd/suse_addmodule.conf

ExtendedStatus On

<IfModule mod_dav.c>
DavLockDB /var/lib/httpd/DAVLock
</IfModule>

<IfModule mod_include.c>
XBitHack on
</IfModule>

Port 80

<IfDefine SSL>
Listen 80
Listen 443
</IfDefine>

User wwwrun
Group nogroup

ServerAdmin webmaster@linux.local

ServerName linux.local

DocumentRoot "/srv/www/htdocs"

<Directory />
AuthUserFile /etc/httpd/passwd
AuthGroupFile /etc/httpd/group

Options -FollowSymLinks +Multiviews
AllowOverride None

</Directory>

<Directory "/srv/www/htdocs">

Options Indexes -FollowSymLinks +Includes MultiViews

AllowOverride None

Order allow,deny
Allow from all

<IfModule mod_dav.c>
DAV Off
</IfModule>

<Files /srv/www/htdocs/index.htm*>
Options -FollowSymLinks +Includes +MultiViews
</Files>

<Files test.php3>
Order deny,allow
deny from all
allow from localhost
</Files>

</Directory>

<IfModule mod_dir.c>
DirectoryIndex index.html
</IfModule>

AccessFileName .htaccess

<Files ~ "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</Files>

UseCanonicalName On

<IfModule mod_mime.c>
TypesConfig /etc/httpd/mime.types
</IfModule>

DefaultType text/plain

<IfModule mod_mime_magic.c>
MIMEMagicFile /etc/httpd/magic
</IfModule>

HostnameLookups Off

<IfModule mod_backhand.c>
<Location "/backhand/">
SetHandler backhand-handler
</Location>
</IfModule>

#***working directory of mod_bandwidth

<IfModule mod_bandwidth.c>
BandWidthDataDir /var/lib/httpd/mod_bandwidth
</IfModule>


ErrorLog /var/log/httpd/error_log

LogLevel warn

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

CustomLog /var/log/httpd/access_log common

ServerSignature On

<IfModule mod_alias.c>

Alias /icons/ "/srv/www/icons/"

<Directory "/srv/www/icons">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

Alias /manual/ "/srv/www/htdocs/manual/"

<Directory "/srv/www/htdocs/manual">
Options Indexes FollowSymlinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>


######################################################
*** ScriptAlias /cgi-bin/ "/srv/www/cgi-bin/"
######################################################

<IfModule mod_perl.c>
ScriptAlias /perl/ "/srv/www/cgi-bin/"
ScriptAlias /cgi-perl/ "/srv/www/cgi-bin/"
</IfModule>
#
#
<Directory "/srv/www/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>

</IfModule>


<Location /cgi-bin>
AllowOverride None
Options +ExecCGI -Includes
SetHandler cgi-script
</Location>

<IfModule mod_perl.c>
Perlrequire /usr/include/apache/modules/perl/startup.perl
PerlModule Apache::Registry

<Location /perl>
SetHandler perl-script
PerlHandler Apache::Registry
Options ExecCGI
PerlSendHeader On
</Location>

<Location /cgi-perl>
SetHandler perl-script
PerlHandler Apache::PerlRun
Options ExecCGI
PerlSendHeader On
</Location>

</IfModule>

<IfModule mod_autoindex.c>

....

</IfModule>

<IfModule mod_mime.c>

....

<IfModule mod_negotiation.c>
LanguagePriority en da nl et fr de el it ja kr no pl pt pt-br ru ltz ca es sv tw
</IfModule>

AddType application/x-tar .tgz
AddType image/x-icon .ico

<IfModule mod_php3.c>
AddType application/x-httpd-php3 .php3
AddType application/x-httpd-php3-source .phps
AddType application/x-httpd-php3 .phtml
</IfModule>

<IfModule mod_php4.c>
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php4
AddType application/x-httpd-php-source .phps
</IfModule>

<IfModule mod_dtcl.c>
AddType application/x-httpd-tcl .ttml
AddType application/x-dtcl-tcl .tcl
</IfModule>

AddType text/vnd.wap.wml wml
AddType text/vnd.wap.wmlscript wmls
AddType application/vnd.wap.wmlc wmlc
AddType application/vnd.wap.wmlscriptc wmlsc
Addtype image/vnd.wap.wbmp wbmp

AddHandler cgi-script .cgi

AddType text/html .shtml
AddHandler server-parsed .shtml

</IfModule>
***End of document types.

<IfModule mod_setenvif.c>

BrowserMatch "Mozilla/2" nokeepalive
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0

BrowserMatch "RealPlayer 4\.0" force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0

</IfModule>

<IfDefine STATUS>
<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from localhost
</Location>

<Location /server-info>
SetHandler server-info
Order deny,allow
Deny from all
Allow from localhost
</Location>

<IfModule mod_perl.c>
<Location /perl-status>
SetHandler perl-script
PerlHandler Apache::Status
order deny,allow
deny from all
allow from localhost
</Location>
</IfModule>
</IfDefine>

######################################
NameVirtualHost *
######################################

####################################
#
****** Virtual-Host Adresse 192.168.0.192 linux.local /andy1 ***
#
####################################
<VirtualHost 192.168.0.192>
ServerAdmin andy@linux.de
DocumentRoot /home/andy/public_html/andy1/
ServerRoot /home/andy/public_html/andy1
ServerName linux.local
ErrorLog andy1-error_log
CustomLog andy1-access_log common
</VirtualHost>

####################################
#
****** Virtual-Host Adresse 192.168.0.200 www.andy.de /andy2 ***
#
####################################
<VirtualHost 192.168.0.200>
ServerAdmin andy@linux.de
DocumentRoot /home/andy/public_html/andy2
ServerName www.andy.de
ErrorLog logs/andy2-error_log
CustomLog logs/andy2-access_log common
</VirtualHost>

####################################
#
****** Virtual-Host Adresse 192.168.0.201 andy /andy3 ***
#
####################################
<VirtualHost 192.168.0.201>
ServerAdmin andy@linux.de
DocumentRoot /home/andy/public_html/andy3
ServerName andy
ErrorLog logs/andy3-error_log
CustomLog logs/andy3-access_log common
</VirtualHost>

....


Include /etc/httpd/suse_include.conf

So, jetzt mein Problem...

Es kommt immer die Start Seite vom Apache wenn ich in meinem Browser
http://192.168.0.200/
http://192.168.0.201/
eingebe.
Und wenn ich http://andy/ eingebe, dann kommt es immer zu einer Fehlermeldung, das die Seite nicht aufgerufen werden kann (Fehler: Server oder DNS kann nicht gefunden werden
Internet Explorer )
Aber es ist doch in der httpd angegeben, oder nicht ???

BITTE, helft mir....

Danke Andreas
Andreas Erdeli
 
Posts: 5
Joined: 17. January 2004 18:22

Return to Apache

Who is online

Users browsing this forum: No registered users and 24 guests