我在同一个盒子上有一个 Wordpress 实例和一个 SimpleSAMLphp 实例,需要从同一个子域访问,看起来 Wordpress 正在干扰 Apache Alias。
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 重写之前,我已经完成了这项工作,所以如果有人有任何有用的信息,那就太好了!
提前致谢!