New git repository inside client0/web7 directory

Discussion in 'Installation/Configuration' started by sza, Oct 25, 2016.

  1. sza

    sza Member

    Hi,
    I want to create a new git repository on my production server, inside the webX directory.
    When I log in as root user and write "git init" I get a permission denied error.

    How can I create a new repo in this dir?

    Thank you.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    This directory is not writable, If you want to create a git repo, then use the private folder.
     
  3. sza

    sza Member

    I have files both in "private" directory and inside "web" directory which are part of the same project.
    How can I use git to update them all from the repository if I can't create a local git repo inside the main "web7" directory on the server?
     
  4. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

  5. sza

    sza Member

    Thank you Jesse,
    But all those solutions are work arounds.
    The most healthy way is to create the git repo on it's directory. That's the way git usually works, and I'm afraid of having problems in the future due to this change in such a basic thing.
    I'll be glad to know if there is a way for me to change that specific directory jail and add a new directory that will populate the git repo as it's normally should work?

    Thank you very much.
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    You can remove the folder protection of the web root folder (chattr -i) and then add your git repo there.
     
  7. sza

    sza Member

    Thank you Till,
    Do you mean the general /var/www/ folder?
    or inside /client0/web7/ folder?
    How can I reactivate the folder protection ?
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    chattr -i /var/www/clients/client0/web7

    But be aware that a client will be able to delete the whole web folder of his site then, if he does that then apache might not start anymore for all clients and the server will be down.
     
  9. sza

    sza Member

    Ok, it works perfect. Thank you!
    Can I now re-activate the folder protection manually?

    Thank you very much.
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    Yes:

    chattr +i /var/www/clients/client0/web7
     
  11. sza

    sza Member

    Thanks alot!
     

Share This Page