Select Amazon Linux AMI 2018.03.0 (HVM), SSD Volume Type
Add rule of HTTP and HTTPS
Create new RDS database. Fill up the form and save.
After that navigate to Security Groups under Network & Security on the EC2 dashboard and click the Create Security Group button.
Create security group with a MYSQL/Aurora rule that opens port 3306 access. Select Anywhere as source, then click Create.
ssh -i <filename.pem> ec2-user@<public_ip>
sudo su
yum update -y
yum install httpd24 -y
yum install php72 php72-mysqlnd php72-imap php72-pecl-memcache php72-pecl-apcu php72-gd php72-mbstring -y
yum install mod24_ssl -y
service httpd start
Check by visiting to your public ip in the browser
chkconfig —add httpd
chkconfig httpd on
yum install git -y
Composer
yum install wget -y
wget https://getcomposer.org/composer.phar
Verify Composer
php composer.phar
Install Laravel (Optional)
php composer.phar global require laravel/installer
If has error PHP Composer update “cannot allocate memory” error
/bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
/sbin/mkswap /var/swap.1
/sbin/swapon /var/swap.1
cd /var/www/html
Clone
git clone <git_url>
Edit .htaccess
vim /var/www/html/laravel/public/.htaccess
Add RewriteBase / just below RewriteEngine On
Configure .env. Supply the database host, name, username and password base on the created rds database
mv .env.example .env
vim .env
Edit config /etc/httpd/conf/httpd.conf and add the following at the bottom of the file
Alias / /var/www/html/<project_folder_name>/public/
<Directory "/var/www/html/<project_folder_name>/public">
AllowOverride All
Order allow,deny
allow from all
</Directory>
Give write access to storage folder
sudo chmod -R 777 /var/www/html/laravel/storage
sudo chmod -R 777 /var/www/html/laravel/storage/logs
Restart Apache
service httpd restart
cd /var/www/html/laravel
Migrate
php artisan migrate
Thanks for such helpful tutorial bro. But I am not able to access other routes tham '/'. Kindly help