security - 在 Apache 和文档根目录中使用 SSL 保护页面

标签 security apache ssl xampp

我使用 OpenSSL 创建了用于本地主机的证书。

很好,但是当我在 Apache 中设置 VirtualHost 时,如果我设置 DocumentRoot,页面加载正常,地址栏中没有不同的标记。

当我没有指定 DocumentRoot 时,Firefox 加载 Xampp 页面,但地址栏中带有安全标记。

我的实际 Vhost 是:

<VirtualHost *:443>
SSLEngine On
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL

ServerName www.agurbana.com.br

SSLCertificateFile "E:/agenda.crt"
SSLCertificateKeyFile "E:/server_unsecured.key"

SSLCACertificatePath "E:/"
SSLCACertificateFile "E:/ca.crt"

<FilesMatch "\.(cgi|shtml|pl|asp|php)$">
    SSLOptions +StdEnvVars
</FilesMatch>

DocumentRoot "E:/SITES/AU2/"
ErrorLog "E:/error.log"
<Directory "E:/SITES/AU2/">
    AllowOverride All
    Allow from All
</Directory>

BrowserMatch ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
</VirtualHost>

如何在设置 DocumentRoot 时在地址栏中显示安全标记?

最佳答案

碰巧,您在 httpd-vhosts.conf 文件中是否也设置了虚拟主机来监听端口:80?

在那种情况下,方案将由用户决定,而不是由服务器决定。您可以摆脱 :80 监听器,但现在用户必须记住输入 https,这很糟糕。因此,使用 Apache 重定向来强制使用 SSL,例如http://www.cyberciti.biz/tips/howto-apache-force-https-secure-connections.html

关于security - 在 Apache 和文档根目录中使用 SSL 保护页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8086611/

相关文章:

java - Java Applet 中的 AccessControlException

javascript - 如果 Google chrome 开发者工具已经打开,如何以编程方式关闭它?

php - 设置用户通过php访问文件的权限

php - PHP curl 的 SSL 错误

c++ - 如何在有安全限制的情况下安全地编译和执行c++程序?

android - 如何避免使用 SSL 信任 killer 应用程序绕过 Okhttp 证书固定?

ruby - Apache、Ruby,没有框架

Apache RewriteRule,-(破折号)作为替换

amazon-web-services - 与低级 Rest API 的 SSL/HTTPS 连接?

php - 如果我想在我的登录页面 (php) 中使用 128 位 ssl,我可以使用什么