gpt4 book ai didi

Apache HTTPS 配置问题。必须指定80端 Eloquent 能得到 "https://"但需要不指定任何端口访问。

转载 作者:太空宇宙 更新时间:2023-11-03 14:09:18 24 4
gpt4 key购买 nike

我关注了this逐步指导为我的门户网站设置 SSL 连接。早些时候我可以使用 http://访问它,但现在我必须指定端口 80,即我必须使用 https://:80 来访问门户。如果我访问 https://它会显示默认的 Apache 测试页面,上面写着 -

Testing 123..This page is used to test the proper operation of the Apache HTTP server after it has been installed. If you can read this page it means that this site is working properly. This server is powered by CentOS.

我需要使用没有端口的 https://访问门户。感谢您的帮助。

httpd.conf

<VirtualHost *:80>
WSGIScriptAlias / /var/www/html/portals/portals/wsgi.py
DocumentRoot /var/www/html/portals/portals
SSLEngine On
SSLCertificateFile /etc/pki/tls/certs/mysite.crt
SSLCertificateKeyFile /etc/pki/tls/private/mysite.key
SSLCertificateChainFile /etc/pki/tls/certs/mysite.crt
<Location "/mysite/authenticate">
AuthType Basic
AuthName "wsgi protected"
Require valid-user
AuthBasicProvider wsgi
WSGIAuthGroupScript /var/www/html/portals/portals/wsgi.py
WSGIAuthUserScript /var/www/html/portals/portals/wsgi.py
</Location>



<Directory /var/www/html/portals/portals>
<Files wsgi.py>
Require all granted
</Files>
</Directory>

Alias /media/ /var/www/html/portals/media/
Alias /static/ /var/www/html/portals/static/

<Directory /var/www/html/portals/static>
Require all granted
</Directory>

<Directory /var/www/html/portals/media>
Require all granted
</Directory>

</VirtualHost>

<VirtualHost *:443>
WSGIScriptAlias / /var/www/html/portals/portals/wsgi.py
DocumentRoot /var/www/html/portals/portals
SSLEngine On
SSLCertificateFile /etc/pki/tls/certs/mysite.crt
SSLCertificateKeyFile /etc/pki/tls/private/mysite.key
SSLCertificateChainFile /etc/pki/tls/certs/mysite.crt
<Location "/mysite/authenticate">
AuthType Basic
AuthName "wsgi protected"
Require valid-user
AuthBasicProvider wsgi
WSGIAuthGroupScript /var/www/html/portals/portals/wsgi.py
WSGIAuthUserScript /var/www/html/portals/portals/wsgi.py
</Location>



<Directory /var/www/html/portals/portals>
<Files wsgi.py>
Require all granted
</Files>
</Directory>

Alias /media/ /var/www/html/portals/media/
Alias /static/ /var/www/html/portals/static/

<Directory /var/www/html/portals/static>
Require all granted
</Directory>

<Directory /var/www/html/portals/media>
Require all granted
</Directory>

</VirtualHost>

最佳答案

我认为您没有正确按照说明进行操作。说明说 <VirtualHost *:80>元素应该是这样的:

<VirtualHost *:80>
<Directory /var/www/vhosts/yoursite.com/httpdocs>
AllowOverride All
</Directory>
DocumentRoot /var/www/vhosts/yoursite.com/httpdocs
ServerName yoursite.com
</VirtualHost>

并且应该有一个“镜像”配置端口443。

但是您似乎已经添加了一些东西来启用 SSL 引擎,等等到 <VirtualHost *:80>元素 ... 这将使 Apache 配置端口 80 以期望/需要“https:”连接。

检查您的配置并将它们与说明实际告诉您的操作进行比较。

我还可以推荐阅读 Apache 文档以了解您在配置中使用的指令吗?这样你就可以开始理解配置的实际含义。如果没有正确遵循“盆栽”说明,这将使您有更好的机会诊断问题。

关于Apache HTTPS 配置问题。必须指定80端 Eloquent 能得到 "https://"但需要不指定任何端口访问。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34452560/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com