GNU/Linux Desktop Survival Guide
by Graham Williams |
|||||
Apache Web Server |
20201017 Installing a web server begins with installing apache2:
$ wajig install apache2 |
$ wajig install lamp-server^ |
Once installed visit the website via its domain name or as localhost. Debian Apache provides a default web page at http://localhost/ with the actual page being sourced from /var/www/html/index.html. This is the starting point to creating a web site using unencrypted communications as indicated by http:.
Secure communications to the web server is deployed using SSL to encrypt all communications from a browser to the server (recognised with the https: prefix). Enable the ssl module in apache2, configure it and obtain a free SSL certificate from letsencrypt using certbot to deploy the certificate:
$ wajig install apache2 openssl ssl-cert $ sudo a2enmod ssl $ sudo a2ensite default-ssl $ sudo snap install core; sudo snap refresh core $ sudo snap install --classic certbot $ sudo ln -s /snap/bin/certbot /usr/bin/certbot $ sudo certbot --apache Enter email address Please read the Terms of Service Please enter in your domain names $ sudo certbot renew --dry-run $ wajig restart apache2 |
The certificate will be automatically updated through a timer.
$ systemctl list-timers |