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.
Thank you 🙂
While runnning the command "php composer.phar install " I am getting errors.Please help asap
Awesome tutorial
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
hi i have muliple laravel project how to create virtual host
Is this still valid?
nowadays you can use elastic beanstalk
THANK YOU THANK YOU THANK YOU
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
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
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.
Does this still work on Laravel 5.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.
Right to the point!!
Thanks for the great tutorial! 4 years later it's still helpful! 🙂 (I had to modify some commands to use php 7 )
Great! Thank you!
Great help for me.
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.
I found what I needed, thank you !!!
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.
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
why wouldn't you update apt-get prior to using it to install apache?
One of the most useful and practical videos, amazing walk through… thank you!
this is my second time i used this video , thanks again 🙂
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
I'm running into errors when I install composer, is there a new version of depolying laravel onto an aws server tutorial?
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.
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.. 🙁
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/
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 )
Thanks .. It was exactly what i was looking for!!!
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.
need utorial for 14.4 ubantu , can u guide
Does this work with Laravel 5. I have not had any luck.
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.
Where can I find that wallpaper?
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?
Great tutorial! Thanks a lot from Costa Rica (Y)
Thanks man!, awesome video.
Thank you so much!
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!