Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Apache Default page instead of Laravel Application

I am sure this is the kind of question that is annoying, but I am brand new to ubuntu and I am totally lost, hence I don’t know what to google for.

I have to deploy a laravel application on a Ubuntu 21.04 VM, I connect via SSH & a VPN to the VM (its from my university).

I installed the laravel application successfully and when I run php artisan serve it works, I get the message PHP 7.4.16 Development Server (http://127.0.0.1:8000) started

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

However, when I then enter the IP of the server in my browser I get the default apache webpage, when I enter the IP with port 8000 I get that the server is not responding.

I tried googling but I just don’t know what to google for, any help appreciated!

>Solution :

When you are running php artisan serve, that command is starting its own webserver. And based on the output you posted, it is listening only on 127.0.0.1:8000.

So accessing it outside of that machine is not allowed. Based on this question on Stack Overflow, you can override the default host with the --host parameter.

In your case you can run it like so:

php artisan serve --host=<IP_ADDRESS_OF_THE_VM>

or you can make it open to the world with

php artisan serve --host=0.0.0.0
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading