Apache SSL

# cd /etc/apache2
# a2enmod ssl
# a2ensite default-ssl
# systemctl reload apache2
# mkdir /etc/apache2/ssl
# openssl req -x509 -nodes -days 1825 -newkey rsa:2048 
  -keyout /etc/apache2/ssl/apache.key 
  -out /etc/apache2/ssl/apache.crt
# chmod 600 /etc/apache2/ssl/*

# nano /etc/apache2/sites-enabled/default-ssl.conf

default-ssl.conf

<IfModule mod_ssl.c>
    <VirtualHost _default_:443>
        ServerAdmin webmaster@localhost
        ServerName bambino.pl:443
        DocumentRoot /var/www/html/bambino/webroot
        . . .
        SSLEngine on
        . . .
        SSLCertificateFile /etc/apache2/ssl/apache.crt
        SSLCertificateKeyFile /etc/apache2/ssl/apache.key
# service apache2 reload
# openssl s_client -connect intranet.int:443

mod_rewrite

Włączenie modułu mod_rewrite

# a2enmod rewrite
# systemctl restart apache2

# editor /etc/apache2/apache2.conf

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

Lub

<VirtualHost *:80>
    <Directory /var/www/html>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Require all granted
    </Directory>

    . . .
</VirtualHost>

Apache – włączenie ssl

Zakładając istnienie openSSL

# apt-get upgrade openssl
# a2enmod ssl
-----------------
Considering dependency setenvif for ssl:
Module setenvif already enabled
Considering dependency mime for ssl:
Module mime already enabled
Considering dependency socache_shmcb for ssl:
Enabling module socache_shmcb.
Enabling module ssl.
See /usr/share/doc/apache2/README.Debian.gz on how to configure SSL and create self-signed certificates.
To activate the new configuration, you need to run:
  systemctl restart apache2
# a2ensite default-ssl
-----------------
Enabling site default-ssl.
To activate the new configuration, you need to run:
  systemctl reload apache2
# service apache2 reload