我是流浪者新手,无法正常工作。它在端口转发方面运行良好,我可以访问它。然而,我无法让 Bower 和 gulp 正常工作。
该问题似乎源于 www-data/www-data 拥有的 /var/www 目录。即使将 vagrant 添加到 www-data 组后,vagrant 用户也没有任何目录的写入权限。我什至无法使用sudo chmod
为任何文件添加写权限。
每当我尝试运行 Bower、gulp 甚至 git 时,我都不会收到访问权限被拒绝的错误。
任何帮助将不胜感激。
流浪者文件:
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "hashicorp/precise32"
config.vm.network :forwarded_port, guest: 80, host: 8080, auto_correct: true
config.ssh.private_key_path = ['~/.vagrant.d/insecure_private_key', '~/.ssh/id_rsa.pub']
config.ssh.forward_agent = true
config.vm.synced_folder "/home/develop/b3c-dev", "/var/www", create: true, group: "vagrant", owner: "www-data"
config.vm.synced_folder "/home/vagrant/b3c_ee/provision", "/var/provision", create: true, group: "root", owner: "root"
config.vm.provider "virtualbox" do |v|
v.name = "B3C Expression Engine Dev Vagrant"
v.customize ["modifyvm", :id, "--memory", "1024"]
end
config.vm.provision "shell", path: "provision/setup.sh"
end
Nginx 配置:
server {
listen 80;
server_name test.dev www.test.dev;
root /var/www/public/;
index index.php index.html;
access_log /var/log/nginx/b3c-dev-access.log;
error_log /var/log/nginx/b3c-dev-error.log info;
# Important for VirtualBox
# sendfile off;
location / {
index index.php;
try_files $uri $uri/ @ee;
}
location @ee {
rewrite ^(.*) /index.php?$1 last;
}
location ~* \.php {
include fastcgi_params;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_cache off;
fastcgi_index index.php;
}
}