我按照this指南一步一步地为我的门户网站设置SSL连接。之前我能够使用http://访问它,但现在我必须指定端口80,即我必须使用https://:80来访问门户网站。如果我访问https://它会显示默认的Apache测试页面,上面写着 -
测试123 ..此页面用于在安装Apache HTTP服务器之后测试其正确运行。如果您可以阅读此页面,则表示此网站正常运行。该服务器由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>
答案 0 :(得分:1)
我认为您没有正确遵循说明。说明说<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>
并且应该有一个&#34;镜像&#34;配置端口443.
但是您似乎已添加了启用SSL引擎的内容,等等<VirtualHost *:80>
元素...这将使Apache配置端口80以期望/需要&#34; https:& #34;连接。
检查您的配置,并将其与实际告诉您的操作进行比较。
我是否还可以推荐阅读您在配置中使用的指令的Apache文档。这样你就可以开始了解这些配置实际上在说什么了。如果&#34;盆栽&#34;那将为您提供更好的诊断问题的机会。说明未正确遵循。