76927
Goto Top

Apache2 Virtual host Probleme - Config vermurkst?

System:
Debian Etch x64
Linux 2.6.18-92.1.18.el5.028stab060.2 #1 SMP Tue Jan 13 11:38:36 MSK 2009 x86_64 GNU/Linux
Apache2

Folgendes , auf dem server war ein SysCP image des anbieters installiert,
Allerdings habe ich SysCP wieder entfernt (normale uninstall)

danach wollte ich einige Virtual Hosts anlegen , was aber irgendwie nicht Funktioniert
Hier mal die diversen apache Configs:

apache2.conf:
http://pastebin.ca/1371455


Die Vhost Configs:

default
NameVirtualHost *
<VirtualHost *>
	ServerAdmin willmaster@willmaster.at
	
	DocumentRoot /var/www
	<Directory />
		Options FollowSymLinks
		AllowOverride None
	</Directory>
	<Directory /var/www>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride FileInfo
		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 ^/$ /wp/
	</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 Off

</VirtualHost>

Blog.vh:
<VirtualHost str0.at:80>
ServerName str0.at
ServerAlias str0.at *.str0.at
DocumentRoot /var/www/wp
ServerAdmin willmaster@willmaster.at
CustomLog /var/log/apache2/blog.log common
</VirtualHost>

preblog.vh:
<VirtualHost pre.co.at:80>
ServerName pre.co.at
ServerAlias pre.co.at *.pre.co.at
DocumentRoot /var/www/wp2
ServerAdmin willmaster@willmaster.at
CustomLog /var/log/apache2/preblog.log common
</VirtualHost>

Wenn ich die hosts aktiviere , und apache reloade krieg ich:

reloading web server config...7361
apache2: Could not reliably determine the server's fully qualified domain name, using 81.89.99.8 for ServerName  
[Wed Mar 25 03:31:29 2009] [warn] VirtualHost str0.at:80 overlaps with VirtualHost pre.co.at:80, the first has precedence, perhaps you need a NameVirtualHost directive


jetzt komm ich über str0.at auf /var/www/wp - also den Blog
aber über pre.co.at auch auf den,obwohl es in /var/www/wp2 gehen sollte

verwendet werden soll:

8800.at - Zugriff auf /var/www (also ALLES)
str0.at - zugriff auf /var/www/wp
pre.co.at - zugriff auf /var/www/wp2

sieht jemand das Problem?

Gruß
W.Z.

Content-Key: 112302

Url: https://administrator.de/contentid/112302

Printed on: April 20, 2024 at 03:04 o'clock

Member: Wolfsrudel
Wolfsrudel Mar 25, 2009 at 09:07:09 (UTC)
Goto Top
Definiere in den vhosts mal zusätzlich noch "NameVirtualHost", sprich:

NameVirtualHost str0.at
<VirtualHost str0.at:80>
ServerName str0.at
ServerAlias str0.at *.str0.at
DocumentRoot /var/www/wp
ServerAdmin willmaster@willmaster.at
CustomLog /var/log/apache2/blog.log common
</VirtualHost>

NameVirtualHost pre.co.at
<VirtualHost pre.co.at:80>
ServerName pre.co.at
ServerAlias pre.co.at *.pre.co.at
DocumentRoot /var/www/wp2
ServerAdmin willmaster@willmaster.at
CustomLog /var/log/apache2/preblog.log common
</VirtualHost>
Mitglied: 76927
76927 Mar 25, 2009 at 09:40:41 (UTC)
Goto Top
sehr gut,jetzt funktioniert es so wie gewünscht, allerdings erhalte ich beim apache restart noch die meldung:

 
apache2: Could not reliably determine the server's fully qualified domain name, using 81.89.99.8 for ServerName  
[Wed Mar 25 10:39:29 2009] [error] VirtualHost 8800.at:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Wed Mar 25 10:39:29 2009] [error] VirtualHost pre.co.at:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Wed Mar 25 10:39:29 2009] [error] VirtualHost str0.at:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Wed Mar 25 10:39:29 2009] [warn] NameVirtualHost pre.co.at:0 has no VirtualHosts
[Wed Mar 25 10:39:29 2009] [warn] NameVirtualHost 8800.at:0 has no VirtualHosts
Reloading web server config...7361

da es allerdings soweit ich sehe keine Probleme macht,denke ich das man das so lassen kann oder?

Gruß
Member: Wolfsrudel
Wolfsrudel Mar 25, 2009 at 10:20:42 (UTC)
Goto Top
So lassen würde ich es nicht... auch wenn's funktioniert, ist es eher unschön, wenn Warnungen auftreten. ;)

Dein "default" hat keinen ServerName eingetragen... vielleicht mal machen ;)
Die Mixing Ports resultieren aus der Wildcard "*" in Deinem default-vhost.
Am besten den default folgende Werte geben:

NameVirtualHost _default_
<VirtualHost _default_:80>
	ServerAdmin willmaster@willmaster.at
	ServerName  willmaster.at
