簡體   English   中英

Apache2 SSL設置適用於靜態IP,但不適用於域名

[英]Apache2 SSL setup works with Static IP but not with domain name

所以我有一個運行apache2 v2.4.7的數字海洋ubuntu 14.04服務器。 我買了一個namecheap .me域,並將其URL框架指向DO服務器的IP。 到目前為止一切正常。 然后,我注冊了免費的StartSSL證書(已注冊到.me域名),並通過本教程將其添加到服務器中,我唯一沒有做的就是將VirtualHost 80和443保留在同一文件中。 我將443放在其自己的default-ssl.conf文件中。

現在,如果我轉到http://123.123.123.123http://www.myexample.me它可以正常工作。 如果我轉到https://123.123.123.123 (端口443 ssl virtualhost),它可以工作,但是警告我,因為證書已注冊到www.myexample.me,很好。

最后,如果我轉到https://www.myexample.me則不會執行任何操作,但在chrome JavaScript控制台中除外

GET https://www.myexample.me/ net::ERR_CONNECTION_REFUSED

這是我的default-ssl.conf文件

<IfModule mod_ssl.c>
    <VirtualHost *:443>
    ServerAdmin webmaster@localhost
    ServerName myexample.me:443
    DocumentRoot /var/www/html
    SSLEngine on                                                                
    SSLProtocol all -SSLv2                                                      
    SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM                
    SSLCertificateFile /etc/apache2/ssl/ssl.crt                           
    SSLCertificateKeyFile /etc/apache2/ssl/private.key                        
    SSLCertificateChainFile /etc/apache2/ssl/sub.class1.server.ca.pem 

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    <FilesMatch "\.(cgi|shtml|phtml|php)$">
            SSLOptions +StdEnvVars
    </FilesMatch>
    <Directory /usr/lib/cgi-bin>
            SSLOptions +StdEnvVars
    </Directory>

    BrowserMatch "MSIE [2-6]" \
            nokeepalive ssl-unclean-shutdown \
            downgrade-1.0 force-response-1.0

    BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown

    </VirtualHost>
</IfModule>

當我添加證書后重新加載apache時。 我收到此錯誤。

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message

因此,我在apache2.conf文件的底部添加了Servername myexample.me ,這似乎可以抑制該錯誤。

任何指導表示贊賞。 讓我知道是否錯過發布任何信息。

所以我能夠解決它,這是很愚蠢的錯誤,但是如果我發貼,以防其他人也犯同樣的錯誤。

在namecheap的URLRedirect設置中,或者無論您使用的是哪個提供程序,我的URL重定向設置都設置為URLFrame。 但是應該將它們設置為A(地址)。

感謝所有提供幫助的人。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM