wiki:jazz/apache2ssl

Version 4 (modified by jazz, 16 years ago) (diff)

--

trac-pool:~# apt-get install ssl-cert openssl
trac-pool:~# a2enmod ssl
trac-pool:~# mkdir /etc/apache2/ssl
trac-pool:~# make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/apache2/ssl/apache.pem
trac-pool:~# cp /etc/apache2/sites-available/default /etc/apache2/sites-available/ssl
trac-pool:~# ln -s /etc/apache2/sites-available/ssl /etc/apache2/sites-enabled/ssl
trac-pool:~# vi /etc/apache2/sites-available/default
  • /etc/apache2/sites-available/default

    old new  
    1 NameVirtualHost *
    2 <VirtualHost *>
     1NameVirtualHost *:80
     2<VirtualHost *:80>
    33       ServerAdmin webmaster@localhost
    44
    55       DocumentRoot /var/www/
trac-pool:~# vi /etc/apache2/sites-available/ssl
  • /etc/apache2/sites-available/

    old new  
    1 NameVirtualHost *
    2 <VirtualHost *>
     1NameVirtualHost *:443
     2<VirtualHost *:443>
    33       ServerAdmin webmaster@localhost
     4       SSLEngine on
     5       SSLCertificateFile /etc/apache2/ssl/apache.pem
    46
    57       DocumentRoot /var/www/
    68       <Directory />

Reference