Restart Apache or Nginx web server without password prompt
After installing SSL certificates on my Nginx server, I've started to experience some minor "annoyance" of being prompted for
Enter PEM pass phrase:
each time when I have to restart the web server.
This can be an issue when the server got rebooted and the web server will only activate with human intervention and restart not automatically.
To fix this, you need to remove the password from the server .key
file
> cp server.key server.key-withpassword
Strip out the password:
> openssl rsa -in server.key-withpassword -out server.key
and [enter the passpassword]
After this step, you should be able to restart your web server (Apache or Nginx) without being prompted for password.
However, make sure that the server.key
file is only accessible by trusted party... like a root user since the private key file is no longer encrypted!
By Adam Ng
IF you gain some knowledge or the information here solved your programming problem. Please consider donating to the less fortunate or some charities that you like. Apart from donation, planting trees, volunteering or reducing your carbon footprint will be great too.
Advertisement
Tutorials
+7.2k Golang : How to handle file size larger than available memory panic issue
+16k Golang : Test floating point numbers not-a-number and infinite example
+4.5k Linux/MacOSX : How to symlink a file?
+14.9k nginx: [emerg] unknown directive "ssl"
+11.7k Golang : Sort and reverse sort a slice of runes
+5.3k Golang : Configure crontab to poll every two minutes 8am to 6pm Monday to Friday
+13.3k Golang : Set image canvas or background to transparent
+5.8k Golang : Experimenting with the Rejang script
+11.6k Golang : How to parse plain email text and process email header?
+8.2k Python : Fix SyntaxError: Non-ASCII character in file, but no encoding declared
+14.3k Golang : Get URI segments by number and assign as variable example
+18.2k Golang : Iterating Elements Over A List