Installing Apache, MySQL, PHP, and SSL on 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).
Prerequisites:
- 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 PHP
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
Test 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.