1. Install package yum install mod_ssl openssl 2. Create CA and generate Cert # Generate private key openssl genrsa -out ca.key 1024 # Generate CSR openssl req -new -key ca.key -out ca.csr # Generate Self Signed Key openssl x509 -req -days 365 -in ca.csr -signkey ca.key -out ca.crt # Move the files to the correct locations mv ca.crt /etc/pki/tls/certs mv ca.key /etc/pki/tls/private/ca.key mv ca.csr /etc/pki/tls/private/ca.csr 3. Config SSL for httpd Setup the path for the cert and ca key vi /etc/httpd/conf.d/ssl.conf SSLCertificateFile /etc/pki/tls/certs/ca.crt SSLCertificateKeyFile /etc/pki/tls/private/ca.key 4. Setup Virtual Host in Apache <virtualhost *:443> SSLEngine on SSLCertificateFile /etc/pki/tls/certs/ca.crt SSLCertificateKeyFile /etc/pki/tls/private/ca.key <Directory /var/www/vhosts/yoursite.com/httpsdocs> AllowOverride All </directory> DocumentRoot /var/www/vhosts/yoursite.com/httpsdocs ServerName yoursite.com </virtualhost> /etc/init.d/httpd restart
Labels
2010年5月27日
Apache+SSL in Centos
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言