When I did bundle exec cap production deploy
, i got error messages like mkdir: cannot create directory /usr/share/nginx/www/appname/releases/20131216155457: Permission denied
Capistrano3 doesn't have set use_sudo
and default_run_options
. I read that Passwordless sudo is better, so I did visudo username ALL=NOPASSWD:ALL
, but still I got the same errors.
set :application, 'appname.com'
set :repo_url, '[email protected]:user/myapp.git'
set :user, 'username'
set :branch, 'master'
set :deploy_to, '/usr/share/nginx/www/appname'
set :keep_releases, 5
namespace :deploy do
desc 'Restart application'
task :restart do
on roles(:app), in: :sequence, wait: 5 do
end
end
after :restart, :clear_cache do
on roles(:web), in: :groups, limit: 3, wait: 10 do
end
end
after :finishing, 'deploy:cleanup'
end
Does anyone give me any advice around this problem? Thank you for your help.
[ErrorException] mkdir(): Permission denied Create a new folder, say 'myproject and run sudo chmod 777 myproject . Then move to 'myproject' folder and create project. To solve this problem, go into your laravel project, make your public directory writable.
Resolving The Problem Simply log in as super user “su” and use “chmod 777” to set the directory permissions of where you wish the rational directory to be created. Once done, you can re-enter the original directory again and the install will continue using the same directory.
If you receive an error telling you that you do not have permissions to create a directory or to write a file to a directory, this is likely an indication that your script is attempting to write to a directory that you do not own.
mkdir: cannot create directory – Permission denied The reason for this error is that the user you're running the mkdir as, doesn't have permissions to create new directory in the location you specified. You should use ls command on the higher level directory to confirm permissions.
Try setting the group and owner of the appname
folder
chown deployer:www-data -R /usr/share/nginx/www/appname
where deployer is your deploy user and group is the user group
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With