简体   繁体   English

Rails 3 + Passenger + Apache:如何将SSL端口从443更改为8443?

[英]Rails 3 + Passenger + Apache: How to change the port for SSL from 443 to 8443?

My hosting service is telling me to change my SSL port from 443 to 8443 since the OpenSSL tests are failing, even though they are working in production. 我的托管服务告诉我将SSL端口从443更改为8443,因为OpenSSL测试失败,即使它们正在生产中也可以正常工作。

I changed my apache ports.conf file to: 我将我的apache ports.conf文件更改为:

    NameVirtualHost *:80
    #NameVirtualHost *:443
    NameVirtualHost *:8443
    Listen 80

    <IfModule mod_ssl.c>
        # If you add NameVirtualHost *:443 here, you will also have to change
        # the VirtualHost statement in /etc/apache2/sites-available/default-ssl
        # to <VirtualHost *:443>
        # Server Name Indication for SSL named virtual hosts is currently not
        # supported by MSIE on Windows XP.
        #Listen 443
        Listen 8443
    </IfModule>

    <IfModule mod_gnutls.c>
        #Listen 443
        Listen 8443
    </IfModule>

I also changed my virtual hosts from <VirtualHost *:443> to <VirtualHost *:8443> and restarted apache, but when I try to access the site via https, the browser says: Firefox can't establish a connection to the server . 我也将虚拟主机从<VirtualHost *:443>更改为<VirtualHost *:8443>并重新启动了apache,但是当我尝试通过https访问该站点时,浏览器说: Firefox can't establish a connection to the server Could it be a firewall issue? 可能是防火墙问题吗?

at first the config looks good, I assume you have ssh enabled 首先,配置看起来不错,我假设您已启用ssh

ssh in the machine : ssh在机器上:

  • do wget --no-check-certificate https://127.0.0.1:8443 or curl -k https://127.0.0.1:443 (post the content) wget --no-check-certificate https://127.0.0.1:8443curl -k https://127.0.0.1:443 (发布内容)
  • watch open connections and see if it's an actual apache process behind it ( sudo netstat -anp | grep 8443 or sudo lsof | grep ":8443" ) 观察打开的连接,看看它背后是否是实际的Apache进程( sudo netstat -anp | grep 8443sudo lsof | grep ":8443"
  • is your config not overrided else where 是您的配​​置没有被覆盖,否则
  • check your config is valid (what's the output of the /etc/init.d/apache2 restart ) 检查您的配置是否有效( /etc/init.d/apache2 restart的输出是什么)
  • check the apache error/request logs if you see your traces or other errors 如果看到跟踪或其他错误,请检查apache错误/请求日志

From your laptop : 从您的笔记本电脑:

  • try a nmap with this machine as target, and see if the port appear as filtered 尝试以该机器为目标的nmap,并查看端口是否显示为已过滤
  • are you sure the dns is ok (tried with the ip address ?) 您确定dns正常吗(尝试使用ip地址?)

Give this book a try, it's awesome to learn new troubleshooting technics. 尝试一下这本书 ,学习新的故障排除技术很棒。

Configuration seams to be right, how do you try to access your site now? 配置接缝正确,您现在如何尝试访问您的站点? should be 应该

https://yourdomain.com:8443/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM