Skip to content

Instantly share code, notes, and snippets.

@anuragteapot
Last active May 7, 2020 16:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anuragteapot/b13f466bf0c32f060c73dc80bb97baed to your computer and use it in GitHub Desktop.
Save anuragteapot/b13f466bf0c32f060c73dc80bb97baed to your computer and use it in GitHub Desktop.
Install Drupal AWS
// Install Mysql server
sudo apt update
sudo apt install mysql-server
sudo mysql_secure_installation // Now Set your passsword
// Install PHP 7.2
sudo apt install php7.2-cli php7.2-fpm php7.2-mysql php7.2-json php7.2-opcache php7.2-mbstring php7.2-xml php7.2-gd php7.2-curl
// Check PHP status make sure running
systemctl status php7.2-fpm
// Install
sudo apt update
sudo apt install apache2
sudo ufw app list
sudo ufw allow 'Apache'
sudo ufw allow ssh
sudo ufw enable
sudo ufw status // Make sure ufw is running
// Important
sudo ufw app list
This list should contain ssh. If not you are able to connect to your EC2.
// Check web server
sudo systemctl status apache2
sudo apt-get install php libapache2-mod-php
sudo a2enmod rewrite
sudo nano /etc/apache2/sites-enabled/000-default.conf
// Add this
<Directory /var/www/html>
AllowOverride All
</Directory>
sudo service apache2 restart
// Install composer
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
// Setup Database
sudo mysql -u root -p
> CREATE DATABASE drupal CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES ON drupal.* TO 'drupaluser'@'localhost' IDENTIFIED BY 'change-with-strong-password';
> FLUSH PRIVILEGES;
> exit;
// Install Drupal
cd ~
wget http://ftp.drupal.org/files/projects/drupal-8.8.5.tar.gz
tar xzvf drupal*
cd drupal-8.8.5
sudo rsync -avz . /var/www/html
cd /var/www/html
mkdir /var/www/html/sites/default/files
cp /var/www/html/sites/default/default.settings.php /var/www/html/sites/default/settings.php
chmod 664 /var/www/html/sites/default/settings.php
sudo chown -R :www-data /var/www/html/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment