If you've got an SSL certificate that you're using that happens to be protected with a passphrase, you know that you need to enter that password every single time you restart your web server. Since Linux is so stable these days it's hardly a big problem, but if something goes wrong while you're on vacation or away from your computer, it could become a big deal. One solution is to remove the passphrase from your ssl certificate so that Apache doesn't ask you for it. But there's another way too.Basically it boils down to creating a file with your passphrase in it and then pointing apache to it. Since we love Ruby around here, we'll show you how to create the passphrase script using it.
#!/usr/bin/ruby
puts "passphrase"
Save that somewhere and then add this to your /etc/apache2/httpd.conf file:
SSLPassPhraseDialog exec:/path/to/passphrase
Lastly, let's make sure that file is executable:
sudo chmod +x /path/to/passphrase
That should be it. Let's stop apache and then start it again:
sudo apache2ctl stop
sudo apache2ctl start
If all went well, you weren't asked for a passphrase and your apache server is still running!
There are some disadvantages though. One of the biggest reasons to put a passphrase in your ssl cert is to prevent it from being hijacked. If a cracker can get into your server and take the cert he/she might be also able to get your passphrase file. That's no good. So be sure to put your passphrase somewhere secure and protect your server.
Click
Follow me on twitter 
2 comments: