Labels

Linux (46) network (13) troubleshoot (13) command (10) virtualization (10) ubuntu (9) Windows (8) cisco (7) security (7) router (6) Tools (5) software (5) vmware (5) ospf (3) eigrp (1) zimbra (1)

2010年3月23日

Apache+SSL in Debian Quick Setup

Step1: apt-get install apache2 openssl

Step2: (Generate cert file)
mkdir /etc/apache2/ssl
 
  RANDFILE=/dev/random openssl req $@ -new -x509 -days 365 -nodes \
    -out /etc/apache2/ssl/apache.pem \
    -keyout /etc/apache2/ssl/apache.pem

  chmod 600 /etc/apache2/ssl/apache.pem

Step3: (Config for apache2)
  cd /etc/apache2/sites-available/
  cp default ssl

Step4: (Enable the site. This is done by making a sym-link to the configuration 
from /etc/apache2/sites-enabled/.)
  a2ensite ssl

Step5: (To enable the ssl module from /etc/apache2/mods-available)
  a2enmod ssl

Step6: (Add 443 port to /etc/apache2/ports.conf)
  Listen 443

Step7: (Edit /etc/apache2/sites-available/ssl)
  NameVirtualHost *:443
  
   SSLEngine On
   SSLCertificateFile /etc/apache2/ssl/apache.pem
 
Step8: Restart apache2  /etc/init.d/apache2 restart 

沒有留言:

張貼留言