ich habe seit dem Upgrade von Apache 2.2 auf Apache 2.4 meine Probleme mit dem Rewrite von URLs. Ich habe hier zwei virtuelle Server "www.ersatzdomain.com" und "www.ersatzdomain.eu" (Aus datenschutzrechtlichen Gründen nur diese Fantasienamen). Wobei der Aufruf von http://www.ersatzdomain.eu im Browser auf http://www.ersatzdomain.com forwarden soll. Bzw. zeigen die Configs ja auch, dass letztendlich auf "https://www.ersatzdomain.com" rewrited werden soll.
Das hatte bisher unter Apache 2.2 ganz prima funktioniert.
Code: Alles auswählen
<VirtualHost 192.168.1.7:80>
ServerAdmin hostmaster@ersatzdomain.eu
DocumentRoot /srv/www/typo3cms/ersatzdomain.eu
ServerName www.ersatzdomain.eu
ServerAlias ersatzdomain.eu
<Directory /srv/www/typo3cms/ersatzdomain.com/>
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
ServerSignature On
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.ersatzdomain.eu$ [NC]
RewriteRule ^(.*) https://www.ersatzdomain.com$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^ersatzdomain.eu$ [NC]
RewriteRule ^(.*) https://www.ersatzdomain.com$1 [L,R=301]
</VirtualHost>
Code: Alles auswählen
<VirtualHost 192.168.1.7:80>
ServerAdmin hostmaster@ersatzdomain.com
DocumentRoot /srv/www/typo3cms/ersatzdomain.com
ServerName www.ersatzdomain.com
ServerAlias ersatzdomain.com
<Directory /srv/www/typo3cms/ersatzdomain.com/>
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
ScriptAlias /scripts "/srv/www/typo3cms/ersatzdomain.com/scripts/"
<Directory "/srv/www/typo3cms/ersatzdomain.com/scripts/">
AllowOverride All
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Require all granted
</Directory>
Alias /Admin "/srv/www/typo3cms/ersatzdomain.com/typo3/"
<Directory "/srv/www/typo3cms/ersatzdomain.com/typo3/">
Options -Indexes +MultiViews +FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ScriptAlias /cgi-bin/ "/srv/www/typo3cms/ersatzdomain.com/cgi-bin/"
<Directory "/srv/www/typo3cms/ersatzdomain.com/cgi-bin/">
AllowOverride None
Options +ExecCGI
AddHandler cgi-script .cgi .pl
Require all granted
</Directory>
ErrorLog /var/log/apache2/www.ersatzdomain.com-error.log
LogLevel warn
CustomLog /var/log/apache2/www.ersatzdomain.com-access.log combined
ServerSignature On
RewriteEngine on
LogLevel alert rewrite:trace3
RewriteCond %{HTTP_HOST} ^www.ersatzdomain.com$ [NC]
RewriteRule ^(.*) https://www.ersatzdomain.com$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^ersatzdomain.com$ [NC]
RewriteRule ^(.*) https://ersatzdomain.com$1 [L,R=301]
</VirtualHost>
# StartSSL:
<VirtualHost *:443>
ServerName www.ersatzdomain.com
DocumentRoot /srv/www/typo3cms/ersatzdomain.com
<Directory /srv/www/typo3cms/ersatzdomain.com/>
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
SSLEngine on
SSLProtocol all -SSLv2
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM
SSLCertificateFile /etc/startssl/ersatzdomain.com/ersatzdomain.com.crt
SSLCertificateKeyFile /etc/startssl/ersatzdomain.com/ersatzdomain.com.key
SSLCertificateChainFile /etc/startssl/sub.class1.server.ca.pem
SSLCACertificateFile /etc/startssl/ca.pem
</VirtualHost>
bzw. im Access-Logfile[Wed Dec 02 17:44:28.437429 2015] [authz_core:error] [pid 24970] [client 93.231.150.22:36620] AH01630: client denied by server configuration: /srv/www/typo3cms/
93.231.150.22 - - [02/Dec/2015:17:47:46 +0100] "GET / HTTP/1.1" 403 512 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:44.0) Gecko/20100101 Firefox/44.0"
Code: Alles auswählen
apache2ctl -t -D DUMP_MODULES
[Wed Dec 02 17:49:56.302630 2015] [core:error] [pid 25496] (EAI 2)Name or service not known: AH00547: Could not resolve host name + -- ignoring!
Loaded Modules:
core_module (static)
so_module (static)
watchdog_module (static)
http_module (static)
log_config_module (static)
logio_module (static)
version_module (static)
unixd_module (static)
access_compat_module (shared)
alias_module (shared)
auth_basic_module (shared)
authn_core_module (shared)
authn_file_module (shared)
authz_core_module (shared)
authz_host_module (shared)
authz_user_module (shared)
autoindex_module (shared)
deflate_module (shared)
dir_module (shared)
env_module (shared)
fcgid_module (shared)
filter_module (shared)
mime_module (shared)
mpm_prefork_module (shared)
negotiation_module (shared)
php5_module (shared)
proxy_module (shared)
proxy_http_module (shared)
rewrite_module (shared)
setenvif_module (shared)
socache_shmcb_module (shared)
ssl_module (shared)
status_module (shared)
Grüße
SaxenPower