title: capistrano 3 deploy:clean old releases permission error
body: <p>I am trying to deploy my Yii application using capistrino 3. Sever is EC2 ubuntu instance which by default comes with a user ubuntu. I have added ubuntu user to group www-data and trying to deploy using capistrino 3 but in old releases these runtime files creates some problem.</p>
  
  <pre><code>groups ubuntu
  ubuntu : ubuntu adm dialout cdrom floppy sudo audio dip www-data video plugdev netdev
  
  groups www-data
  www-data : www-data
  </code></pre>
  
  <p>Apache server has created some files/folder as</p>
  
  <pre><code>drwxr-sr-x 2 www-data ubuntu 4096 Oct 12 15:23 CSS
  drwxr-sr-x 2 www-data ubuntu 4096 Oct 12 15:17 HTML
  </code></pre>
  
  <p>When i tried to deploy the new version it says,</p>
  
  <pre><code>DEBUG[c9d0212b]     rm: cannot remove '/var/www/html/zl/releases/20141012145437/frontend/runtime/CSS/4.5.0,24166bfe16a0cc6bd18d813b83121ef2eaf16545,1.ser': Permission denied
  </code></pre>
  
  <p>What can be a workaround? I have added user ubuntu to group www-data, but new files have owner www-data and group ubuntu. i have no idea how it reversed.</p>