centos 6 apache ssl setting

編輯/etc/httpd/conf.d/ssl.conf

    Listen 443 
    <VirtualHost _default_:443>
      # General setup for the virtual host, inherited from global configuration
      #DocumentRoot "/var/www/html"
      #ServerName www.example.com:443
      DocumentRoot "/var/www/受保護的目錄"
      ServerName *:443 
      # SSL Engine Switch:
      # Enable/Disable SSL for this virtual host. 
      SSLEngine on 
      # SSL Cipher Suite:
      # List the ciphers that the client is permitted to negotiate.
      # See the mod_ssl documentation for a complete list. 
      SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
     # Server Certificate:
     # Point SSLCertificateFile at a PEM encoded certificate. If
     # the certificate is encrypted, then you will be prompted for a
     # pass phrase. Note that a kill -HUP will prompt again. A new
     # certificate can be generated using the genkey(1) command.
     #SSLCertificateFile /etc/pki/tls/certs/localhost.crt
     SSLCertificateFile /etc/pki/tls/certs/idindon.crt
     # Server Private Key:
     # If the key is not combined with the certificate, use this
     # directive to point at the key file. Keep in mind that if
     # you've both a RSA and a DSA private key you can configure
     # both in parallel (to also allow the use of DSA ciphers, etc.)
     #SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
     SSLCertificateKeyFile /etc/pki/tls/certs/idindon.key
   </VirtualHost>

 

http://wiki.centos.org/HowTos/Https

# 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

# Copy the files to the correct locations
cp ca.crt /etc/pki/tls/certs
cp ca.key /etc/pki/tls/private/ca.key
cp ca.csr /etc/pki/tls/private/ca.csr
Tags