Laravel Deployment on Ec2

You gotta have composer installed

cd /home/ec2-user/
sudo curl -sS https://getcomposer.org/installer | php
// sudo mv composer.phar /usr/local/bin/composer

cd /var/www/html/website-directory
// make vendor folder
sudo mkdir vendor
// change permissions
sudo chmod -R 755 vendor/
// change the entire directory's group 
sudo chown -R ec2-user:apache *
sudo chmod -R ug+rwx storage bootstrap/cache
composer install

Your vhost should look like this – be sure it is pointed to public directory

<VirtualHost *:80>
    DocumentRoot "/var/www/html/website-directory/public"
    ServerName website.com
    <Directory "/var/www/html/website-directory/public">
    </Directory>
</VirtualHost>

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *