Answer the question
In order to leave comments, you need to log in
Setting up apache itk module for multiple users?
I configure on VPS apache for several users. But, Apache configs overlap each other, I can't figure out how to set up mpm-itk.
So, I created 2 sites. Their ways.
/var/www/html/iexample/example.com/index.html
/var/www/html/itest/test.com/index.html Disabled
the standard 000-default config.
Made two configs.
ServerName test.com
ServerAlias test.com
ServerAdmin [email protected]
DocumentRoot /var/www/html/itest
AssignUserId user1 user1
ServerName example.com
ServerAlias example.com
ServerAdmin [email protected]
DocumentRoot /var/www/html/iexample
AssignUserId user2 user2
Permissions for sites:
drwxrwx--- 3 user2 user2 4096 Jan 12 14:47 iexample/
drwxrwx--- 3 user1 user1 4096 Jan 12 14:46 itest/
Inside, for example, one of the sites example.com:
-rwxr- x--- 1 user1 user1 1388 Jan 12 13:39 id2.php*
-rwxrwx--- 1 user1 user1 160 Dec 29 12:44 index.html*
If you run one site config .conf, then access will be to it. If the other (separately), then another site. But I run both at once and one of the sites does not work. It turns out that this line AssignUserId user2 user2 when setting up mtk distributes rights to the entire apache, and not specifically to the site.
The apache user has already been added to the groups .. But one of the sites always works, the other does not, when both configs are enabled. Writes an error The requested URL /test.com/id2.php was not found on this server.
Those. he runs apache under a different user, i.e. Not every site has its own user.
# id user1
uid=1002(user1) gid=1002(user1) groups=1002(user1),33(www-data)
# id user2
uid=1001(user2) gid=1001(user2) groups=1001(user2), 33(www-data)
# id www-data
uid=33(www-data) gid=33(www-data) groups=33(www-data)
Thanks! Tell me what I'm doing wrong..
Answer the question
In order to leave comments, you need to log in
How to check?
Added to apache2.conf
VirtualHost *:80
ServerName default
/VirtualHost
include /etc/apache2/sites-available/test.com.conf
include /etc/apache2/sites-available/example.com.conf
Still the same..
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question