Provides a step-by-step guide and configuration files for deploying a WordPress website on an Amazon Web Services (AWS) Elastic Compute Cloud (EC2) instance with custom domain name (kiransinghverma.online)
- AMI — Ubuntu Server
- Instance Type — t2.micro
- Key Pair — ppk file format
- Firewall (security groups) — ssh, http, https
- Configuration Storage — 8 GB, gp2
- No. of Instance — 01
- Launch Instance
![Screenshot 2023-09-05 023648](https://private-user-images.githubusercontent.com/98480971/265604991-43a6c184-b22f-4e80-b5c2-bfc1a2f631fd.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQwNDkzODIsIm5iZiI6MTcyNDA0OTA4MiwicGF0aCI6Ii85ODQ4MDk3MS8yNjU2MDQ5OTEtNDNhNmMxODQtYjIyZi00ZTgwLWI1YzItYmZjMWEyZjYzMWZkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE5VDA2MzEyMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWZiYWIwZWE4YjE3ZWY2Mjc3MWY5MTVmNTU3NmUwOTM4OGI2NTczNTBmOTk5MjIxZWRhZDkyODU2MGQyMTlmZjUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.kdysBEEj5TDvAes5hzzDvwUjNYeGHfn3MXv3s-VFXcA)
![Screenshot 2023-09-05 023628](https://private-user-images.githubusercontent.com/98480971/265604933-184f1156-4366-4112-b8e4-e070d249e922.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQwNDkzODIsIm5iZiI6MTcyNDA0OTA4MiwicGF0aCI6Ii85ODQ4MDk3MS8yNjU2MDQ5MzMtMTg0ZjExNTYtNDM2Ni00MTEyLWI4ZTQtZTA3MGQyNDllOTIyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE5VDA2MzEyMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWM4NDdkN2NiM2U4YTc0NDhlZTNhOTk1MGU1YmM2ZGMzZWQ5MzZhZjUwMGY5ZDE0ODcwOGYxYmJmOTg0OTUwMjQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.ty2EDo6-sWL3sylunX1CBKAR67wrYKoKMl-_3_CQY28)
![Screenshot 2023-09-05 115832](https://private-user-images.githubusercontent.com/98480971/265623241-a264c96d-39c1-4734-8e2c-ace3307ecf8c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQwNDkzODIsIm5iZiI6MTcyNDA0OTA4MiwicGF0aCI6Ii85ODQ4MDk3MS8yNjU2MjMyNDEtYTI2NGM5NmQtMzljMS00NzM0LThlMmMtYWNlMzMwN2VjZjhjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLU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YmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.IgclFR_NyHFQD0dWn7IYZ-O4vrLRQ2sX3afHM6Pia5k)
sudo apt update
sudo apt install apache2 -y
sudo apt install php libapache2-mod-php php-mysql -y
sudo apt install mysql-server -y
sudo mysql -u root
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password by 'admin@123';
CREATE USER 'wp_user'@localhost IDENTIFIED BY 'admin@123';
CREATE DATABASE wp;
GRANT ALL PRIVILEGES ON wp. TO 'wp_user'@localhost;*
![Screenshot 2023-09-05 120019](https://private-user-images.githubusercontent.com/98480971/265623631-f76e8c6a-7158-4000-8976-6e3ece8a86cf.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQwNDkzODIsIm5iZiI6MTcyNDA0OTA4MiwicGF0aCI6Ii85ODQ4MDk3MS8yNjU2MjM2MzEtZjc2ZThjNmEtNzE1OC00MDAwLTg5NzYtNmUzZWNlOGE4NmNmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE5VDA2MzEyMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWJiYjg1MDMzNWEyMmI5NzJlNGQ5MjI4NGNiMzdlNmIwODE1NzhhOGYxMDNmNGRiMDY3MDQ2OTFkMWNhZjI3OGMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.atNGF-ooWldb_54kVrGAS4TNqvKnPDWMYsyZZv1xWcA)
cd /tmp wget https://wordpress.org/latest.tar.gz
tar -xvf latest.tar.gz
sudo mv wordpress/ /var/www/html
![Screenshot 2023-09-05 120035](https://private-user-images.githubusercontent.com/98480971/265624052-7542104f-29fe-4031-be74-b0ed60388e4e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQwNDkzODIsIm5iZiI6MTcyNDA0OTA4MiwicGF0aCI6Ii85ODQ4MDk3MS8yNjU2MjQwNTItNzU0MjEwNGYtMjlmZS00MDMxLWJlNzQtYjBlZDYwMzg4ZTRlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE5VDA2MzEyMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg4ODc4NjYyZTQ4NjcyNjM3N2Y5Yjc1NDhhYjZmMzg0Y2JlYjk4NDhmMDE2ZDVlNzYzOGRiMGYwMDliNmYyNjAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.26jr_XQXt0OBvbriK7fhuj7tDIQOMd4dUPhO8Z4SdEo)
![Screenshot 2023-09-05 120104](https://private-user-images.githubusercontent.com/98480971/265624159-c213c553-baf6-473e-a43a-6df22b3013c9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQwNDkzODIsIm5iZiI6MTcyNDA0OTA4MiwicGF0aCI6Ii85ODQ4MDk3MS8yNjU2MjQxNTktYzIxM2M1NTMtYmFmNi00NzNlLWE0M2EtNmRmMjJiMzAxM2M5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE5VDA2MzEyMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQ5MDI0M2QyNDExNTIzNzE1ZTE1MjNmYTExNzExYmJmNDI5NzEzZWQ2MTk5ZmI4ZDgzYzA0MGY0MGZiODIwZjgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.LK32wAOtoH35KduiwoPgsEIdnVizQDNH_aj0zL1Pggs)
cd /var/www/html/wordpress vi wp-config.php
3.89.166.68/wordpress/
I want Wordpress website to the server at this root path. for that I need to modify apache configuration, so I go back to my terminal rest follow below commands.
cd /etc/apache2/sites-available/ vi 000-default.conf
![Screenshot 2023-09-05 120730](https://private-user-images.githubusercontent.com/98480971/265624631-1348cb06-3a53-4735-8387-9dd32f557a50.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQwNDkzODIsIm5iZiI6MTcyNDA0OTA4MiwicGF0aCI6Ii85ODQ4MDk3MS8yNjU2MjQ2MzEtMTM0OGNiMDYtM2E1My00NzM1LTgzODctOWRkMzJmNTU3YTUwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE5VDA2MzEyMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWEyOTEyMzVmYjM5ZmVjYzc1MGYzZDk3OTJlMjBmODExZGIxYWU0OGU1ZWE1ZWZhZTJlYjUzNjZiZmI4NThmYWMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.Wu0oXYSpRMiFKl6I-lv_EWwai6ZWsE2CnyVN60nMxTM)
![Screenshot 2023-09-05 120755](https://private-user-images.githubusercontent.com/98480971/265624711-5eeb3714-d249-4636-8701-830e54e8bd03.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQwNDkzODIsIm5iZiI6MTcyNDA0OTA4MiwicGF0aCI6Ii85ODQ4MDk3MS8yNjU2MjQ3MTEtNWVlYjM3MTQtZDI0OS00NjM2LTg3MDEtODMwZTU0ZThiZDAzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE5VDA2MzEyMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTUxZjlkNWFmMDcyYWQ3YTg1YjUyZjU5Y2VjMjZjNmZmYWJjZGU5ZDQwNDIyNjU5NWNmZWVmMmE3NzY5NGUwN2ImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.tlqT42ZTWRSq1GCbJBfPqASUEMGatLUlISxStf6ehZ0)
sudo systemctl restart apache2
http://3.89.166.68/ # hit on browser
![Screenshot 2023-09-05 123415](https://private-user-images.githubusercontent.com/98480971/265627635-73c38b34-cb4c-4450-a2e8-31f8cd8b5842.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQwNDkzODIsIm5iZiI6MTcyNDA0OTA4MiwicGF0aCI6Ii85ODQ4MDk3MS8yNjU2Mjc2MzUtNzNjMzhiMzQtY2I0Yy00NDUwLWEyZTgtMzFmOGNkOGI1ODQyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE5VDA2MzEyMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWM5OWI0MjMzNTg2MjczYmFhMTY2N2FiOTQ1ZThjYmRmODEwMGE3M2NlNjZkNzFmMzAwYjQ4OGM4YWFiOGVlOTAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.R6t9Dd5cBy00mbSH1X125Bh372HKSfu3uQJ_IiLpEfg)
I purchased a domain called kiransinghverma.online from Hostinger
Here in Points to — ec2 instance public ip address Add Record cd /etc/apache2/sites-available/ vi 000-default.conf
sudo systemctl restart apache2
kiransinghverma.online # hit on browser probably it takes 15-20 minutes to reflect wait until Now we can access WordPress website by my domain name.
sudo apt-get update sudo apt install certbot python3-certbot-apache -y
sudo certbot --apache
![Screenshot 2023-09-05 123521](https://private-user-images.githubusercontent.com/98480971/265628336-4d9817e3-04cd-4f5e-926b-13c5af385472.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQwNDkzODIsIm5iZiI6MTcyNDA0OTA4MiwicGF0aCI6Ii85ODQ4MDk3MS8yNjU2MjgzMzYtNGQ5ODE3ZTMtMDRjZC00ZjVlLTkyNmItMTNjNWFmMzg1NDcyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE5VDA2MzEyMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWVmNDJjMjNmOTQ0YjE2YThjNWEyNjU3Y2RhYjhlMmQzNTQ2Y2I0MDQyYzJkMDljNzEyNmVjMzg2MDE3Yjg5MzUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.R1BNCs7nHDzms_uGlAbWZwioRpM4zRf30PuH9Ia_ijc)