Skip to content

Instantly share code, notes, and snippets.

@kelvinotuya
Forked from mikepfeiffer/apache.sh
Created June 20, 2021 15:35
Show Gist options
  • Select an option

  • Save kelvinotuya/5e3cd14d476645d79aa864286437c2aa to your computer and use it in GitHub Desktop.

Select an option

Save kelvinotuya/5e3cd14d476645d79aa864286437c2aa to your computer and use it in GitHub Desktop.
Setup Apache on Amazon Linux
#!/bin/bash
yum update -y
yum install -y httpd24 php70 mysql php70-mysqlnd
service httpd start
chkconfig httpd on
usermod -a -G apache ec2-user
sudo chown -R ec2-user:apache /var/www
sudo chmod 2775 /var/www
@kelvinotuya
Copy link
Author

kelvinotuya commented Jun 20, 2021

The yum-install commands no longer work.Use the following command to enable PHP for your WordPress instance:
yum -y install httpd mysql
amazon-linux-extras install epel -y


yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm

yum-config-manager --disable remi-php54

yum-config-manager --enable remi-php73

amazon-linux-extras install php7.3 -y

@nicholaschaung
Agree with @ChainShark those no longer work. Alternatively, this might be simpler:sudo yum install -y httpd php mysql php-mysqlnd
@bureku
Tip

bureku commented on May 20, 2020

Agree with @ChainShark those no longer work. Alternatively, this might be simpler:sudo yum install -y httpd php mysql php-mysqlndWordPress requires PHP 7, on EC2 using Amazon Linux instance, this command will install PHP 5.
@bertperrisor
@nicholaschaung @ChainShark the yum install -y httpd24 php70 mysql php70-mysqlnd command works fine on an Amazon Linux AMI instance.[root@ip-10-0-0-60 ec2-user]# cat /etc/os-release
NAME="Amazon Linux AMI"
VERSION="2018.03"
ID="amzn"
ID_LIKE="rhel fedora"
...
You might want to check if your Linux instance has yum installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment