Learn how to create and deploy a WordPress website on the AWS platform step by step, including setting up a virtual computer, installing Apache web server, MySQL database, and WordPress, assigning a domain name, and securing the website with an SSL certificate.
🚀 Deploy a WordPress website on AWS EC2 using the traditional method instead of one-click installation. 🖥️ Rent a virtual computer on AWS EC2 and install Apache web server and MySQL database. 🌐 Install WordPress, a popular content management system, on the web server. 🔐 Assign a domain name and secure the website with an SSL certificate.
💻 Creating a virtual computer on AWS EC2 allows you to have full control over your website and customize it as per your needs. 🌐 Installing Apache web server enables the handling of HTTP requests and serving appropriate responses for your website. 🗃️ Setting up a MySQL database provides a reliable and efficient way to store and manage data for your WordPress website. 📝 WordPress, written in PHP, is a powerful content management system that allows you to create and customize your website without the need for coding. 🌐 Assigning a domain name to your website makes it easily accessible to users and enhances its professional appearance. 🔒 Securing your website with an SSL certificate ensures the protection of user data and builds trust among visitors. 💡 By following the traditional method, you gain a deeper understanding of the components and processes involved in hosting a website on the cloud.
-
Install Apache server on Ubuntu - sudo apt install apache2
-
Install php runtime and php mysql connector - sudo apt install php libapache2-mod-php php-mysql
-
Install MySQL server - sudo apt install mysql-server
-
Login to MySQL server - sudo mysql -u root
-
Change authentication plugin to mysql_native_password (change the password to something strong) - ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password by 'Testpassword@123';
-
Create a new database user for wordpress (change the password to something strong) - CREATE USER 'wp_user'@localhost IDENTIFIED BY 'Testpassword@123';
-
Create a database for wordpress - CREATE DATABASE wp;
-
Grant all privilges on the database 'wp' to the newly created user - GRANT ALL PRIVILEGES ON wp.* TO 'wp_user'@localhost;
-
Download wordpress A) - cd /tmp B) - wget https://wordpress.org/latest.tar.gz
-
Unzip - tar -xvf latest.tar.gz
-
Move wordpress folder to apache document root - sudo mv wordpress/ /var/www/html
-
Command to restart/reload apache server - sudo systemctl restart apache2 OR - sudo systemctl reload apache2
-
Install certbot A) - sudo apt-get update B) - sudo apt install certbot python3-certbot-apache
-
Request and install ssl on your site with certbot - sudo certbot --apache