🖥️ Step 1: Launch EC2 Instance
Go to the EC2 Dashboard.
- Click Launch Instance.
- Choose Ubuntu Server 22.04 LTS.
- Choose an instance type (e.g., t2.micro for free tier).
- Create or use an existing key pair (you’ll need it for SSH).
- Configure security group:
- Allow HTTP (80), HTTPS (443), and SSH (22) from your IP.
- Launch instance.
🔗 *Step 2: Connect to EC2 via SSH
*
ssh -i your-key.pem ubuntu@your-ec2-public-ip
📦 Step 3: Install Apache Web Server
sudo apt update
sudo apt install apache2 -y
sudo systemctl enable apache2
sudo systemctl start apache2
Visit http://your-ec2-public-ip to see the Apache2 Ubuntu Default Page.
🐘 Step 4: Install MySQL (Database Server)
sudo apt install mysql-server -y
sudo mysql_secure_installation
Set a strong MySQL root password during the configuration.
✈️ Step 5: Create a WordPress Database and User
Bash
sudo mysql -u root -p
SQL
CREATE DATABASE wordpress;
CREATE USER 'wp_user'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON wordpress.* TO 'wp_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;
💻 Step 6: Install PHP and Extensions
Bash
sudo apt install php libapache2-mod-php php-mysql php-curl php-gd php-mbstring php-xml php-xmlrpc php-soap php-intl php-zip -y
sudo systemctl restart apache2
⬇️ Step 7: Download WordPress
cd /tmp
curl -O https://wordpress.org/latest.tar.gz
tar -xvzf latest.tar.gz
Copy files to Apache root directory
SOCIAL SHARE CARD GENERATOR