rm 命令未被权限拒绝执行
rm command is not execed by Permission denied
在我的部署脚本中 deploy.rb
lock "3.11.0"
set :application, "myapp"
set :repo_url, "ssh://app@git.whitebear.com/home/app/myGit/myapp.git"
set :branch, 'master'
set :deploy_to, "/var/www/html/myapp"
#set :linked_files, %w{app/config/parameters.yml}
set :linked_dirs, %w{log vendor var node_modules public/build public/dlstore config/spool}
#somehow app/cache doesn't work...
set :format, :pretty
set :log_level, :debug
set :keep_releases, 3
after 'deploy:starting', 'composer:install_executable'
set :yarn_flags, "--prefer-offline --production --no-progress"
set :yarn_roles, :app
在production.rb
set :stage, :prod
set :symfony_env, "prod"
set :webserver_user, "app"
#set :controllers_to_clear, ["app_*.php"]
set :composer_install_flags, '--prefer-dist --no-interaction --optimize-autoloader'
server 'myapp.com', user: 'app', port: 22, roles: %w{app db web} # edit IP / Port and SSH user of your production server
SSHKit.config.command_map[:composer] = "php #{shared_path.join("composer.phar")}"
我设置了keep_releases3,但是当我部署时我遇到了权限问题。
虽然我不知道为什么 Aapache 更改了权限,
是否可以在部署时强行执行rm
??
DEBUG [cd2bf6b1] cannot remove `/var/www/html/myApp/releases/20190212120003/var/cache/prod/pools/VQruNbwKF0/X/3/tCcgRMw5TEmYO-kHpJ0t'
DEBUG [cd2bf6b1] : Permission denied
这是一个常见问题,由错误的用户配置或部署不当造成运行。您尝试使用用户 x 执行脚本,该文件的权限属于 www-data 并且您的用户 x 无法删除它,您将收到此错误。您的用户必须有权删除该文件。执行脚本的用户与执行网络请求的用户不同。
在我的部署脚本中 deploy.rb
lock "3.11.0"
set :application, "myapp"
set :repo_url, "ssh://app@git.whitebear.com/home/app/myGit/myapp.git"
set :branch, 'master'
set :deploy_to, "/var/www/html/myapp"
#set :linked_files, %w{app/config/parameters.yml}
set :linked_dirs, %w{log vendor var node_modules public/build public/dlstore config/spool}
#somehow app/cache doesn't work...
set :format, :pretty
set :log_level, :debug
set :keep_releases, 3
after 'deploy:starting', 'composer:install_executable'
set :yarn_flags, "--prefer-offline --production --no-progress"
set :yarn_roles, :app
在production.rb
set :stage, :prod
set :symfony_env, "prod"
set :webserver_user, "app"
#set :controllers_to_clear, ["app_*.php"]
set :composer_install_flags, '--prefer-dist --no-interaction --optimize-autoloader'
server 'myapp.com', user: 'app', port: 22, roles: %w{app db web} # edit IP / Port and SSH user of your production server
SSHKit.config.command_map[:composer] = "php #{shared_path.join("composer.phar")}"
我设置了keep_releases3,但是当我部署时我遇到了权限问题。
虽然我不知道为什么 Aapache 更改了权限,
是否可以在部署时强行执行rm
??
DEBUG [cd2bf6b1] cannot remove `/var/www/html/myApp/releases/20190212120003/var/cache/prod/pools/VQruNbwKF0/X/3/tCcgRMw5TEmYO-kHpJ0t'
DEBUG [cd2bf6b1] : Permission denied
这是一个常见问题,由错误的用户配置或部署不当造成运行。您尝试使用用户 x 执行脚本,该文件的权限属于 www-data 并且您的用户 x 无法删除它,您将收到此错误。您的用户必须有权删除该文件。执行脚本的用户与执行网络请求的用户不同。