10.3 Using Expect

Everytime Apache is started, the pass phrase that you entered will have to be re-entered. If you do not wish to have a password with your certificate, read on the section below.

It is possible to have an Expect script start the Apache server by automatically entering in the password, for example:

#!/usr/bin/expect

spawn /usr/local/apache/bin/apachectl startssl
set password SSL-Certificate-Password
expect "pass phrase:"
send "$password\r"
expect eof

This is not advisable as the password is out there in plain text. If you do follow this method, it is strongly encouraged to allow only the root user to edit and execute it!