【问题标题】:Apache 2.4 with SSL config - Have 403 Forbidden带有 SSL 配置的 Apache 2.4 - 禁止 403
【发布时间】: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


【解决方案1】:

检查您的httpd.conf 文件,并确保参数“Listen”和“ServerName”配置为“Listen 80”和“ServerName localhost:80”。

【讨论】:

    猜你喜欢
    • 2016-04-13
    • 2013-07-14
    • 1970-01-01
    • 2014-11-24
    • 1970-01-01
    • 2015-01-25
    • 1970-01-01
    • 2012-02-18
    • 2021-10-26
    相关资源
    最近更新 更多