Trying to host a laravel 5.7 app in AWS EC2 - laravel

So...i'm pretty new in hosting websites and horst yet with hosting in cloud services. I'm having a pretty bad time trying to host a Laravel 5.7 application in AWS and i really need some help/direction.
My situation is like this:
I have a normal Laravel 5.7 app that uses MySQL database and Laravel Queue(database type).
I need a process to constantly listen/monitor the job queue and execute them.
The thing is, i just lerned that you can't use normal hosting to do this(listen the job queue) and that i need a VPS service.
In my searches i saw that AWS have a 1 year free trial and i thought it was worth to take a look. The thing is, i started from EC2 and got as far as installing apache, mysql, php, git, etc. I made a clone of my project to the /etc/www/html and install composer dependencies... but i'm not quite understaing what to do for the app run, and in looking for tutorials everything is always differet and nothing ever works. I dont know what else to do, this is my first contact with cloud services.
That said, my question is what can i do to host my Laravel 5.7 app in amazon, and is it really the better solution for my problem ?

I am currently doing what you're trying to do. The configuration is outlined here. You will need to install supervisord. You didn't leave enough information about what type of instance you're running, so I can't get you more complete instructions, but if you follow these steps, your queue should run as expected.

Related

Question about deploying a Shopify app to Heroku

I have question about Shopify app development and the deployment process.
I've used the getting started guide here, and I have an app that works fine when I use npm run dev and view the app in the store admin.
However, of course, once I stop the server from running, the app is no longer accessible.
I believe I need to deploy the app to Heroku (or something similar) in order to have it work in a non-development environment.
It doesn't seem like there is much guidance online from Shopify about the best way to go about this.
Does anyone know what steps I need to take in order to deploy my app to Heroku, so that I can use the app in by test store on another device?
It seems like every guide online stops JUST BEFORE explaining this process and I can't figure out why! I have tried everything online but nothing has worked:
Adding the code to Github and connecting it to Heroku
Using Docker
Any help is appreciated. Thank you!
You have zero obligations to use Heroku. If you have an IP address dedicated to your house, you could host the App using your house. If you co-locate your own server at an Internet business, and they give you IP addresses you can use that. If you wanted to use Amazon directly, you could use EC2. If you wanted to use Linode, or Azure, or any other cloud service, feel free! It is up to you!
Using Heroku (built on AWS) is traditional only in the sense that it is the original easy peasy hosting in the cloud service. Play with Heroku by reading Heroku-specific documentation or hosting information. This has nothing to do with Shopify. Shopify only mentions Heroku because traditionally, developers used it. No other reason.
If you want to learn how to use Heroku, 100% there are blog posts within easy reach for you to study and learn from.

Heroku alternative

I´m new on development and found Heroku easy for deploying my app.
I was happy until I got to problems:
Heroku does not provide an IP adress which I need for a white IP list to access an API. I fixed this with a Heroku add-on proxy called Fixie. That is free if under 500 request per month.
The Heroku free plan sleeps after 30 min of inactivity. My app needs to makes API requests at midnight and this is getting difficult because the app is sleeping.
I was thinking to pay the nearest cheap plan on Heroku which make that the app does not sleep. But then I though why not use another platfrom than Heroku.
Does anyone have some sugestions? Any other platform that give an IP so I don´t worry about crossing the 500 request per month?
I was thinking of AWS Elastic Beanstalk. But as I said I´m new at this.
You can use DigitalOcean: the cheapest plan is 5$ a month and you get a Droplet with its own IP address. The Droplet is always running (no inactivity timeout like Heroku).
The main difference is Heroku provides an abstraction layer on top of the underlying infrastructure (you only deal with the application deployment and management) while DigitalOcean delivers a virtual box (ie Ubuntu), however the documentation is great and you can easily find what you need (ie install Docker, etc..)
Couldn’t agree more.
I have been running many applications on Heroku for years now and have faced the 1st problem that you’ve mentioned multiple times.
I tried using Engine Yard instead of Heroku as far as I can remember I never faced the IP issue that you are referring to. AWS is good, but again it’s not without its limitations because its really hard to use. It’s these shortcomings that drive users crazy, isn't it? All I can say is that when I shifted to Engine Yard the set problems I faced considerably dropped. It appears to be a much more usable platform. Check it out.
Here’s a link to Engine Yard, which I hope will help you.

How can I install Redis in shared hosting

I'm working on a Laravel project and I'm using Redis for caching and stuff like that, everything is fine when I'm developing it but what should I do when I deploy the project, what are the requirements to run Redis on a host.
And do the shared hosting provide me the access to Redis? I think not, I read a lot about no supporting for Redis in shared hosting, so what should I do, is there an alternative way to run Redis? or is there a shared hosting supports it, please mention it.
Any recommendations, please :(
I got one of my questions here which is, how to keep the server running forever without running it from the Terminal.
How to keep redis server running
You need to ask the provider if they support Redis.
Redis is a software that needs to be installed on the web server or any server your web server has access to. It is not possible to install this yourself on a shared hosting.
You cannot install redis by yourself. You need to ask to your hosting company if they provide redis. You might need to pay extra for that. But, It would be a rare instance if hosting company provides redis by default on shared hosting. If you want good hosting service, I would recomment digitalocean.com. They provide servers at affordable rates

How should i choose my hosting service for Laravel Apps?

I have my Laravel 5 app hosted on a shared hosting service. From the beginning i saw that was a bad idea, but i didn't knew more and i leaved it that way.
Now, i need a new hosting service that can give me SSH access for using git, jenkins, run laravel commands and a good speed.(I live in est Europe).
I've made some research i found 3 hosting services: Amazon, A2hosting and Siteground.
Because i'm not a very experimented developer and my app is not that big (and i don't think it will be in the next 1-2 years) , i think choosing Amazon's services will be an overhead.Plus that, i think it will be pretty expensive.
So, what should i choose between those 3 options?
Or do you have a better idea?
If you app is not that big AWS is a great option for you. They have free tier where I am running my instance with Laravel App. Its not as expensive as it looks.
Check their calculator if you want more than free tier which is explained here https://aws.amazon.com/free/.
Calculator: https://calculator.s3.amazonaws.com/index.html

Hosting a Laravel App on a Virtual Server

Forgive me if this would have been better placed somewhere else on the stackexchange network but I have seen a few Laravel questions being asked here so thought it would be OK.
Anyways...
I have a Laravel app which I want to get online and found some hosting here: https://www.server4you.net/virtual-server
The pricing is really good and there is root / SSH access. As I dont know if my web app will be a financial success I dont wanna go all out on a dedicated server but also don't mind migrating it at a later date (I know this will be a pain!)
I have seen a few people online recommend against using a VPS / shared server for a laravel app...my question is why?
If the servers can perform as advertised then this should be good?
I have never bought a vps or uploaded my own Laravel project to a server before so I feel like I should ask these questions now before I realise I have shot myself in the foot somehow way down the line...
Cheers!

Resources