How to host Laravel project on Raspberry Pi - laravel

I have scoured the depths of the internet for this solution and I come up empty handed. I have installed apache server on my pi and when I access the IP address from another computer, it pulls up the correct index.html page. So the server is working fine. My problem is that I can't get my Laravel app to work. When I deploy my laravel apps to other hosting sites, I put everything except the "public" folder into a separate folder in the file tree, and edit the index.php file in the public folder to match the new file structure of pointing to the autoload.php and bootstrap files. None of that is working for me in the apache server on the Pi. Can someone tell me how to do this or where there is legitimate documentation on how to do it. Please don't point me to any google articles that come up in the first 3 pages because i've read and tried them all.
The only thing that happens right now is that when i go to "IPaddress/project_folder" in the URL, it just brings up the file tree in the browser as opposed to pointing to my "/" route within the laravel project.

Related

Configuring Laravel project in DirectAdmin server

I'm a newbie to Laravel projects but I need to have one accessible over the internet so I tried using DirectAdmin but whenever I go to my domain I get an index (pictures attached).
I renamed the Laravel 'public' folder to 'public_html', is that correct? Here is my file structure.
Here is what I get when I go to my assigned domain which isn't my website at all.
The webpage should look something like this
I also found a laravel app using Softaculous linked here (https://panel.freehosting.com:2222/CMD_PLUGINS/softaculous/index.raw?act=software&soft=419). Am I required to use this app?
At first, you need to learn about the laravel directory structure. You don't need to change the laravel public folder to public_html. I am not sure how the DirectAdmin server works. but if you see a laravel directory instead of serving an application it's might be a path-related issue in your server. your domain should serve your application public folder.
I just found a tutorial for the DirectAdmin server with laravel. that might help.

Laravel XML sitemap, location, shared hosting

I've uploaded a Laravel app, to a shared hosting provider (I know it's not the best, but it's for a local charity and everything needed to be free) The hosting is actually not bad, they allow SSH and I've managed to get Composer and Artisan running through PuTTY.
I followed the steps, for shared hosting uploading a Laravel app,, everything is running fine, so far.
I've been trying to upload a sitemap, to Google, but I keep getting a not found error. I've had the file in the root, the public_html and the folder that contains the logic, in my case wmcc.
None of these seem to work. I've generated my sitemap, in Screaming Frog, although I have used a couple of online ones, too. I've set my robots.txt file, I'm just out of ideas, where to place the xml file, if anybody can point me in the right direction, please? thanks

Laravel Deployment Issue "No input file specified."

I'm having some major issues deploying a website I have built in Laravel which is a technology I am still learning.
I built the site on a temporary subdomain (new.example.com) on a brand new server. I have now come to deploy it so I removed the subdomain mapping in cPanel and changed the primary domain's document root to point Laravel's /public folder as described here.
This shows what I have done:
new.example.com - /public_html/mainsite/public
www.example.com - /public_html/mainsite/public
Now when I try to access www.example.com I get the error message:
No input file specified.
I saw this question but it doesn't seem to match what I have in my .htaccess file. I appear to have run out of talent to be able to fix this problem on my own and need help.
My questions are:
How can I resolve the error mentioned above?
Is there a better way to deploy Laravel sites to cPanel environments?
Have I created an XY problem for myself and I should be looking at something else to get this to work?

Laravel on my remote server isn't routing properly

I am a beginner with remote servers and building a website, so please bear with my simple questions, if they are.
So I have created a Laravel project on my remote server (by connecting to the command line via Putty and creating a new Laravel project). However it created a folder, so I had to move all of the directories inside of that folder into my main folder, via FileZilla. This is how it appears now:
Illustration of Uploaded files through Filezilla
My code in Laravel was the sample one which comes up whenever you create a new project, I did not change anything.
The only problem which is appearing, is when I visit my webpage, it says that my webpage is currently unable to handle this request (HTTP ERROR 500).
When I visit my webpage/public or any other sort of link, it gives me an error: NotFoundHttpException in RouteCollection.php line 161 (a Laravel error)
Any help or guidance in the right direction would be greatly appreciated.
I can't comment yet, so i have to answer here.
First what kind of server are you using? Shared or Vps? if it's a shared hosting, you have to do more than just upload the files, you'll need to configure ht access too. See this video for guide: https://youtu.be/wQMZld0Iroo
For the routing issue, it means, the route you are trying to visit does not exist. Check your web.php file to be sure the route is in there. This could be a simple spelling error.

Laravel on a directory, links e.g. login link does not work

I have uploaded my Laravel app unto a directory under the public folder on my domain,
html_docs/public/store
where 'store' is the folder of my Laravel App. My main domain pointed at 'html_docs/public', please check my laravel app here "https://www.dinhi.org/store/". As you can see, when you click the "sell with us" or "login" on the top header, it returns
Not Found
The requested URL /store/dashboard/login was not found on this server.
I have set up to in my '.env' and in my 'config/app.php' the right url like "https://www.dinhi.org/store/" but still not working, any ideas, help please?
PS: I'm on Laravel 5.3 and I'm using Hesto Multi Auth. In my local, this issue does not exist like everything is good and working.
Laravel is not meant to be installed completely into the document root of your server. Actually, every folder of your laravel application except the public folder should be inaccessible from the web.
Your exposing yourself to a security risk here, since everybody could access every file of your app, including potential .env files with database credentials and the likes.
Cheers
Christoph

Resources