Enabling Https on CentOS 5.2

Hi Guys,

I need to enable https on my centOS server, but I have no clue on how to do that.

Can somebody help me... one step at a time, please.!

My Linux Knowledge is not so deep.

I need it because of the Google Sitemap Generator.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Hi there,

Please ensure you run all the below commands as root or with the correct sudo rights as well as the correct PATH configured.

In order to serve web content via a secure channel (https) you will need the following packages installed:

httpd: Apache HTTP Server
mod_ssl: Apache HTTP Server cryptography module
openssl: Implementation of SSL and TLS
      1) yum install httpd mod_ssl openssl

Then you'll need to do the following steps in order to generate the private key, a cert request and a self-signed cert using the private key and cert request just created.
      2) openssl genrsa -out private.key 1024
      3) openssl req -new -key private.key -out cert_request.csr
      4) openssl x509 -req -days 365 -in cert_request.csr -signkey private.key -out signed_certificate.crt

You then need to put the resulting files in the 'right' places:
      5) mv signed_certificate.crt /etc/pki/tls/certs/.
      6) mv private.key /etc/pki/tls/private/.
      7) mv cert_request.csr /etc/pki/tls/private/.

Then you need to let mod_ssl know where you have put them:
      8) vi +/SSLCertificateFile /etc/httpd/conf.d/ssl.conf

Set this value (SSLCertificateFile) the same as where you placed the cert file:
      SSLCertificateFile /etc/pki/tls/certs/signed_certificate.crt

Then a few lines below this you'll find SSLCertificateKeyFile, set this to the following:
      SSLCertificateKeyFile /etc/pki/tls/private/private.key

Thats it.

Restart Apache and you should be good to go:
      9) /etc/init.d/httpd restart

If you are using iptables (you can find out by running /etc/init.d/iptables status) you'll need to add a rule to allow the traffic in:
      10) iptables -A INPUT -p tcp --dport 443 -j ACCEPT
      11) /etc/init.d/iptables save

Hope that this helps you on your way...


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.