K
K
KoMPoTuK2014-03-17 18:09:08
PHP
KoMPoTuK, 2014-03-17 18:09:08

How to specify Apache VirtualHost owner?

Good day.
There is a Debian squeeze server on hetzner.
It costs LAMP (Linux + Apache + MySQL + PHP)
Created the user `petya`
Created a directory `petya` for it in the home folder
Uploaded the site, folders and files there, defined the group and user `petya`
When launching the site, PHP swears that it does not have rights to directories and files.
How to add user `petya` to this virtual host or directory?
/home/petya/domain.ru/docs

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vlad Zhivotnev, 2014-03-17
@KoMPoTuK

If you have apache without mpm-itk, then apache will run as www-data user.
In order for the threads serving your site to work as the user petya, you need to do this:
And add the following line to the virtual host config:
Or just give the www-data user rights to read:

chmod -R 644 /home/petya/domain.ru/docs
find /home/petya/domain.ru/docs -type d -exec chmod 755 {} \;  -print

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question