Apache 2 - Setup Free SSL using Certbot

I wrote these tutorials for myself in future when I forget for the next steps.
Search for a command to run...

I wrote these tutorials for myself in future when I forget for the next steps.
No comments yet. Be the first to comment.
When you provision an Ubuntu instance on Oracle Cloud, you'll notice something different from standard Ubuntu installations: the system uses iptables instead of ufw for firewall management. This disti

When developing web applications locally, HTTPS is often overlooked. Yet, modern browsers and APIs increasingly require secure connections—even in development. That’s where mkcert comes in: a simple t

Testing the checkout success page in Magento 2 can be frustrating. By default, once an order is placed, Magento clears the quote session, meaning you can’t simply refresh or revisit the success page without going through the entire checkout process a...

Magento Commerce (EE) offers powerful features, but for many teams, Open Source (CE) is leaner, lighter, and more sustainable. If you're migrating from EE to CE, the Opengento downgrade tool provides a clean, scriptable way to remove proprietary modu...

If you’ve ever checked your Apache error logs and seen something like this: Code [core:error] (13)Permission denied: access to /robots.txt denied (filesystem path '/home/username/sites') because search permissions are missing on a component of the pa...

SSL is important thing for the security for your web application, some of the SSL are paid features, but we can have free SSL provided by Let’s Encrypt. In this article, we're going to try to configure SSL on ubuntu + apache2 server.
We need two packages in order to start creating SSL certficates, they are certbot and python3-certbot-apache.
sudo apt update
sudo apt install certbot python3-certbot-apache
in this case, I'm going to try to create a virtual host for magento245.dev.fiko.me. You just need to setup the port 80 and skipping the 443 port.
<VirtualHost *:80>
ServerAdmin hi@fiko.me
DocumentRoot /home/fiko/sites/magento245/pub/
ServerName magento245.dev.fiko.me
<Directory /home/fiko/sites/magento245/pub/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
<FilesMatch \.php$>
SetHandler "proxy:unix:/run/php/php8.1-fpm.sock|fcgi://localhost"
</FilesMatch>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
then restart your apache2 by running:
sudo service apache2 restart
Once you created the virtual host, try to create the certificate by running:
sudo certbot --apache
Follow the steps, and restart apache2 service.
Preferences: