Set up multiple laravel apps on nginx server - laravel

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.

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.

How could i change domain name in ubuntu?

I got 2 domains but whenever i open one of those domain, the output is my laravel project. I only want one domain in accessing the project. How could I achieve that? Im using ubuntu server in my domains. Or if possible i want to redirect the second url to the first url whenever who visits it. Thanks.
PS: There is no ect/hostname in my server and i dont know why
Domains
http://digi.propnex.net = This is the only domain that I want
https://payment.propnex.net = This one has HTTPS and I want the other one to have this https
Screenshot

Why my configuration files are getting accessed from browser in laravel?

I have hosted my project on the server and my application is getting hacked, as of now I came to know my configuration files are no secured like .env, composer.json etc. These can be directly accessed by saying mydomain/filname e.g., www.abc.com/.env, when anybody hits url like this then file is opened on the browser. How can protect these files. I am using lravel 5.7
It seems you have multiple .htaccess files and your server isn't using the one that Laravel provides.

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 - Deploy app on Heroku

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.

Resources