Laravel - Access For Devices on Local Network - laravel

I've developed a web-application and I'm having trouble hosting it through a server, in order to give access to other users connected over the Local Network.
WINDOWS SERVER 2012
LARAVEL
PHP 7.2
NODE
MYSQL
When running the web application over localhost with the following command all files load correctly. (CSS, images etc..)
php artisan serve
However, when I've tried running the application over my ip address, no files load correctly and console logs the following errors for APIs net::ERR_CONNECTION_CLOSED
php artisan serve --host='my-ip' --port=8080
Command Prompt shows following error
Error Invalid request (Unsupported SSL request)
Testing was through Chrome Web Browser.
Any help would be greatly appreciated!
Have a good day :)

Related

Laravel 9 on IIS returns 500 server error when "php artisan serve" on same server works

I am trying to deploy a Laravel 9 site onto an IIS Server (and no, I don't have the option of using a Linux server). If I run the local server setup with "php artisan serve", it works fine through 127.0.0.1 on the server, including all calls to the database.
However, if I try to run the site through the IIS server via its domain name, I get a 500 server error. Failed Response Tracing shows a FASTCGI_UNKNOWN_ERROR: "The directory name is invalid. (0x8007010b)"
The DNS is functioning properly as I have tested a phpinfo page on it.
Is there a configuration in IIS I need to set in order for the Laravel site to work?
The problem is not clear, but try to point IIS directly to public folder of Laravel, like this:
Hope this helps!
It turned out I didn't have my php-cgi.exe file mapped accurately in IIS. I had to edit my Handler Mappings and link the FastCgiModule handler to my current installment of PHP, mapping it to the php-cgi.exe file.

laravel production in windows server

im new in laravel and i have done my first project, I have xampp,mysql and windows server 2012 (installed with composer and laravel 7). i'm running the application in server via command below
php artisan serve --host=[ip] --port=[port]
application is running fine within the network. However, it seems super slow. I'm not sure if this the correct way of deploying it into production. Do you have any recommendation/instructions where can i run/deploy apps within the resource that I have.
Speed of your laravel project depends on many parameters like hardware config (CPU,RAM,...) and also number of users and level of requests and processes. But consider that for an app in production it's better to not use php artisan serve command. It's only for development environment. I don't that how much you know about linux but I suggest you to change your stack and use linux as your production os with nginx as web server alongside php-fpm for running your app in production. But for now you should config xmapp's apache web server to run your application from project's public folder. Here is a link you can use: https://insidert.medium.com/setting-up-laravel-project-on-windows-2aa7e4f080da
good luck

How to solve google chrome "Failed to load resource: net::ERR_CONNECTION_REFUSED" issue in windows 10 when server is running on Ubuntu 18.04?

I am trying to run this project on Ubuntu 18.04 server. I am running both server and client on this machine. Then from windows 10 with port 9000 I am getting access to client in my chrome browser at http://localhost:8000/#/
The browser loads the project but the problem is I can't log into the website with trusted account and some other data do not get loaded . When I see browser console I see an error message saying:
Failed to load resource: net::ERR_CONNECTION_REFUSED
This is the server setting:
This is the client setting and putty setting to connect to client.
VPN has been used to connect to server via PuTTY.
The error message in browser:
Could anyone shed some light on this issue? Is it related to windows 10 or VPN or some other issues? I followed some steps from here https://www.ionos.com/digitalguide/hosting/technical-matters/err-connection-reset/
By default, the Flask development environment uses 127.0.0.1 (localhost), which restricts access to processes on the same host (except for VMs/containers, which aren't a factor here).
To access Flask from outside of localhost (e.g., from your Windows 10 machine), use the IP address 0.0.0.0. (You can pass it to run(), or via a command line option of the flask command.
However, do note the warnings about (not) using the development environment for production use.

POSTMAN Error - Could not get any response

I have a VPS Server where I installed Laravel-5.8 for the backend. Also, I installed XAMPP and made the Laravel Application to be on Port 8888. The VPS server is 10.10.10.7(not the real IP). On the VPS server, I tried to test using POSTMAN:
http://10.10.10.7:8888/backend/api/login
http://localhost:8888/backend/api/login
Both work perfectly on the server. However, when I tried to test using POSTMAN from an external system with:
http://10.10.10.7:8888/backend/api/login
I got this error:
How do I resolve it?

Access PhpStorm web server (Laravel) via LAN

I have a Laravel Project that I develop in PhpStorm. I use the build in PhpStorm web server for development and debugging. (localhost:8000) Now I need to be able to access that server from another device within the same network.
Google search and jetbrains.com have not been very helpful. I have tried this (https://intellij-support.jetbrains.com/hc/en-us/community/posts/207020155-phpstorm-and-http-server-localhost-only-) but it did not work.
Any help?
EDIT:
I found the problem. Since the web server is launched via artisan, it ignores my PhpStorm settings. I needed to change the launch parameter, like so:
php artisan serve --host=0.0.0.0 --port=8000

Resources