Create ssl in ubuntu, centos and linux

  1. sudo openssl req -new -newkey rsa:2048 -nodes -keyout domain-name.key -out domain-name.csr
Generating a 2048 bit RSA private key
writing new private key to ‘domain-name.key’
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter ‘.’, the field will be left blank.
Country Name (2 letter code) [AU]:Country Code
State or Province Name (full name) [Some-State]:state name
Locality Name (eg, city) []:City Name
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Company name
Organizational Unit Name (eg, section) []:Unit name
Common Name (e.g. server FQDN or YOUR name) []: domain name
Email Address []:email address
Please enter the following ‘extra’ attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:

2. copy csr file and paste third party ssl provider website, then verify domain

3. After verify domain third party given certificate file (like cert.crt), bundle file(like bundle.crt or

4. edit in apache sites conf file

<IfModule mod_ssl.c>
        <VirtualHost _default_:443>
                ServerName domain-name
                ServerAlias www.domain-name
                DocumentRoot document
                SSLEngine on
                SSLCertificateFile /etc/ssl/cert.crt #certificate file full path
                SSLCertificateKeyFile /etc/ssl/domain-name.key #key file full path
                SSLCertificateChainFile /etc/ssl/ #bundle file full path

Leave a Reply

Your email address will not be published. Required fields are marked *