Forums Drupal

running drupal on SSL

Subscribe to running drupal on SSL 2 post(s), 2 voice(s)

 
Avatar kahem 22 post(s)

hi guyz,

one more question, how can i run the drupal bitnami stack as https instead of http.

thanks
mehak

 
Avatar Manu Administrator 50 post(s)

Hi Mehak,

We will update our stacks with a fixed bug in openssl soon. Yes you can run the BitNami Drupal Stack as https soon. Only you need to do the following:

1. First of all you must to generate a private key:

openssl genrsa 1024 > web.key

2. Second step is generate a certificate file:

openssl req -new -key web.key -out web.csr

3. Now we generate this certicate for 1000 days signed by ourselves:

openssl req -x509 -days 10000 -key web.key -in web.csr -out web.crt

4. Ok, now we must to create a virtual host for drupal so we need to edit the drupal configuration file in apps/drupal/conf/drupal.conf. Add the following lines:
NOTE: in this example, the keys was generated in /home/user/drupalDir/keys. Don’t forget this path, we need to add it into drupal.conf

NameVirtualHost *:8443
<VirtualHost *:8443>
    ServerName localhost:8443 
    DocumentRoot /home/user/drupalDir/apps/drupal/htdocs/
    ErrorLog "/home/user/drupalDir/apps/drupal/error.log" 
    TransferLog "/home/user/drupalDir/apps/drupal/transfer.log" 

    SSLEngine On
    SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
    SSLCertificateFile /home/user/drupalDir/keys/web.crt
    SSLCertificateKeyFile /home/user/drupalDir/keys/web.key

    <Directory "/home/mviera/drupalDir/apps/drupal/htdocs">
        Options Indexes MultiViews
        AllowOverride All
        Order allow,deny
        Allow from all
        SSLOptions +StdEnvVars
    </Directory>

</VirtualHost>

5. The last step is to restart apache2 with ctlscript.sh

cd /home/user/drupalDir
./ctlscript.sh restart

Now you can access to Drupal application at https://localhost:8443. Maybe you have an exception alert because your browser don’t trust at your key because it was generated and signed by yourself. You only must to add your certificate file in your browser and all will works with https.

Cheers,
Manu.

Forums Drupal