Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

marouanaf's avatar

Laravel on vultr

Hi,

I have a cloud hosting on vultr, I installed apache, php, node js, composer and cloned my app from my git repo then I run composer install and npm run production and all went well. this is my /var/www/ stracture :

/var/www/html

inside the html directory there is

 laravel app directory, html file, index.html file and index.save file

when I access my ip adress on the browser I keep seing the apache default page which I find logic as I did not cahnge that.

my question here is how to change that and point the ip adress to my laravel app index.php page?

also I want to let you know that I can access the app files in the url by accessing myip/my-app-name which is not safe and neither correct

so could you please give me some guidlines to what to do

thanks in advance

0 likes
2 replies
jamesyoung's avatar
Level 1

Please read https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-20-04 and go directly to step 3. Modify commands to suit if you aren't using a moden Ubuntu or Debian.

I suspect that you may need to install the Apache PHP module and configure a few details like the DocumentRoot setting. In your Laravel app folder, you will see a public/ folder. This is your document root. You will notice the .htaccess file in there.

So in your Apache config:

DocumentRoot /var/www/html/laravel_app_dir/public. You can set this in httpd.conf or follow the virtual host instructions given in the doc above.

If you follow the guide you should be fine. Good luck and let us know how it goes.

1 like
marouanaf's avatar

Hi @jamesyoung , thank you so much for your reply, yesterday and today I was playing with it a little bit and I actually figured out how this works, it's pretty much what you said, especially the DocumentRoot part, so thank you ;)

1 like

Please or to participate in this conversation.