I have a server running apache which has as document root /var/www/html/
. Apache runs as apache:apache
.
This server is filled with content which is scp'ed programmatically from another server which uses a different user to login via ssh than apache, say user1
.
The resulting structure is like this:
drwxr-x--- 2 user1 user1 22 23 jun 16.50 .
drwxrwxr-x 3 apache apache 16 23 jun 16.50 .. <- this is /var/www/html/
-rwxr-x--- 1 user1 user1 6077 23 jun 16.50 myfile.txt
I have tried to add apache
to group user1
and user1
to group apache
, but to no avail. Apache refuses to serve myfile.txt.
$ whoami
user1
$ groups
user1 wheel apache
$ whoami
apache
$ groups
apache user1
How can I solve this without changing the user which is used to run apache or login via ssh? I'm looking for a solution which doesn't rely on existing folders, which could be destroyed and recreated by the scp.
EDIT: CentOS7 running Apache 2.4.6
Thanks!