Cannot re-recrate phptmp directory

  • Hello all,
    my user somehow deleted the directory 'phptmp' from homedir.
    When I try to recreate it I get an error with no access, I remember somehow unlocking a directory with a user, but I do not remember how ... Can anyone remind me how it was done?


    Code
    1. mkdir phptmp
    2. mkdir: unable to create directory "phptmp": no access
  • @vzst


    There should be only one phptmp directory located at /var/www/virtual/<domain.tld>/phptmp.
    Normally, your customer cannot delete this directory because the /var/www/virtual/<domain.tld> directory is protected with immutable bit, unless you have explicitely disabled this feature (see below).


    So first please, be sure that you're talking about the /var/www/virtual/<domain.tld>/phptmp directory.


    Now the solution:


    Option 1
    Through the control panel, you can temporarely disable the protection by editing the domain properties as reseller (at bottom, there is an option for Web folder protection).


    Option 2
    You can process manually as follows:

    Shell-Script
    1. chattr -i /var/www/virtual/<domain.tld>
    2. mkdir /var/www/virtual/<domain.tld>/phptmp
    3. chown <vuxxx>:<vuxxx> /var/www/virtual/<domain.tld>/phptmp
    4. chmod 0750 /var/www/virtual/<domain.tld>/phptmp
    5. chattr +i /var/www/virtual/<domain.tld>

    In the commands above, don't forget to replace the <domain.tld> and <vuxxx> placeholders by your own values.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206