Once you’re connected to your Amazon Linux 2023 instance, follow these steps to deploy the application.

To ensure all your software packages are up to date, execute the following command:
sudo dnf update -y
The -y option installs the updates without asking for confirmation. If you would like to examine the updates before installing, you can omit this option.

Install the latest versions of Apache web server and PHP packages for Amazon Linux 2023.
sudo dnf install -y httpd wget php-fpm php-mysqli php-json php php-devel

Install the MariaDB software packages.
sudo dnf install mariadb105-server

sudo dnf info mariadb105

Start the Apache web server.
sudo systemctl start httpd
Configure the Apache web server to start on system boot.
sudo systemctl enable httpd
Verify that httpd is enabled by running the following command:
sudo systemctl is-enabled httpd

In the EC2 interface:

Paste the Public IPv4 address into your browser to test Apache.


Execute the following commands to grant permissions:
Add your user (in this case ec2-user) to the apache group: sudo usermod -a -G apache ec2-user
Change the ownership of the /var/www directory and its contents to the apache group.sudo chown -R ec2-user:apache /var/www
To add group write permissions and set group IDs on future subdirectories, change the directory permissions of /var/www and its subdirectories. sudo chmod 2775 /var/www && find /var/www -type d -exec sudo chmod 2775 {} \;
To add group write permissions, recursively change the permissions for the files in /var/www and its subdirectories:find /var/www -type f -exec sudo chmod 0664 {} \;
