skip to Main Content

I installed laravel via homestead, but when I go to localhost I get the apache2 welcome/success screen. I can’t get the Laravel welcome page to load up.

I ran vagrant up on the homestead box but there were no laravel files. So I installed it using composer create-project --prefer-dist laravel/laravel app.

Now when I go to localhost I get the apache2 welcome screen. If I put an index.html in /vagrant I can get that to load up by going to localhost:8000. But going to the same address without the index file causes a 403.

I’ve tried all combinations of URLs, /app, /app/app, /app/public, and I’ve tried changing the URL in the .env.

Weirdly, I can’t find this apache welcome file on the server. The page itself says “You should replace this file (located at /var/www/html/index.html)” If I SSH in and go to that folder, there is an nginx welcome html page there, but no apache one.

If I go to file:///var/www/html/ in the browser, I see the index.html of the apache welcome page. If I go to file:///var/ I see a few different folders there than I do by SSHing into the vagrant box. I don’t understand why.

How can I get the Laravel welcome page to appear?

edits:

http://localhost:8000/public returns “No input file specified”

Sites part of homestead.yaml

sites:
-
    map: homestead.test
    to: /home/w/work/qs/app/public

/etc/hosts:

127.0.0.1       localhost
127.0.1.1       qs      qs
192.168.10.10   homestead.test
# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
#### HOMESTEAD-SITES-BEGIN
# 127.0.0.1     homestead.test
#### HOMESTEAD-SITES-END

2

Answers


  1. As per documentation,

    you will still need to add an  /etc/hosts file entry for homestead.test or the domain of your choice if you are not using automatic 
    

    Add domain entry in your /etc/hosts file like:

    192.168.10.10  homestead.test
    

    And try brows http://homestead.test from browser

    Make sure the IP address listed is the one set in your Homestead.yaml

    Edited:
    It seems you may running some commands out of the root directory of the project.

    Here is the very short video to verify your steps.

    https://youtu.be/a9jtoXXp5ao

    All the best!

    Login or Signup to reply.
  2. You need to add hosts entries for each site and the mappings to your Homestead.yaml:

    /etc/hosts:

    192.168.10.10    homestead.test
    

    ~/Homestead/Homestead.yaml:

    sites:
        - map: homestead.test
          to: /home/vagrant/code/my-project/public
    

    Then still under ~/Homestead, run vagrant up --provision.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search