Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Where certificate files being created while using openssl? How to install custom generated certificate on Apache https?

root@ubuntu:/# openssl req \
>   -x509 -nodes -days 365 \
>   -newkey rsa:1024 -keyout mycert.pem -out mycert.pem
Generating a 1024 bit RSA private key
writing new private key to 'mycert.pem'

root@ubuntu:/# openssl pkcs12 -export \
>   -out mycert.pfx -in mycert.pem \
>   -name "My Certificate"
Enter Export Password:
Verifying - Enter Export Password: 


SSLCertificateFile    /etc/ssl/certs/mycert.pem
SSLCertificateKeyFile /etc/ssl/private/mycert.key # ??? 

As far as I understand I should include in /etc/apache2/sites-available/default-ssl directives which define SSL certificated. What folder used to store generated certificates mycert.pem? Where to get mycert.key file?

Tried to generate

openssl req -new -sha1 -newkey rsa:1024 -nodes -keyout mycert.key -out localhost.csr -subj '/O=Company/OU=Department/CN=localhost
share|improve this question
up vote 1 down vote accepted

This should help you get a Self Signed Cert made and set up:

It's pretty straight forward. It looks like you skipped the Step 2 and need to change the way you're doing step 4.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.