AWS and Laravel - Installing Laravel on an Amazon EC2

AWS and Laravel – Installing Laravel on an Amazon EC2



Learn how easy it is to install laravel on an Amazon EC2 server. In this video I will walk you through the basics of setting up an EC2 server with Apache MySQL & PHP. Then we will go into a basic laravel installation.

41 thoughts on “AWS and Laravel – Installing Laravel on an Amazon EC2

  1. While runnning the command "php composer.phar install " I am getting errors.Please help asap

  2. Hi Tony, Really Good video but I am stuck at starting point.

    ls and other commands are not working. ls is not recognized as internal or external command.
    I am using window cmd

  3. This video is ancient however I give this 5 stars on the content and narration. As an old programmer getting ready to launch a site on aws, this gives great insight on the process. I'm sure some of the process has changed but the SSH and cmd inputs are invaluable. Cheers

  4. Great Video I would like to suggest to take a look at Cloudways laravel cloud. It makes the process of installing Laravel on AWS like a breeze.
    https://www.cloudways.com/en/laravel-hosting.php

  5. Nice Video! Thanks a lot. I have a question: on ec2 how do we define the mysql db space. Is the mysql database stored in EBS? Thus when creating ec2 instance we shall assign the db space in the EBS? Also if the ec2 instance crashes how can we backup the data ? Thanks a lot for your guidance.

  6. there is no need to make a laravel folder as the cloning process makes one and copies all files to it. Creating a a laravel folder and cd ing into it will make the laravel folder within another laravel folder meaning that the link in apache has to be different as well.

  7. Thanks for the great tutorial! 4 years later it's still helpful! 🙂 (I had to modify some commands to use php 7 )

  8. Hi Tony – This is a great video. Pls can you confirm if this can be done with AWS free tier. What DB have you used. Just that I am very new to AWS and will greatly appreciate all your help / advice here.

  9. Just a heads for anybody having trouble. I was stuck for a few days on this because my laravel app kept showing a white screen and i didn't know why.Finally, after running the files directly from the console, I found that a bunch of the permissions were set to read only or not readable at all. check your permissions folks.

  10. till the time i tried installing composer its went perfect then i tried command php composer.phar install and it says composer.json not found and i tried ls cmd it shows laravel dir then i tried cd laravel which has composer.json ,now i tried cmd php composer.phar install but now it says composer.phar not found coz its in dir /var/www/laravel/composer.phar and i am on /var/www/laravel/laravel…. kindly guide me what wrong am i doing? thanks in advance

  11. Hi. The video was very helpful, just want to know that I've my website and want to deploy in AWS and the url will be www.url.com so what are the changes I've to do for the url and how I can deploy my website from my system to server

  12. I'm running into errors when I install composer, is there a new version of depolying laravel onto an aws server tutorial?

  13. When I tried to connect it using Ubuntu 14.* instance and Laravel latest version by following the similar process. Doesn't work by only making chmod of storage directory to 777 I also have to make public directory permission to same. and run "php artisan key:generate" command as new versions of Laravel doesn't generating the key automatically at installation.

  14. newbie question here.. How will I be able to connect to my file/folders via FTP? Can I create a cpanel? sorry just new to ec2 stuff.. 🙁

  15. I wouldn't recommend anyone with no sysadmin experience to manually install application on Amazon EC2. Even with a tutorial as good as this one, installation and configuration on EC2 would be a really tiring and complicated process. Instead, I'd recommend you to use a managed hosting. Some managed hosting provides 1-click installation of application that rid you of heavy stuff. Here is an example of how easy it is to deploy on AWS. http://www.cloudways.com/blog/install-laravel-on-aws/

  16. as of jan 2016, this still works, i installed php 7, laravel 5.2. only difference is apache serve directory is /var/www/html NOT (/var/www). also no need to make folder called laravel before getting git clone. just go to /var/www/html directory and run git to get latest version of laravel.

    after that is done and point your virtual host to /var/www/html/laravel/public.
    and then when you visit your site root you should get blank page, that is because there are still some step needed. rename hidden file .env.example to .env, after that run php artisan key:generate, after that just follow tony's instruction to set correct permissions and you are good to go

    edit
    also storage directory in laravel 5 has been moved to root, its not inside app folder anymore. so when you set the permissions keep that in mind.

    also after everything works you will notice only home page route works other route doesn't work, thats because you need to do following two steps

    1) Enable mod_rewrite on the apache server: sudo a2enmod rewrite2) edit /etc/apache2/apache2.conf, changing the "AllowOverride" directive for the /var/www directory (which is my main document root): AllowOverride AllThen restart the Apache server: service apache2 restart(above two steps credit goes to andrew v. on stack overflow )

  17. I try yo install laravel 5 on ec2 amazon without result!

    when I restar apache with command "apachectl restart" it say

    apache2: Syntax error on line 140 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/mods-enabled/authz_default.load: Cannot load /usr/lib/apache2/modules/mod_authz_default.so into server: /usr/lib/apache2/modules/mod_authz_default.so: cannot open shared object file: No such file or directory
    Action 'restart' failed.
    The Apache error log may have more information.

  18. It's not recommended adding the ppa:ondrej repository to get the latest version of PHP for LTS 12.04. That repo is not supported and can cause conflicts in various areas of your web server. Ubuntu 12.04 does not support PHP 5.4, the correct way to get PHP 5.4+ is to upgrade to ubuntu 14.04.  In addition, running "sudo apt-get install lamp-server" is the recommended way to installing PHP, Apache and MySQL. 

  19. I just had a little issue… When uploading an small L4 app my routes are not working whatsoever…
    I thought I had to enable mod_rewrite, so I tried with "a2enmod rewrite", then restart the apache2.

    But still can get those routes to work… I am getting
    "
    Not Found
    The requested URL /sendUrl was not found on this server.
    "

    Any idea guys?

  20. Excellent tutorial! This is the first time I've used AWS and I don't know what I would have done without this. Thanks for saving me countless ours of googling!

Leave a Reply

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