2016-08-01 62 views
1

我有一個笨點的Apache Web服務器 上運行我安裝letsencrypt訪問網站通過HTTPS是打破數據庫連接

我的網站能正常工作的SSL,如果我通過http://example.com

,但訪問它,

如果我訪問它通過https://example.com的網站顯示,但該數據庫被打破

這是我的htaccess文件

「數據庫損壞」:
Include /etc/phpmyadmin/apache.conf 
<VirtualHost *:80> 
     ServerName example.org 
     ServerAlias www.example.org 
     ServerAdmin [email protected] 
     DocumentRoot /var/www/html 
     RewriteEngine on 
     RewriteRule "^/resources/(.+)" "https://example.org/_resources/$1"$ 
     ErrorLog ${APACHE_LOG_DIR}/error.log 
     CustomLog ${APACHE_LOG_DIR}/access.log combined 
     <Directory /var/www/html> 
       Options Indexes FollowSymLinks MultiViews 
       AllowOverride All 
       Order allow,deny 
       allow from all 
     </Directory> 
     ProxyPass /api https://localhost:8010/api 
     ProxyPassReverse /api https://localhost:8010/api 
</VirtualHost> 
<IfModule mod_ssl.c> 
<VirtualHost *:443> 
    ServerName example.org 
    ServerAlias www.example.org 
    DocumentRoot /var/www/html/ 
    Include /etc/letsencrypt/options-ssl-apache.conf 
    SSLEngine on 
    SSLCertificateFile /etc/letsencrypt/live/example.org-0001/cert.pem 
    SSLCertificateKeyFile /etc/letsencrypt/live/example.org-0001/privkey.pem 
    SSLCertificateChainFile /etc/letsencrypt/live/example.org-0001/chain.pem 
</VirtualHost> 
+1

你能更仔細地描述的內修復了這個問題。究竟發生了什麼? –

+0

所以當我用「http」打我的網站時,一切正常,所有鏈接,從數據庫中提取的所有動態內容一切正常。當我通過「https」訪問我的網站時,只有主頁可以正常工作,但沒有鏈接也可以正常工作,主頁上的動態內容爲空白。 – Tsea

回答

1

通過添加<VirtualHost *:443>標籤

<Directory /var/www/html> 
     AllowOverride All 
    </Directory>