[...] Rest

Für den vhost "8800.at" hattest Du keinen vhost gepostet... da scheint noch etwas quer zu liegen.
Mitglied: 76927
76927 Mar 25, 2009 at 10:34:34 (UTC)
Goto Top
die 8800.vh hab ich erst nachher geschrieben ;)

NameVirtualHost 8800.at 
<VirtualHost *:80>
ServerName 8800.at
ServerAlias 8800.at *.8800.at
DocumentRoot /var/www
ServerAdmin willmaster@willmaster.at
CustomLog /var/log/apache2/main.log common
</VirtualHost>

das mit der default hab ich erledigt,ändert allerdings wenig:
 
Reloading web server config...7361
apache2: Could not reliably determine the server's fully qualified domain name, using 81.89.99.8 for ServerName  
[Wed Mar 25 11:33:38 2009] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Wed Mar 25 11:33:38 2009] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Wed Mar 25 11:33:38 2009] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Wed Mar 25 11:33:38 2009] [warn] NameVirtualHost _Default_:0 has no VirtualHosts
[Wed Mar 25 11:33:38 2009] [warn] NameVirtualHost str0.at:0 has no VirtualHosts
[Wed Mar 25 11:33:38 2009] [warn] NameVirtualHost pre.co.at:0 has no VirtualHosts
[Wed Mar 25 11:33:38 2009] [warn] NameVirtualHost 8800.at:0 has no VirtualHosts
Member: Wolfsrudel
Wolfsrudel Mar 25, 2009 at 10:46:21 (UTC)
Goto Top
Arghs, dass hasse ich immer...

Trag' mal in die Hosts-Datei [/etc/hosts] folgendes ein:

81.89.99.8 willmaster.at
81.89.99.8 str0.at
81.89.99.8 pre.co.at
81.89.99.8 8800.at

So sollte er seine Domains selber erkenne. Sollte das auch nicht klappen, bin ich mit meinem Latein am Ende... :/
Member: godlie
godlie Mar 25, 2009 at 11:13:27 (UTC)
Goto Top
@Wolfsrudel
Naja wie wärs denn wenn man bei <VirtualHost IP:PORT> machen würde? so sollte es eigentlich sein.
Dann sparst dir das gemurkse in der hosts.

Und nimm die NameVirtualHost überall raus und setz nur einmal ein NameVirtualHost irgendwo in der Config.
NameVirtualHost IP:Port und fertig ist die suppe.
grüße
Mitglied: 76927
76927 Mar 25, 2009 at 11:24:30 (UTC)
Goto Top
wow,bin beeindruckt , darauf wäre ich nie gekommen...danke

Reloading web server config...7361
apache2: Could not reliably determine the server's fully qualified domain name, using 81.89.99.8 for ServerName  
.

sieht jetzt alles so aus:

NameVirtualHost 81.89.99.8:80
<VirtualHost 81.89.99.8:80>
	ServerAdmin willmaster@willmaster.at
	
	DocumentRoot /var/www
	<Directory />
		Options FollowSymLinks
		AllowOverride None
	</Directory>
	<Directory /var/www>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride FileInfo
		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 ^/$ /wp/
	</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 Off

</VirtualHost>

blog.vh
<VirtualHost 81.89.99.8:80>
ServerName str0.at
ServerAlias str0.at *.str0.at
DocumentRoot /var/www/wp
ServerAdmin willmaster@willmaster.at
CustomLog /var/log/apache2/blog.log common
</VirtualHost>

preblog.vh:
<VirtualHost 81.89.99.8:80>
ServerName pre.co.at
ServerAlias pre.co.at *.pre.co.at
DocumentRoot /var/www/wp2
ServerAdmin willmaster@willmaster.at
CustomLog /var/log/apache2/preblog.log common
</VirtualHost>

root.vh:
<VirtualHost 81.89.99.8:80>
ServerName 8800.at
ServerAlias 8800.at *.8800.at
DocumentRoot /var/www
ServerAdmin willmaster@willmaster.at
CustomLog /var/log/apache2/main.log common
</VirtualHost>

so,alles richtig?
Member: godlie
godlie Mar 25, 2009 at 11:37:31 (UTC)
Goto Top
Das schaut schon super aus, was ich noch machen würde wäre folgendes:

Could not reliably determine the server's fully qualified domain name, using 81.89.99.8 for ServerName

Da brauchst du nur in der apache.conf ( oder httpd.conf je nachdem ) unter ServerName entweder
einen fqdn ( full qualified domain name ) oder die ip eintragen vom Server, dann bist die Meldung auch los.

grüße
Mitglied: 76927
76927 Mar 25, 2009 at 11:53:57 (UTC)
Goto Top
jop,das wars noch, hab einfach str0.at eingetragen

Reloading web server config...7361
.

da jetzt alles perfekt läuft werd ich mich wohl wieder in die Windows Sektion verziehen und dort weiterhelfen ;)

Ich danke euch beiden Herzlich für die Hilfe

W.Z.