Kod:
apt-get update
apt-get install apache2 openssl
Kod:
apt-get update
apt-get install apache2 openssl
Kod:
sudo nano /etc/apache2/apache2.conf
write
<Directory /var/www/html>
AllowOverride All
</Directory>
Kod:
mkdir /etc/apache2/certificate
cd /etc/apache2/certificate
# sudo openssl req -new -newkey rsa:4096 -x509 -sha256 -days 365 -nodes -out apache-certificate.crt -keyout apache.key
Kod:
sudo nano /etc/apache2/sites-enabled/000-default.conf
Write :
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLEngine on
SSLCertificateFile /etc/apache2/certificate/apache-certificate.crt
SSLCertificateKeyFile /etc/apache2/certificate/apache.key
</VirtualHost>
Kod:
service apache2 restart
wiecej na ten temat w ponizszym linku
https://techexpert.tips/apache/enable-https-apache/
Lub tutaj : https://linuxhint.com/enable-https-apache-web-server/