What is the use of "private" directory?


I would like to know the use of /home/user/web/domain.tld/private directory.

This might be a newb question because I am new to ubuntu.

I want to run multiple CodeIgniter4 sites and I keep the public files in the domain.tld/public_html directory and all the other files in the custom domain.tld/application outside of domain.tld/public_html.

In the past I used to write custom apache/mod_php template in /usr/local/hestia/data/templates/web/apache2 for codeignitor4 with domain.tld/application directory added in php_admin_value open_basedir value. But now I am using phpfpm and multiphp which means I’ll have to write custom templates for each php version and adddomain.tld/application in php_admin_value[open_basedir].

I have noticed that domain.tld/private directory already exists in all the templates in /usr/local/hestia/data/templates/web/php-fpm that’s why I wanted to know if domain.tld/private directory can be used safely for private php files?

Some CMS need certain folder structures and since a normal user can’t create folders, they have already been created for us.

1 Like

Yes private is there for used…

1 Like

I started moving my sites from other server and started using private directory for private files. But now I found some tmp directories in it. example: tmp.4rTTbHNilZ, tmp.Cb1FfJBX0O.

These directories contains certificates files like: domain.tld.ca, domain.tld.crt, domain.tld.key, domain.tld.pem

This makes me unsure to use private directory for my php application’s private files because it can mixup with my code files.

What do you think I should do?

Older version used /private/ folder to store self generated ssl files for lets encrypt but after ssl generation there is no need to save them any more. It has been resolved in 1.4.x version if I am right

@eris Thanks for the clarification. I am assuming it is safe to put files directly in the private directory. Still, which one do you think is better?

  1. Keeping private appication files in domain.tld/private
  2. Keeping private appication files in domain.tld/private/application

Another thing that I have noticed is that Owner/Group differs for both public_html and private directories.

For public_html it is user/www-data
For private it is user/user

Will this effect file and directory access/writing/reading for requests handled with php-fpm?

PHP-FPM run under user so Nginx / Apache2 is not able to access private folder how ever PHP-FPM is…

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.