0

I have the following set of instructions on how to bootstrap a website hosting environment

#!/bin/bash

apt update -y apt upgrade ufw sshguard unattended-upgrades wget curl git zip unzip tree -y ufw --force enable ufw allow 22,25,80,443

apt install lamp-server^ -y a2enmod http2 deflate expires

apt install phpmyadmin php-mbstring php-gettext -y

cat <<-EOF >> "$HOME"/.profile set -x complete -r export web_application_root="/var/www/html" export -f full_apache_restart full_apache_restart() { find "$web_application_root"/* -type d -exec chmod 755 {} + find "$web_application_root"/* -type f -exec chmod 644 {} + chown -R www-data:www-data "$web_application_root"/ systemctl restart apache* } EOF source "$HOME"/.profile 2>/dev/null

Set DB credentials with PHPMyAdmin

Set Apache virtual host

Set SSL certificate

How to execute the last directive "Set SSL certificate" in a free or gratis way, without paying money?

  • 3
    Let's Encrypt can provide a CA-signed certificate for an internet-facing website, but they do have their own technical process for it. Link: https://letsencrypt.org/ – Haxiel Oct 06 '22 at 02:55
  • Must I first configure a virtual host before the certificate or can I first start with the certificate? – automation Oct 06 '22 at 07:25
  • 1
    Perhaps this should be a new question. – automation Oct 06 '22 at 07:26
  • The documentation for certbot - the automation tool that works with Let's Encrypt - says that your website needs to be online and reachable on port 80 - plain HTTP. I don't know if this is a hard requirement, but if it is, you'll need the virtual host to be configured and the site to be up and running. – Haxiel Oct 06 '22 at 17:15
  • 1
    "I don't know if this is a hard requirement" - it is if you're going to be using http authentication to LE, @Haxiel – Chris Davies Oct 07 '22 at 11:17
  • But there is DNS authentication too, hence you can fully get a certificate without any website running. – Patrick Mevzek Dec 05 '22 at 17:14

0 Answers0