How to setup Apache SSL (Self-signed Certificate) on Ubuntu 9.04

212
Nice!
  1. Install openssl
    # sudo apt-get install openssl
  2. Create a serect key (e.g. server.key)
    # sudo openssl genrsa -des3 -out server.key 1024
  3. Create a public key (e.g. server.csr)
    # sudo openssl req -new -key server.key -out server.csr
  4. Create a signed certificate(e.g. server.crt / Expiration is ten (10) years)
    # sudo openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt
  5. Copy the keys to an appropriate directory (Note a permission to copy destination)
    # cp server.crt /etc/ssl/certs/; cp server.key /etc/ssl/private/
  6. Edit /etc/apache2/sites-available/default-ssl
    # sudo vi /etc/apache2/sites-available/default-ssl

    # Comment out the following two lines:
    # SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
    # SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key

    # Add the following two lines:
    SSLCertificateFile /etc/ssl/certs/server.crt
    SSLCertificateKeyFile /etc/ssl/private/server.key
  7. Enable mod_ssl (Apache2 SSL module)
    # sudo a2enmod ssl
    # sudo a2ensite default-ssl
  8. Restart Apache2 (Answer the secret key's password)
    # sudo /etc/init.d/apache2 force-reload && sudo /etc/init.d/apache2 restart
  9. (Optional) Aways enable SSL
    # sudo a2enmod rewrite
    # sudo vi /etc/apache2/sites-available/default

    # Insert these lines at the bottom part in between<VirtualHost *:80>...</VirtualHost>
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
  10. (Optional) Add +ExecCGI
    # sudo vi /etc/apache2/sites-available/default-ssl
トラックバック URL: http://perltips.twinkle.cc/trackback/345
reply this topic
It is great that we can get the personal loans and this opens up completely new possibilities.
Posted by BartlettBETSY18 (未認証ユーザ) on 2010/06/28(月) 12:48
respond
All is well with your research process if some students notice the great essay writing company to purchase essays in. Thus it is available to get custom research paper.
Posted by SniderIrene (未認証ユーザ) on 2010/07/11(日) 15:16