0

I wish to non-interactively provide the password which is prompted when I start apache httpd webserver.

The password would be a variable.

I don't want the prompt and feeding password manually like below:

/web/apps/perf/apache/2.4.46/https-model/bin/apachectl -k start
Apache/2.4.46 mod_ssl (Pass Phrase Dialog)
Some of your private key files are encrypted for security reasons.
In order to read them you have to provide the pass phrases.

Private key model.com:443:0 (/web/apps/perf/apache/2.4.46/https-model/ssl/model.key)
Enter pass phrase:

I tried the below option but none of them help.

echo -n "mypassword" | /web/apps/perf/apache/2.4.46/https-model/bin/apachectl -k start
echo "mypassword" >> /web/apps/perf/apache/2.4.46/https-model/bin/apachectl -k start
/web/apps/perf/apache/2.4.46/https-model/bin/apachectl -k start << echo "mypassword"
/web/apps/perf/apache/2.4.46/https-model/bin/apachectl -k start << cat mypasswordfile (where mypasswordfile is a file having the password.)

Can you please suggest?

1 Answer 1

2

It looks like your private key for the SSL certificate is password protected. Usually, the best and easiest approach is to remove the passphrase from the key.

openssl rsa -in [original.key] -out [new.key]

You'll be prompted for your key's password. After running, new.key would be without the password. You can either replace it or point Apache to the "newly" generated key.

If for some reason you'd like to have a passphrase for your private key, you can use this approach - https://serverfault.com/a/160835

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .