Skip to content

Instantly share code, notes, and snippets.

@javatask
Created December 9, 2021 19:31
Show Gist options
  • Save javatask/1df19642bad34ed27c4faf082c5ceb7a to your computer and use it in GitHub Desktop.
Save javatask/1df19642bad34ed27c4faf082c5ceb7a to your computer and use it in GitHub Desktop.
User data script for AWS EC2 instance based on AMI2
#!/bin/bash
sudo yum -y update
sudo amazon-linux-extras install -y php7.4
sudo yum install -y php-cli php-pdo php-fpm php-json php-mysqlnd php-dom php-gd php-simplexml php-xml php-opcache php-mbstring httpd
wget https://www.drupal.org/download-latest/tar.gz
tar -xzf tar.gz
mv drupal-* drupal
cd drupal
sudo rsync -avz . /var/www/html
sudo chown -R apache:apache /var/www/html
sudo service httpd restart
# Manually change to configure clean URL
# sudo nano /etc/httpd/conf/httpd.conf set AllowOverride All for /var/www/html
# sudo systemctl restart httpd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment