Laravel - Deploy app on Heroku - laravel

I am trying to deploy laravel application on heroku. I followed the videos on heroku homepage for deploying a php application. I currently get a 403 error, You don't have permission to access / on this server. How can I change the app permissions in order to run it correctly?
Also how can I access the app from the terminal to apply any changes if possible?

Long time since I use Heroku, but the documentation has what you need. You are getting a 403 because it is likely you are not setting the web root. By default the web root is / which is restricted. In Laravel you need it to be /public
Add a Procfile to the root of your Laravel project and add the following line to it:
web: vendor/bin/heroku-php-apache2 public/
The second part of your question can be achieved by running heroku run bash from the terminal. You may need to specify your app name. However it should be mentioned that its likely your changes would be over written next time you deploy your app.

Related

Django REST + Vue3 deployment with Passenger

I have a local app with a Django backend and Vue3 frontend, and I have to deploy it to a Dreamhost Shared Host. I've already deployed the backend with Django and Passenger and it's working (the admin panel and its API is working), but now I need to add the frontend side to the server.
I've followed the instructions to deploy a Vue app, generating the dist folder with npm run build and then adding it to my public folder in the server, but nothing happens. I can't find any tutorial or anyone trying to build something similar, so any help to understand what I should have to do is welcomed.

Why am I getting broken access to layouts.app (for lavravel app) on heroku hosting but not on localhost?

I am a student and have created my first Laravel App (A blog app). I have a layout/master view created named app.blade.php in resources/views/layouts folder.
I am using laravel 5.6.
It works perfectly on localhost but not on heroku hosting.
Here is my project structure
Here is my code in home.blade.php
Heroku hosting error screen below
Localhost view
clueless about this problem. I need your support.
EDIT
I solved the problem. I am on a windows system while hosting on a linux platform. So my sweet innocent windows was not updating the "Layouts" on server with "layouts".
But I am with another problem
Regards,
Arpan
but loading /login /register correctly
Now this doesn't end here,
when I type /login with the url it gives me
Now I observe that when i click the link it shows me Not secure connection and displays properly but when typing there is https but not displayed correctly.
Please help me analyse and figure out the issue.
Github repo link : https://github.com/ArpanKIIT2017/blog4b/
Its because the app was unable to find the file. But everything looks good. can you check if the file exists on remote server.
what are you using to push the files to remote server?.
try running
php artisan view:clear
on both local and heroku
Actually Heroku doesn't support SSL in free tier. So https actually won't work.
Finnaly migrated my app to postgre sql.
Problem mainly was due to the uppercase and lowercase representation of "Layouts".
So my app is Up and Running only with one problem that is heroku doesn't support file uploads. It is not storing any file upload. Searching solution for that but not related to this post.
Thank You

Deploy ember-cli and rails api

I'm looking for a way to deploy on Heroku a Rails API and an ember-cli application. My directories structure is something like that:
application
frontend
rails-api
Can someone help me? I'm really new Heroku user.
PS: I don't want to use gems like 'ember-cli-rails'
I would deploy them separately, and keep them in separate git repos.
Ember
Use ember-cli-deploy. I would suggest you look into the ember-cli-deploy-lightning-pack. There is a presentation about it here.
This automates the release process -
Builds your Ember app, with asset fingerprints
gzips the assets
Uploads changed files to AWS S3
Puts the full content of your index.html into Redis
Rails
deploy your rails-api app to heroku normally
include a redis addon
set up the route which serves index.html to query it directly from Redis instead
I would suggest aliasing all non-api routes (ie a catchall route) to the root route so you can 'deep link' to your ember app
A big advantage of this process is that you can deploy changes to your frontend very quickly, and without having to take down or restart the server.

Set up multiple laravel apps on nginx server

I want to create a config file on my nginx vps to handle 2 laravel apps. I don’t own any domain name.
What I want is:
http://my_ip/app1 will resolve to the first app
http://my_ip/app2 will resolve to the second app
and if anyone tries to access the root http://my_ip/ to show a 503 or a custom html file.

How do I use Heroku to host a personal website?

I want to use Heroku to host a website that has HTML, CSS and JS files, along with some jpegs and gifs.
I know how to do this with a Rails application, using;
heroku create --stack cedar
It seems that the cedar stack create a repo that is fit for Rails, Java ect apps because the error message is
Heroku push rejected, no Cedar-supported app detected
And when I try to launch the app it just say; Heroku | Welcome to your new app!
Here is a link: http://afternoon-brook-2543.herokuapp.com/
So I want to know how to put some JS, HTML, CSS and images files to host. Perhaps another command may create a simple website stack?
If you saved your root file as index.php then Heroku will detect it as a PHP application - it doesn't need to actually contain PHP code, just been named that.
If you want to send a personal website into Heroku, create an index.php file connected to your website. Launch the app as it was a PHP app. You will be able to launch the app with ease!
Hope this helped!

Resources