这可能是一个新手问题,但是......我在 Apache 中配置了一个 SSL 站点,如下所示:
NameVirtualHost *:443
<VirtualHost *:443>
ServerName dev.wonnova.com
DocumentRoot "/var/www/myapp/wwwroot"
SSLEngine on
SSLProtocol -all +TLSv1 +SSLv3
SSLCipherSuite HIGH:MEDIUM:!aNULL:+SHA1:+MD5:+HIGH:+MEDIUM
SSLCertificateFile /etc/apache2/ssl/mycert.crt
SSLCertificateKeyFile /etc/apache2/ssl/mycert.key
<IfModule mime.c>
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl
</IfModule>
Alias /mydir/ "/var/www/myapp/mydir"
<Directory "/var/www/myapp/mydir">
SSLRequireSSL
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride all
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
问题是,无论我请求哪个 URL,我总是得到 /var/www/myapp/wwwroot/index.php 的内容(即DocumentRoot
目录中的 index.php)。例如,这些 URL 会发生这种情况:
- https://mysite/index.php
- https://mysite/mydir/index.php
- https://mysite/mydir/style.css
- https://mysite/mydir/script.js
另一方面,如果我在 DocumentRoot 目录中创建一个 index2.php 文件,它会正确显示:
- https://mysite/index2.php
我想我的 Apache 配置有问题。