Register a domain with https://domains.google.com
Set-up an AWS https://aws.amazon.com/ account and spin-up an EC2 instance
Connect to the EC2 instance and configure a Drupal site on a LAMP stack with phpMyAdmin
ssh -i "********.pem" ec2-user@ec2-********.compute-1.amazonaws.com;
sudo yum update -y;
cat /etc/system-release;
sudo amazon-linux-extras list;
sudo yum install -y httpd;
sudo amazon-linux-extras install -y mariadb10.5 php8.0;
sudo systemctl start httpd;
sudo systemctl enable httpd;
sudo systemctl is-enabled httpd;
sudo usermod -a -G apache ec2-user;
sudo chown -R ec2-user:apache /var/www;
sudo chmod 2775 /var/www && find /var/www -type d -exec sudo chmod 2775 {} \;
find /var/www -type f -exec sudo chmod 0664 {} \;
echo "<?php phpinfo(); ?>" > /var/www/html/phpinfo.php;
sudo systemctl restart httpd;
rm /var/www/html/phpinfo.php;
sudo systemctl start mariadb;
sudo mysql_secure_installation;
sudo systemctl enable mariadb;
sudo yum install php-mbstring php-xml -y;
sudo systemctl restart httpd;
sudo systemctl restart php-fpm;
cd /var/www/html;
wget https://files.phpmyadmin.net/phpMyAdmin/5.1.1/phpMyAdmin-5.1.1-all-languages.tar.gz;
mkdir phpMyAdmin && tar -xvzf phpMyAdmin-5.1.1-all-languages.tar.gz -C phpMyAdmin --strip-components 1;
rm phpMyAdmin-5.1.1-all-languages.tar.gz ;
sudo yum install -y mod_ssl;
Allocate an Elastic IP to the AWS EC2 instance
Set-up DNS records on domains.google.com to point to Elastic IP
sudo wget -r --no-parent -A 'epel-release-*.rpm' https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/;
sudo rpm -Uvh dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-*.rpm;
sudo yum-config-manager --enable epel*;
sudo yum repolist all;
sudo vi /etc/httpd/conf/httpd.conf;
sudo systemctl restart httpd;
sudo yum install -y certbot;
sudo yum install -y python2-certbot-apache;
sudo systemctl restart httpd;
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');";
php -r "if (hash_file('sha384', 'composer-setup.php') === '906a84df04cea2aa72f40b5f787e49f22d4c2f19492ac310e8cba5b96ac8b64115ac402c8cd292b8a03482574915d1a8') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;";
php composer-setup.php;
php -r "unlink('composer-setup.php');";
sudo mv composer.phar /usr/local/bin/composer;
sudo yum install -y php-gd;
composer create-project drupal/recommended-project ********;
mysql -uroot -p -e "CREATE DATABASE ******** CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci";
mysql -uroot -p;
CREATE USER ********@localhost IDENTIFIED BY '********';
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES ON ********.* TO '********'@'localhost' IDENTIFIED BY '********';
FLUSH PRIVILEGES;
cp web/sites/default/default.settings.php web/sites/default/settings.php;
sudo systemctl restart httpd;
sudo systemctl restart php-fpm;
vendor/drush/drush/drush cr;