V
V
Vincent12021-12-24 18:26:51
PHP
Vincent1, 2021-12-24 18:26:51

Why can't apache create folders/files?

Vestacp is installed on the first VPS and php+apache was installed along with it. Apache is running from www-data

APACHE_RUN_USER 	www-data
APACHE_RUN_GROUP 	www-data

On the second vps hestiacp. Installed php+apache too. Also from www-data
APACHE_RUN_USER 	www-data
APACHE_RUN_GROUP 	www-data

The problem is that on the first vps, files/folders in the user's directory are created without problems, and on the second vps, Apache cannot create either a folder or a file.
PHP Warning: mkdir(): Permission denied
He can write to a file only when you put 777 rights.

Part of the config of the first vps
<IfModule mod_ruid2.c>
        RMode config
        RUidGid ankor1 ankor1 
        RGroups www-data
    </IfModule>
    <IfModule itk.c>
        AssignUserID ankor1 ankor1 
    </IfModule>

Part two
<IfModule mod_ruid2.c>
        RMode config
        RUidGid ankor2 ankor2 
        RGroups www-data
    </IfModule>
    <IfModule mpm_itk.c>
        AssignUserID ankor2 ankor2 
    </IfModule>

Where could be my mistake?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vincent1, 2021-12-24
@Vincent1

Everything turned out to be simple. The mpm_itk module was not installed.

# a2enmod mpm_itk
ERROR: Module mpm_itk does not exist!

Installation and activation
apt install libapache2-mpm-itk
a2enmod mpm_itk

K
ky0, 2021-12-24
@ky0

You show configs, but you need to show a directory in which you do not create - who owns it, what permissions, who is in what groups and all that.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question