Task 02
Task 02
Task 02
How To Install the Apache Web Server on AWS EC2 (Ubuntu 22.04)
install the apache2 package:
Make sure the service is active by running the command for the systemd init system:
When you have your server’s IP address, enter it into your browser’s address bar:
Figure 2 default webpage of Apache
https://www.digitalocean.com/community/tutorials/how-to-install-the-apache-web-server-on-ubuntu-
22-04
check this out more additional commands and configurations.
How to Install MySQL on Ubuntu 22.04
open the terminal.
few minutes as the installation of the MySQL will take some time to complete
sudo mysql_secure_installation
In the configuration manual, you will be first asked to set the level for the password validation
policy. Input a number from the given menu according to your password validation requirements
After doing so, type out the new password for “root” and enter “y” to continue with the provided
password
https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-22-04
https://linuxhint.com/install-mysql-on-ubuntu-22-04/
now step up domain for your WordPress site , go to GoDaddy and create a new DNS record in
your site
DATA : The destination of the record - the value varies based on the record type.
TTL : The amount of time that DNS servers will wait before refreshing the record. Shorter TTLs
mean faster DNS updates in the future, and longer TTLs mean more resilience and higher
performance.
here are the steps on how to host a WordPress site with Apache
Install and configure the necessary dependencies.
Install PHP.
Install PHP
php -v
Install phpMyAdmin
phpMyAdmin is a web-based database management tool that you can use to view and edit the
MySQL databases on your EC2 instance
To install phpMyAdmin
Restart Apache.
Restart php-fpm.
cd /var/www/html
wget https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz
rm phpMyAdmin-latest-all-languages.tar.gz
Create WordPress Database
$ mysql -u root -p
FLUSH PRIVILEGES;
Exit.
Downloading WordPress
First, change into a writable directory (we recommend a temporary one like /tmp):
cd /tmp
Then download the compressed release with the following curl command:
curl -O https://wordpress.org/latest.tar.gz
Now, you need to make some changes to the main WordPress configuration file.
sudo nano /var/www/wordpress/wp-config.php
Next, You need to adjust the database name, the database user, and the associated password that
you configured within MySQL.
Figure 3 Save and close the file when you are finished.
https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-on-ubuntu-22-04-
with-a-lamp-stack#adjusting-the-ownership-and-permissions
2.
A.
here are the steps to install MySQL and phpMyAdmin on Ubuntu 22.04 and create a
user/password
Update your system packages
Enter the password that you set for the MySQL root user in the previous step.
FLUSH PRIVILEGES;
Exit MySQL:
Exit;
B.
Enter the password that you set for the MySQL root user in the previous step.
Assign the necessary privileges to the phpMyAdmin user for managing the database:
FLUSH PRIVILEGES;
C.
The new IP should match the address of the machine that needs to access the MySQL server
remotely. For example, if you bind MySQL to 0.0.0.0, then any machine that reaches the
MySQL server can also connect with it. Once you make the necessary changes, save and exit the
configuration file.
now created user successfully now give to the privileges their databases
grand all on *.* ‘YOUR USER NAME ’@’%’;
User Name : user name is going to be just we created on the mysql server
Now successfully connect to your workbench from your AWS EC2 instance
https://www.sqlshack.com/how-to-connect-to-remote-mysql-server-using-ssl-on-ubuntu-18-
04/
https://phoenixnap.com/kb/mysql-remote-connection