我已经为HTTP和HTTPS配置了虚拟主机,但是无法在HTTPS上访问我的网站。 我想知道问题何时开始。 HTTP和HTTPS两者都可以正常工作,直到我配置了postfix和dovecot。可能是安装OpenSSL导致了问题。
我的服务器:Centos7-Apache / 2.4.6
当我通过HTTPS打开域时,在chrome上出现以下错误:
This site cant be reached
https://psdtohtml.ir is unreachable
通过wget
得到以下错误提示:
wget https://psdtohtml.ir
--2019-10-22 13:04:20-- https://psdtohtml.ir/
Resolving psdtohtml.ir (psdtohtml.ir)... 130.185.74.134
Connecting to psdtohtml.ir (psdtohtml.ir)|130.185.74.134|:443... connected.
ERROR: cannot verify psdtohtml.ir's certificate, issued by ‘/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3’:
Unable to locally verify the issuer's authority.
To connect to psdtohtml.ir insecurely, use `--no-check-certificate'.
我在/etc/httpd/sites-enabled/psdtohtml.ir.conf
中的虚拟主机:
<VirtualHost *:80>
ServerName www.psdtohtml.ir
ServerAlias psdtohtml.ir
DocumentRoot /var/www/psdtohtml.ir/public_html/public
#Redirect "/" "https://psdtohtml.ir/"
ErrorLog /var/www/psdtohtml.ir/error.log
CustomLog /var/www/psdtohtml.ir/requests.log combined
</VirtualHost>
<VirtualHost *:443>
ServerName www.psdtohtml.ir
ServerAlias psdtohtml.ir
DocumentRoot /var/www/psdtohtml.ir/public_html/public
ErrorLog /var/www/psdtohtml.ir/error.log
CustomLog /var/www/psdtohtml.ir/requests.log combined
SSLEngine on
SSLCertificateFile /etc/ssl/private/certificate.crt
SSLCertificateKeyFile /etc/ssl/private/private.key
</VirtualHost>
Idk我该如何解决?我已经在互联网上搜索有关我的问题的所有信息,但没有找到任何解决方案。
有什么主意吗?
预先感谢您的帮助。
答案 0 :(得分:-1)
您是否已检查conf文件中的Listen语句?
要让apache绑定到端口443,配置必须包含
Listen 443