George McKinney Adventures in Software Development

February 14, 2024

LAMP Server on AWS EC2 Amazon Linux 2023 AMI

Filed under: Amazon Linux,AWS,Fedora — georgemck @ 2:40 pm

#!/bin/bash
dnf upgrade -y
dnf install -y httpd wget php-fpm php-mysqli php-json php php-devel
dnf install mariadb105-server
systemctl start httpd
systemctl enable httpd
systemctl is-enabled httpd
usermod -a -G apache ec2-user
chown -R ec2-user:apache /var/www
chmod 2775 /var/www && find /var/www -type d -exec sudo chmod 2775 {} \;
find /var/www -type f -exec sudo chmod 0664 {} \;
echo “” > /var/www/html/phpinfo.php

Powered by WordPress