2013-07-18 54 views
-1

我試圖爲我的apache服務器設置一個digicert ssl通配符證書。我對某件事有點困惑。我有以下的配置至今:使用虛擬主機在apache服務器上設置ssl證書

NameVirtualHost *:80 
<VirtualHost *:80> 
    ServerName x.y.com 
    ServerAlias x.y.com 
    DocumentRoot /webapps/x/public 
    <Directory /webapps/x/public> 
    Options -MultiViews 
    Order deny,allow 
    Allow from all 
    </Directory> 
    ErrorLog /var/log/apache2/y.com_error.log 
    LogLevel warn 
    CustomLog /var/log/apache2/y.com_access.log combined 
    ServerSignature On 
</VirtualHost> 

NameVirtualHost *:443 
<VirtualHost *:443> 
    ServerName x.y.com 
    ServerAlias x.y.com 
    DocumentRoot /webapps/x/public 
    <Directory /webapps/x/public> 
    Options -MultiViews 
    Order deny,allow 
    Allow from all 
    </Directory> 
    ErrorLog /var/log/apache2/y.com_error.log 
    LogLevel warn 
    CustomLog /var/log/apache2/y.com_access.log combined 
    ServerSignature On 

    SSLEngine on 
    SSLCertificateFile /etc/certificates/www_y_com.crt 
    SSLCertificateKeyFile /etc/certificates/www_y_com.key 
    SSLCertificateChainFile /etc/certificates/DigiCertCA.crt 
    RailsEnv myenv 
</VirtualHost> 

,但我得到:

了NameVirtualHost *:80沒有VirtualHosts(98)地址已在使用: make_sock:無法綁定到地址0.0。 0.0:443沒有聽插座可用 ,關停

我應該如何配置此,爲了使工作?

非常感謝!

+0

也許你應該在[sf]上提出這個問題。 –

回答

1

一目瞭然,您的虛擬主機XML看起來是正確的。 我通常將NameVirtualHost指令寫入ports.conf文件,然後每個虛擬主機都必須有自己的文件。在我的系統上,它位於/ etc/apache2/sites-available/your-domain-name

還有一件事。確保您的路由器中的端口443已打開。我總是忘記這一點,花費數小時的時間試圖找出一些事情,當它像在你的路由器配置中的端口轉發443到你的服務器ip一樣簡單時。

另外不要忘記啓用該網站。

# enable site 
sudo a2ensite 

# disable site 
sudo a2dissite