You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Apache2 SSL外部IP连接超时求助:Ubuntu18.04环境配置排查

Apache2 HTTPS可通过内部IP访问但外部IP连接超时(Ubuntu 18.04)

我正尝试在全新安装的Ubuntu 18.04服务器上给Apache2配置安全连接,但遇到了个棘手问题:HTTP服务完全正常,HTTPS用内部IP访问没问题,但用外部IP就会出现Connection timed out错误。为了排查问题,我今天刚重装了系统,现在用一个只有一行文本的简单HTML页面测试,还没部署PHP应用。

下面是我的配置细节:

  • 已经通过a2enmod ssl命令启用了SSL模块
  • 我的VirtualHost配置如下:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/http
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/http
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLEngine on
SSLCertificateFile /etc/cloudflare/ocdev.pem
SSLCertificateKeyFile /etc/cloudflare/ocdev.key
SSLCACertificateFile /etc/cloudflare/origin.pem
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
</VirtualHost>
</IfModule>

有没有大佬能帮我分析下问题出在哪?需要更多信息的话我随时补充!

内容的提问来源于stack exchange,提问作者Raptop

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.14 07:51:27