我在同一个盒子上有一个Wordpress实例和一个SimpleSAMLphp实例,需要从同一子域访问,似乎Wordpress正在干扰Apache别名。
httpd . conf
#
# VHOST for the Wordpress instance and provides an alias
# so simpleSAMLphp can be accessed at saml.domain.com/saml
#
<VirtualHost *:80>
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]
</VirtualHost>
<VirtualHost *:443>
ServerAdmin admin@domain.com
ErrorLog logs/saml.domain.com-error_log
CustomLog logs/saml.domain.com-access_log common
SSLEngine On
SSLCertificateFile /etc/pki/tls/certs/ca.crt
SSLCertificateKeyFile /etc/pki/tls/private/ca.key
RewriteLog "/var/log/httpd/mod_rewrite.log"
ServerName saml.domain.com
DocumentRoot "/var/www/html"
<Directory "/var/www/html">
Options All
AllowOverride All
Require all granted
</Directory>
Alias /saml "/var/simplesamlphp/www"
<Directory "/var/simplesamlphp/www">
Options All
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
. htaccess
# 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
/var/log/httpd/ssl_error_log
[Wed Mar 27 18:00:03 2013] [error] [client 10.0.3.133] File does not exist: /var/www/html/favicon.ico
[Wed Mar 27 18:00:05 2013] [error] [client 10.0.3.133] File does not exist: /var/www/simplesamlphp
[Wed Mar 27 18:00:05 2013] [error] [client 10.0.3.133] File does not exist: /var/www/html/favicon.ico
[Wed Mar 27 18:03:46 2013] [error] [client 10.0.3.133] File does not exist: /var/www/html/favicon.ico
[Wed Mar 27 18:03:47 2013] [error] [client 10.0.3.133] File does not exist: /var/www/html/favicon.ico
[Wed Mar 27 18:03:56 2013] [error] [client 10.0.3.133] File does not exist: /var/www/simplesamlphp
/var/log/httpd/mod_rewrite.log
文件为空白
http://saml.domain.com/saml = simpleSAMLphp管理菜单。
http://saml.domain.com/anything-else = Wordpress页面
转到saml.domain.com/saml的结果是一个Wordpress 404页面。在我强制SSL和修复Wordpress重写之前,我有这个工作,所以如果有人有任何有用的信息,那将是伟大的!
提前感谢!
问题是我有SSL Vhost指定在/etc/httpd/conf/httpd.conf而不是/etc/httpd/conf.d/SSL .conf。
这样做的结果是Apache附带的SSL Vhost在httpd.conf中覆盖了我的。我所要做的就是删除httpd.conf中的SSL Vhost声明,并将其与 SSL .conf