【问题标题】:Apache 2.4 VirtualHost not working throug through "NO-IP"Apache 2.4 VirtualHost 无法通过“NO-IP”工作
【发布时间】:2019-04-13 00:17:01
【问题描述】:

我有一个在 Windows 7 上运行的 Apache 2.4 服务器。 它已经运行了很多年,但现在我正在尝试实现 ssl。 事实上,我做到了,它可以从本地网络完美运行,但是当我想从外部网络(通过 no-ip)进入时,我得到图例“404 page not found”。 这是我的虚拟主机:

<VirtualHost *:80>
  ServerAdmin sistemas@clinica25demayo.com.ar
  DocumentRoot "C:/Apache24/htdocs"
  ServerName localhost
  ErrorLog logs/localhost.com-error.log
  CustomLog logs/localhost-access.log common    
  <Directory "C:/Apache24/htdocs">
   Options Indexes FollowSymLinks
   AllowOverride All
   Require all granted
  </Directory>    
</VirtualHost>

<VirtualHost *:443>
  SSLEngine on
  SSLCertificateFile "C:/Apache24/certificados/cl25demayo.crt"
  SSLCertificateKeyFile "C:/Apache24/certificados/cl25demayo.key"
  ServerAdmin sistemas@clinica25demayo.com.ar
  DocumentRoot "C:/Apache24/htdocs"
  ServerName localhost
  ErrorLog logs/localhost.com-error.log
  CustomLog logs/localhost-access.log common    
  <Directory "C:/Apache24/htdocs">
   Options Indexes FollowSymLinks
   AllowOverride All
   Require all granted
  </Directory>    
</VirtualHost>

有没有可能,因为我的 ssl 证书是临时的?我自己生成的。

【问题讨论】:

  • 如果您尝试在不使用 SSL 的情况下连接会发生什么?
  • 使用 http: 而不是 https: 完美运行

标签: php apache ssl virtualhost noip


【解决方案1】:

有没有可能,因为我的ssl证书是临时的

x509 中没有“临时证书”之类的东西。

我自己生成的

您的意思是自签名证书?不会。证书对不同客户端子网产生的不同行为没有影响。

我得到图例“404 页面未找到”

那么您必须能够看到证书并确认它来自您的服务器。您还可以访问服务器日志以查看到达那里的流量。

我相信您连接到的不是您的服务器 - 我无法告诉您这是因为 DDNS 服务 (ni-ip) 提供了错误的地址,或者您没有正确配置路由,或者如果客户端网络端的某些东西被配置为干扰流量,或者如果流量登陆您的网络服务器,但它有一些逻辑配置为向非本地客户端返回 404 错误。

您可以通过查看通过 HTTPS 传递的证书详细信息轻松验证这一点。

【讨论】:

  • 对不起,这就是我的意思。 “自签”证书。如果您使用 http:// 而不是 https://,则 no-ip 非常有效。该站点是:cl25demayo.no-ip.org/cl25demayo 如果您尝试:cl25demayo.no-ip.org/cl25demayo。令人惊讶的是,80 端口和 443 端口的配置完全相同。
  • 我认为当我使用“https”进入时,我被重定向到根目录,并且 /cl25demayo 部分被忽略
  • 如果是这种情况(不太可能),它将出现在您的日志中。
猜你喜欢
  • 2014-02-23
  • 2015-06-04
  • 2011-02-09
  • 2018-12-10
  • 2015-10-16
  • 2016-10-02
  • 2015-01-14
  • 1970-01-01
  • 2017-01-14
相关资源
最近更新 更多