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.
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
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.
I can't continue with my project till this is working. Any help is very much appreciated!
step1step2 that might be because you:
Try running vagrant reload
. Give that a shot.
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
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.
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.
can you post the outputs of from your vm
cat /etc/nginx/sites-enabled/laravel.app
and
cat /etc/nginx/sites-enabled/boot.app
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?
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;
}
}
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.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community