User Tools

Site Tools


wiki:os:debian:apache2_ssl

Apache2 + SSL

# apt-get install apache2 ssl-cert openssl
# mkdir /etc/apache2/ssl
# openssl req $@ -new -x509 -days 365 -nodes -out /etc/apache2/ssl/apache.pem -keyout /etc/apache2/ssl/apache.pem
# chmod 600 /etc/apache2/ssl/jenscz.pem
  • /etc/apache2/ports.conf - zde se např dá zakázat port 80
/etc/apache2/sites-available/ssl
NameVirtualHost *:443
<VirtualHost *:443>
  ServerAdmin webmaster@domain.cz
  ServerName localhost
  # ServerAlias *.localhost.localdomain

  SSLEngine On
  SSLCertificateFile /etc/apache2/ssl/apache.pem

  DocumentRoot /var/www/
  <Directory />
    Options FollowSymLinks
    AllowOverride All
  </Directory>
  <Directory /var/www/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    Allow from all
  </Directory>

  LogLevel warn
  ErrorLog /var/log/apache2/ssl-error.log
  CustomLog /var/log/apache2/ssl-access.log combined

</VirtualHost>
# ln -s /etc/apache2/sites-available/ssl /etc/apache2/sites-enabled/ssl
# a2enmod ssl
# a2enmod rewrite
# /etc/init.d/apache2 restart
wiki/os/debian/apache2_ssl.txt · Last modified: 2014/12/26 18:31 (external edit)