Drupal 網站設定SSL記錄

主機:Ubuntu 12.04 with Drupal 6.x

01.安裝 SSL sudo apt-get install openssl

02.啟用 Apache SSL sudo a2enmod ssl

03.建立放憑證的資料夾 sudo mkdir /etc/apache2/ssl

04.自簽簽憑證
openssl req -new -x509 -days 365 -nodes -out /etc/apache2/ssl/apache.pem -keyout /etc/apache2/ssl/apache.key

05.設定 Apache.conf

[VirtualHost *:80 *:443]
    DocumentRoot "/var/www/site"
    ServerName www.site.com
    SSLEngine On
    SSLCertificateFile /etc/apache2/ssl/apache.pem
    SSLCertificateKeyFile /etc/apache2/ssl/apache.key
[Directory "/var/www/site"]
    Options FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
    RewriteEngine on
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
[/Directory]
[/VirtualHost]

06.安裝SSL模組 Secure Pages
下圖為全站SSL的設定方法



參考資料:
http://www.arthurtoday.com/2011/11/ubuntu-apache-ssl-self-signed.html

小筆記:Godaddy SSL的設定記錄
http://support.godaddy.com/help/article/5537/getting-started-with-ssl-certificates
張貼留言
技術提供:Blogger.