【发布时间】:2019-04-22 22:22:48
【问题描述】:
我的 apache 配置有问题。 我刚刚使用 Apache2.4 和 SSL 证书设置了一个新的 Windows 服务器,但是当我想访问我的 https://localhost 时,我遇到了 403 Forbidden 错误。
这是我的 vhost-myproject.conf
<VirtualHost *:443>
DocumentRoot "D:/www/myproject/public"
SetEnv APPLICATION_ENV "production"
SetEnv ZF2_PATH D:/zend/ZendFramework-2.4.13/library
ServerName myproject.fr
<Directory "D:/www/myproject/public">
Options +ExecCGI +FollowSymLinks
DirectoryIndex index.php
AllowOverride All
Require all granted
</Directory>
SSLEngine on
SSLCertificateFile "D:/mycertificate.crt"
SSLCertificateKeyFile "D:/mykey.key"
</VirtualHost>
这是我的 .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteCond %{REQUEST_URI}::$1 ^(/.+)(.+)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
RewriteRule ^(.*)$ %{ENV:BASE}index.php [NC,L]
</IfModule>
还有我的主人
127.0.0.1 localhost myprojet.fr
ip_server myprojet.fr localhost
感谢您的帮助。
【问题讨论】:
-
error.log 到底说了什么?
-
error.log 中没什么特别的
-
我不知道它是否相关,我认为它是但我有 403 只禁止的 php 文件。当我尝试访问 html 文件时,它的工作。
标签: ssl http-status-code-403 apache2.4