Probleme mit Subdomain

IceHawk66

Ensign
Registriert
Apr. 2012
Beiträge
142
Hi,

ich weiß nicht mehr weiter. Meine Subdomain funktioniert nicht und ich krieg es nicht mehr wieder hin. Meine mail.domain.de soll zu /var/www/webmail leiten (mit https)

Meine einzige aktive Config unter /etc/apache2/sites-enabled/
Code:
<VirtualHost *:443>

	SSLEngine On
	SSLCertificateFile /etc/apache2/ssl/ssl_with_chain.crt
	SSLCertificateKeyFile /etc/apache2/ssl/privkey.pem

	DocumentRoot /var/www
	<Directory />
		Options FollowSymLinks
		AllowOverride all
		Options -Indexes
	</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 ${APACHE_LOG_DIR}/error.log

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

	CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

<VirtualHost *:443>
        SSLEngine On
        SSLCertificateFile /etc/apache2/ssl/ssl_with_chain.crt
        SSLCertificateKeyFile /etc/apache2/ssl/privkey.pem
        ServerName mail.domain.de
        DocumentRoot /var/www/webmail
</VirtualHost>

Meine .htaccess im Root-Verzeichnis (/var/www) (Woher das alles kommt weiß ich nicht, 1 Teil jedenfalls von Wordpress):
Code:
#Options +FollowSymlinks
#RewriteEngine on

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Und hier noch die .htaccess unter /var/www/webmail, in die die Subdomain eigentlich leiten soll:

Code:
# AddDefaultCharset	UTF-8
AddType text/x-component .htc

<IfModule mod_php5.c>
php_flag	display_errors	Off
php_flag	log_errors	On
# php_value	error_log	logs/errors

php_value	upload_max_filesize	5M
php_value	post_max_size		6M
php_value	memory_limit		64M

php_flag	register_globals	Off
php_flag	zlib.output_compression		Off
php_flag	magic_quotes_gpc		Off
php_flag	magic_quotes_runtime		Off
php_flag	zend.ze1_compatibility_mode	Off
php_flag 	suhosin.session.encrypt 	Off

#php_value	session.cookie_path		/
php_flag	session.auto_start	Off
php_value	session.gc_maxlifetime	21600
php_value	session.gc_divisor	500
php_value	session.gc_probability	1
</IfModule>

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
#RewriteRule ^favicon\.ico$ skins/larry/images/favicon.ico

# security rules:
# - deny access to files not containing a dot or starting with a dot
#   in all locations except installer directory
RewriteRule ^(?!installer)(\.?[^\.]+)$ - [F]
# - deny access to some locations
RewriteRule ^/?(\.git|\.tx|SQL|bin|config|logs|temp|tests|program\/(include|lib|localization|steps)) - [F]
# - deny access to some documentation files
RewriteRule /?(README\.md|composer\.json-dist|composer\.json|package\.xml)$ - [F]
</IfModule>

<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
</IfModule>

<IfModule mod_headers.c>
# replace 'append' with 'merge' for Apache version 2.2.9 and later
#Header append Cache-Control public env=!NO_CACHE
</IfModule>

<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 month"
</IfModule>

FileETag MTime Size

<IfModule mod_autoindex.c>
Options -Indexes
</ifModule>

Ich bin mit meinem Latein hier am Ende, wäre sehr dankbar, wenn mir einer helfen würde.
 
Hi,

ich bin mir da nicht sicher. Aber könnte es sein das dein Problem daran liegt das beide "Virtual Hosts" auf den *:80 hören?

Somit hat der erste Eintrag eine höhere Prio und nimmt auch die requests für die Subdomain "mail.domain.de" an?

Du müsstest dort auch soetwas wie im zweiten Virtual host haben: "ServerName mail.domain.de"

Wie gesagt, nur eine Vermutung.


Gruß
Kai
 
weiß jetzt nicht genau was du damit meinst. Die Konfiguration sollte (eigentlich) nur greifen, wenn über Https eine Seite aufgerufen wird.
 
Na, du hast zwei "Virtual Hosts" mit: <VirtualHost *:443>
Beides ist SSL.

Der erste Eintrag ist automatisch der mit der höheren Prio. Da dort aber nicht auf "ServerName" beschränkt ist, greift dort auch"mail.domain.de". Dadurch landest du im DocumentRoot des ersten EIntrags.

Du müsstest daher im ersten Absatz z.B. folgendes hinzufügen:
ServerName www.domain.de

Wie gesagt, nur eine Vermutung.

So...z.B.:
Code:
# Ensure that Apache listens on port 80
Listen 80
<VirtualHost *:80>
    DocumentRoot /www/example1
    ServerName www.example.com
  
    # Other directives here
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot /www/example2
    ServerName www.example.org

    # Other directives here
</VirtualHost>

Ein Link: http://httpd.apache.org/docs/current/vhosts/examples.html
 
Zuletzt bearbeitet:
That`s it! Danke!!!!

Obwohl ich`s noch nicht ganz verstehe, denn daran habe ich überhaupt nichts verändert, das war schon seit Wochen so und ging einwandfrei :/

Trotzdem vielen Dank, hab jetzt 5h daran gesessen und endlich ist das Problem behoben.
 
IceHawk66 schrieb:
That`s it! Danke!!!!

Obwohl ich`s noch nicht ganz verstehe, denn daran habe ich überhaupt nichts verändert, das war schon seit Wochen so und ging einwandfrei :/

Trotzdem vielen Dank, hab jetzt 5h daran gesessen und endlich ist das Problem behoben.

Bitte, gerne.
 
Zurück
Oben