Advanced Setup Guides

Installing Apache, MySQL, PHP, and SSL on Linux VPS

8min

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

Shell


Install Apache Web Server

Shell


Configure Apache for mydomain.com Create a virtual host configuration for your domain:

Shell


Add the following:

Shell


Save and exit the editor.

Enable the configuration and restart Apache:

Shell


Install MySQL Database Server

Shell


Secure MySQL Installation Run the security script:

Shell


Install PHP

Shell


Install Certbot for SSL

Shell


Obtain Let's Encrypt SSL Certificate for mydomain.com

Shell


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:

Shell


Automatic Certificate Renewal

Shell


Test renewal:

Shell


Finalize Configuration & Restart Apache

Shell


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.