• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 348
  • Last Modified:

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

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?
0
Balack
Asked:
Balack
1 Solution
 
BlazCommented:
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:
http://technocage.com/~caskey/openssl/
http://www.openssl.org/docs/HOWTO/certificates.txt
0
 
Dave HoweSoftware and Hardware EngineerCommented:
YAST has a built in CA - just use that :)
0
 
BalackAuthor Commented:
Then, how to use CA in YaST?
0
Improved Protection from Phishing Attacks

WatchGuard DNSWatch reduces malware infections by detecting and blocking malicious DNS requests, improving your ability to protect employees from phishing attacks. Learn more about our newest service included in Total Security Suite today!

 
BalackAuthor Commented:
Can show in step-by-step? This is going to be use by tomcat apache.
0
 
Dave HoweSoftware and Hardware EngineerCommented:
http://tinyurl.com/299ewo9 has a guide.

or you can use http://sourceforge.net/projects/xca if you want :)
0
 
BalackAuthor Commented:
It looks interesting. let's me read through and get back to you.
0
 
mik0sCommented:
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/>
                SSLRequireSSL
                ..........

Open in new window

0
 
BalackAuthor Commented:
good
0
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

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now