大网数据广告活动
服务器运维问答

Apache2 SSL HTTPS not working despite my following the guides

· 52CE 我爱测

I'm trying to configure https support for Apache2 running in an Ubuntu instance in AWS. I've enabled SSL support in /etc/apache2/sites-enabled/default-ssl.conf: # grep -v '^[ ]*#' /etc/apache2/sites-enabled/default-ssl.conf | gre…

问题原文

原帖链接 · Michael restore Monica Cellio · CC BY-SA 4.0

I'm trying to configure https support for Apache2 running in an Ubuntu instance in AWS. I've enabled SSL support in /etc/apache2/sites-enabled/default-ssl.conf:

# grep -v '^[   ]*#' /etc/apache2/sites-enabled/default-ssl.conf | grep -v '^$'
<VirtualHost *:443>
    ServerName miit.co
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    SSLEngine on
    SSLCertificateFile      /etc/ssl/certs/miit_co.crt
    SSLCertificateKeyFile /etc/ssl/private/miit-co.key
    <FilesMatch "\.(cgi|shtml|phtml|php)$">
            SSLOptions +StdEnvVars
    </FilesMatch>
    <Directory /usr/lib/cgi-bin>
            SSLOptions +StdEnvVars
    </Directory>
</VirtualHost>

and the configuration as a whole is valid:

# apachectl configtest
Syntax OK

The file /etc/ssl/private/miit-co.key is a "PEM RSA private key" which I generated (can't remember how exactly now) and /etc/ssl/certs/miit_co.crt is one of two files I received back from my non-technical boss, the other being miit_co.pem which I don't know what do with. I also have a csr.pem (PEM certificate request) which I generated and sent to my boss. I did not send him the private key file. Maybe I have to do something with that miit_co.pem file.

When I start Apache (systemctl start apache2) there is nothing in /var/log/apache2/{error,access}.log to indicate that Apache2 is not running normally. However, https://www.digicert.com/help/ when given our site name (miit.co) just spins and spins. I wonder if there is something other than Apache stopping https access, since http://miit.co works as expected (it redirects in fact but that's not relevant here) but https://miit.co just times out. ufw status replies disabled.

/etc/apache2/mods-enabled includes ssl.{conf,load}.

If I try curl on the local machine, it indicates that Apache is being reached by https requests:

# curl https://localhost
curl: (51) SSL: certificate subject name (miit.co) does not match target host name 'localhost'
# curl https://miit.co/michael
(hangs)

Any suggestions as to why https: access just hangs?

已采纳解答

原帖链接 · vjones · CC BY-SA 4.0

Since you tagged your post with aws-services, I assume your running ubuntu on an AWS EC2 instance. If so, the problem is likely with the security group associated with the instance. I recommend reviewing the EC2 instance's security group and adding a rule to allow inbound HTTPS from everywhere.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-08-25)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。