Support the ongoing development of Laravel.io →
posted 10 years ago
Installation
Last updated 2 years ago.
0

I just did vagrant destroy and vagrant up. I got two directories now in the vagrant vm but name1.app and name2.app reference to name 2.

Meaning that name1.app:8000 and name2.app:8000 display the same project.

Last updated 2 years ago.
0

Hmm - not sure - looks ok to me although you don't really need the 2 folder mappings do you?

folders:
    - map: /Users/username/Desktop/code
      to: /home/vagrant

The above will give you access to both name* folders.

Here is my homestead.yaml achieving the same thing.

folders:
    - map: ~/Code
      to: /home/vagrant/Code

sites:
    - map: dropper.dev
      to:  /home/vagrant/Code/Dropper/public
    - map: queues.dev
      to:  /home/vagrant/Code/Console/public

I inline my hosts file but yours should work just as well.

127.0.0.1 dropper.dev queues.dev

Make sure you enforce provisioning of the nginx servers (saves you destroying the whole vm too)

vagrant provision

or

vagrant up --provision
Last updated 2 years ago.
0

OK I followed your idea and now I'm using only one directory to store different projects in it. However now I get 'No input file specified.' displayed when I visit one project in the browser.

Last updated 2 years ago.
0

I can't continue with my project till this is working. Any help is very much appreciated!

Last updated 2 years ago.
0

step1step2 that might be because you:

  1. Didn't run composer install yet.
  2. Haven't updated the folder path in the Homestead.yaml file.

Try running vagrant reload. Give that a shot.

Last updated 2 years ago.
0

You are wrong. Composer is installed and the Homestead.yaml file is set up.

This is my Homestead.yaml file:

authorize: /Users/username/.ssh/id_rsa.pub

keys:
    - /Users/username/.ssh/id_rsa

folders:
    - map: /Users/username/Desktop/code
      to: /home/vagrant/code

sites:
    - map: laravel.app
      to: /home/vagrant/larabook/public
    - map: boot.app
      to: /home/vagrant/testboot/public
variables:
    - key: APP_ENV
      value: local
Last updated 2 years ago.
0

Did you try running vagrant reload?

Last updated 2 years ago.
0

Yes.

Last updated 2 years ago.
0

Based on the above Homestead.yaml your site mappings are wrong. They should be

sites:
    - map: laravel.app
      to: /home/vagrant/code/larabook/public
    - map: boot.app
      to: /home/vagrant/code/testboot/public

Once updated remember to run

vagrant provision

to update the sites correctly.

Last updated 2 years ago.
0

There is no difference. Wtf? It is the same issue as before, I'm only using one shared folder now instead of two. I still got only access to one project, not two. /home/vagrant/code/larabook/public Doesn't exist.

Last updated 2 years ago.
0

can you post the outputs of from your vm

cat /etc/nginx/sites-enabled/laravel.app

and

cat /etc/nginx/sites-enabled/boot.app
Last updated 2 years ago.
0

step1step2 said: /home/vagrant/code/larabook/public Doesn't exist.

With the folder mapping you have you will have access to everything that is under /Users/username/Desktop/code - have you checked the files are correctly present on your host machine?

Last updated 2 years ago.
0
server {
    listen 80;
    server_name laravel.app;
    root /home/vagrant/code/larabook/public;

    index index.html index.htm index.php;

    charset utf-8;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    access_log off;
    error_log  /var/log/nginx/laravel.app-error.log error;

    error_page 404 /index.php;

    sendfile off;

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
    }

    location ~ /\.ht {
        deny all;
    }
}
server {
    listen 80;
    server_name boot.app;
    root /home/vagrant/code/testboot/public;

    index index.html index.htm index.php;

    charset utf-8;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    access_log off;
    error_log  /var/log/nginx/boot.app-error.log error;

    error_page 404 /index.php;

    sendfile off;

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
    }

    location ~ /\.ht {
        deny all;
    }
}
Last updated 2 years ago.
0

The problem is not solved yet. Right now I need to manually edit the Homestead.yaml file to switch to the other application which is annoying.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.