Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Server Log Https Auto
- apt-get install apache2
- Generate A certificate
- mkdir /etc/apache2/ssl
- cd /etc/apache2/ssl
- # openssl genrsa -des3 -out www.hade.war.net.key 2048
- Generating RSA private key, 2048 bit long modulus
- .......................................++++++
- ...................................................++++++
- e is 73547 (0x01001)
- Enter pass phrase for www.hade.war.net.key:
- Verifying - Enter pass phrase for www.hade.war.net.key:
- Openssl will request a pass phrase. Type in a sentence that is long and complex but that you can remember (you'll have to type it at least twice). Try to make it at least 40 characters long, with punctuation and capital and lowercase letters. The more different characters you use the better.
- root@hade:openssl req -new -key www.hade.war.net.key -out www.hade.war.net.csr
- Enter pass phrase for server.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]:ID
- State or Province Name (full name) [Some-State]:West Java
- Locality Name (eg, city) []:Bandung
- Organization Name (eg, company) [Internet Widgits Pty Ltd]:Hade Network
- Organizational Unit Name (eg, section) []:Hade Warnet
- Common Name (eg, YOUR name) []:Wandi Budiana
- Email Address []:[email protected]
- Please enter the following 'extra' attributes
- to be sent with your certificate request
- A challenge password []:password
- An optional company name []:
- root@hade:openssl x509 -req -days 365 -in www.hade.war.net.csr -signkey www.hade.war.net.key -out www.hade.war.net.crs
- Signature ok
- subject=/C=ID/ST=West Java/L=Bandung/O=Hade Network/OU=Warnet/CN=Wandi Budiana/[email protected]
- Getting Private key
- Enter pass phrase for server.key:
- One unfortunate side-effect of the pass-phrased private key is that Apache will ask for the pass-phrase each time the web server is started. use the following command to remove the pass-phrase from the key:
- cp www.hade.war.net.key www.hade.war.net.key.old
- openssl rsa -in www.hade.war.net.key.old -out www.hade.war.net.key
- The newly created server.key file has no more passphrase in it.
- Creating your .pem file
- for testing purposes
- cat www.hade.war.net.key www.hade.war.net.crt > www.hade.war.net.pem
- nano /etc/apache2/sites-available/default-ssl
- //update the following:
- SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
- SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
- with :
- SSLCertificateFile /etc/apache2/ssl/www.hade.war.net.pem
- SSLCertificateKeyFile /etc/apache2/ssl/www.hade.war.net.key
- ln -s /etc/apache2/sites-available/default-ssl /etc/apache2/sites-enabled/000-default-ssl
- a2enmod ssl
- /etc/init.d/apache2 force-reload or restart your Debian
- OR
- .PEM SSL Creation Instructions
- from: http://www.digicert.com/ssl-support/pem-ssl-creation.htm
- SSL .pem files (for our purposes, concatenated certificate files), are frequently required for certificate installations when multiple certificates are being imported as one file.
- The following sets of instructions walk through creating some of the various files that could be called for if your server requires a .pem ssl certificate.
- Creating a .pem with the Entire SSL Certificate Trust Chain
- Log in to download your Intermediate (DigiCertCA.crt), Root (TrustedRoot.crt), and Primary Certificates (your_domain_name.crt) from within your DigiCert Customer Account.
- Open a text editor (such as wordpad) and paste the entire body of each certificate into one text file in the following order:
- The Primary Certificate - your_domain_name.crt
- The Intermediate Certificate - DigiCertCA.crt
- The Root Certificate - TrustedRoot.crt
- Make sure to include the beginning and end tags on each certificate. The result should look like this:
- -----BEGIN CERTIFICATE-----
- (Your Primary SSL certificate: your_domain_name.crt)
- -----END CERTIFICATE-----
- -----BEGIN CERTIFICATE-----
- (Your Intermediate certificate: DigiCertCA.crt)
- -----END CERTIFICATE-----
- -----BEGIN CERTIFICATE-----
- (Your Root certificate: TrustedRoot.crt)
- -----END CERTIFICATE-----
- Save the combined file as your_domain_name.pem. Your .pem file is now ready for use.
- Creating a .pem with the Server and Intermediate Certificates
- Log in to download your Intermediate (DigiCertCA.crt) and Primary Certificates (your_domain_name.crt) from within your DigiCert Customer Account.
- With a text editor (such as wordpad), copy and paste the entire body of each certificate into one text file in the following order:
- The Primary Certificate - your_domain_name.crt
- The Intermediate Certificate - DigiCertCA.crt
- Make sure to include the beginning and end tags on each certificate. The result should look like this:
- -----BEGIN CERTIFICATE-----
- (Your Primary SSL certificate: your_domain_name.crt)
- -----END CERTIFICATE-----
- -----BEGIN CERTIFICATE-----
- (Your Intermediate certificate: DigiCertCA.crt)
- -----END CERTIFICATE-----
- Save the combined file as your_domain_name.pem. Your .pem file should be ready for use.
- Creating a .pem to include your private key and entire trust chain
- Log in to download your Intermediate (DigiCertCA.crt) and Primary Certificates (your_domain_name.crt) from within your DigiCert Customer Account.
- With a text editor (such as wordpad), copy and paste the entire body of each certificate into one text file in the following order:
- The Private Key - your_domain_name.key
- The Primary Certificate - your_domain_name.crt
- The Intermediate Certificate - DigiCertCA.crt
- The Root Certificate - TrustedRoot.crt
- Make sure to include the beginning and end tags on each certificate. The result should look like this:
- -----BEGIN RSA PRIVATE KEY-----
- (Your Private Key: your_domain_name.key)
- -----END RSA PRIVATE KEY-----
- -----BEGIN CERTIFICATE-----
- (Your Primary SSL certificate: your_domain_name.crt)
- -----END CERTIFICATE-----
- -----BEGIN CERTIFICATE-----
- (Your Intermediate certificate: DigiCertCA.crt)
- -----END CERTIFICATE-----
- -----BEGIN CERTIFICATE-----
- (Your Root certificate: TrustedRoot.crt)
- -----END CERTIFICATE-----
- Save the combined file as your_domain_name.pem. Your .pem file should be ready for use.
- chmod 600 *
- This step is optional and not really required. For testing purpose, you can always use the self-signed certificate that was generated from the above step.
- 4. Get a Valid SSL Certificate ( ip you will use this for online service)
- Instead of signing it youself, you can also generate a valid SSL certificate from https://www.startssl.com
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement