嘗試設定 ssl 證書,但 a2ensite apache 拒絕啟動

嘗試設定 ssl 證書,但 a2ensite apache 拒絕啟動

如標題所說,我使用的是全新安裝的 ubuntu 16.04 系統,

我運行 sudo service apache2 status,它顯示:

Active: inactive (dead) since Thu 2017-10-26 15:11:36 PDT; 3s ago
Docs: man:systemd-sysv-generator(8)
Process: 3891 ExecStop=/etc/init.d/apache2 stop (code=exited, 
status=0/SUCCESS)
Process: 3873 ExecReload=/etc/init.d/apache2 reload (code=exited, 
status=0/SUCCESS)
Process: 3821 ExecStart=/etc/init.d/apache2 start (code=exited, 
status=0/SUCCESS)

Oct 26 15:10:50 12345server3 apache2[3821]:  * Starting Apache 
httpd web server apache2
Oct 26 15:10:50 12345server3 apache2[3821]: AH00558: apache2: 
Could not reliably determine the server's fully qualified domain name, 
using 127.0.1.1. Set 
Oct 26 15:10:51 12345server3 apache2[3821]:  *
Oct 26 15:10:51 12345server3 systemd[1]: Started LSB: Apache2 web 
server.
Oct 26 15:11:36 12345server3 systemd[1]: Reloading LSB: Apache2 
web server.
Oct 26 15:11:36 12345server3 apache2[3873]:  * Reloading Apache 
httpd web server apache2
Oct 26 15:11:36 12345server3 apache2[3873]:  *
Oct 26 15:11:36 12345server3 systemd[1]: Reloaded LSB: Apache2 web 
server.
Oct 26 15:11:36 12345server3 apache2[3891]:  * Stopping Apache 
httpd web server apache2
Oct 26 15:11:36 12345server3 apache2[3891]:  *

我的虛擬主機配置如下所示:

<Directory /var/www/html/fdsfdsdsa.com>
    Require all granted
</Directory>
<VirtualHost *:80>

ServerName fdsfdsdsa.com
    ServerAlias www.fdsfdsdsa.com
ServerAdmin [email protected]
DocumentRoot /var/www/html/fdsfdsdsa.com



ErrorLog /var/www/html/fdsfdsdsa.com/logs/error.log
CustomLog /var/www/html/fdsfdsdsa.com/logs/access.log combined



    <Directory /var/www/html/fdsfdsdsa.com>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    </Directory>
</VirtualHost>

<Directory /var/www/html/fdsfdsdsa.com>
    Require all granted
</Directory>

<VirtualHost *:443>
SSLEngine On
SSLCertificateFile /etc/ssl/certs/fdsfdsdsa.com.crt
SSLCertificateKeyFile /etc/ssl/private/fdsfdsdsa.com.key
SSLCertificateChainFile /etc/ssl/certs/2.crt

ServerAdmin [email protected]
ServerName fdsfdsdsa.com
ServerAlias fdsfdsdsa.com #If using alternate names for a host
DocumentRoot /var/www/html/fdsfdsdsa.com
ErrorLog /var/www/html/fdsfdsdsa.com/logs/errorssl.log
CustomLog /var/www/html/fdsfdsdsa.com/logs/accessssl.log combined
<Directory /var/www/html/fdsfdsdsa.com>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    </Directory>

</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

我不知道問題出在哪裡,我剛製作了證書,將它們放在正確的資料夾中,只要我 a2ensite 這個 ssl 站點,apache2 就會立即關閉

錯誤日誌顯示:「AH00016:設定失敗」僅此

如果我禁用 ssl 站點,其他站點可以完美運行

任何人都可以提供幫助或提出想法,我們將不勝感激。

答案1

這很可能是您的 SSL 憑證檔案的問題。你能用這個來驗證它們嗎:http://httpd.apache.org/docs/2.4/en/ssl/ssl_faq.html#verify

相關內容