Installing Apache with MySQL, PHP and Let's Encrypt SSL using Certbot on a Linux VPS
Detailed guide on setting up Apache, MySQL, and PHP for mydomain.com, secured with Let's Encrypt SSL on a Linux VPS, with configurations for HTTP (port 80) and HTTPS ( port 443).
- An EDIS Global Linux VPS (Ubuntu 20.04 recommended)
- SSH root access to the VPS
- A registered domain name pointing to your VPS' IP address
Update your VPS
Install Apache Web Server
Configure Apache for mydomain.com Create a virtual host configuration for your domain:
Add the following:
Save and exit the editor.
Enable the configuration and restart Apache:
Install MySQL Database Server
Secure MySQL Installation Run the security script:
Install Certbot for SSL
Obtain Let's Encrypt SSL Certificate for mydomain.com
Certbot will automatically configure the Apache virtual host for SSL (port 443).
Confirm Port 443 Configuration Your configuration should have been updated to include a <VirtualHost *:443> block for SSL. Confirm by:
Automatic Certificate Renewal
Finalize Configuration & Restart Apache
Your domain mydomain.com is now configured on Apache with MySQL and PHP, utilizing ports 80 (HTTP) and 443 (HTTPS/SSL) with a secure SSL certificate from Let's Encrypt.