How to create public/private key pair for web in Linux system?

Posted on 2010-11-24
Medium Priority
Last Modified: 2012-05-10
This is using SLES 11.0 server. There is a newly-build web server. Just wondering how to create the above keys to make https pages?
Question by:Balack
LVL 16

Expert Comment

ID: 34204305
You can create a certificate on any machine - not neccessarily the same as you will be using it on.

You can create a certificate with openssl:
LVL 33

Expert Comment

by:Dave Howe
ID: 34205509
YAST has a built in CA - just use that :)

Author Comment

ID: 34205944
Then, how to use CA in YaST?
WEBINAR: GDPR Implemented - Tips & Lessons Learned

Join the WatchGuard team on Thursday, March 29th as we recount some valuable lessons learned in weighing the needs of a business against the new regulatory environment, look ahead at the two months left before implementation, and help you understand the steps you can take today!


Author Comment

ID: 34206744
Can show in step-by-step? This is going to be use by tomcat apache.
LVL 33

Accepted Solution

Dave Howe earned 1500 total points
ID: 34207058
http://tinyurl.com/299ewo9 has a guide.

or you can use http://sourceforge.net/projects/xca if you want :)

Author Comment

ID: 34210032
It looks interesting. let's me read through and get back to you.

Expert Comment

ID: 34212027
Generate a 1024 bit RSA private key

Execute command: “openssl genrsa -out private_key.pem 1024”

$ openssl genrsa -out private_key.pem 1024
Generating RSA private key, 1024 bit long modulus
e is 65537 (0x10001)

Open in new window

Generating a public key from a private key

Execute command: "openssl rsa -pubout -in private_key.pem -out public_key.pem"

$ openssl rsa -pubout -in private_key.pem -out public_key.pem
writing RSA key

Open in new window

A new file is created, public_key.pem, with the public key.

Viewing the key elements

Execute command: "openssl rsa -text -in private_key.pem"

Connect certificate to Aapche2

<VirtualHost hostname.com:443>


        SSLEngine on
        SSLOptions +StrictRequire
        SSLCACertificateFile /etc/apache2/ssl/cert-bundle.pem
        SSLCertificateFile /etc/apache2/ssl/cert-bundle.pem
        SSLCertificateKeyFile /etc/apache2/ssl/cert-bundle.pem

        <Directory /var/www/sitename/>

Open in new window


Author Closing Comment

ID: 34317139

Featured Post

We Need Your Input!

WatchGuard is currently running a beta program for our new macOS Host Sensor for our Threat Detection and Response service. We're looking for more macOS users to help provide insight and feedback to help us make the product even better. Please sign up for our beta program today!

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

So you need a certificate so you can offer SSL encryption.  But which one should you get?  There are so many choices out there! Here is a generic overview of the main types of SSL certificates sold by the majority of commercial Certification Auth…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In this video I will demonstrate how to set up Nine, which I now consider the best alternative email app to Touchdown.

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question