Forum Moderators: phranque

Message Too Old, No Replies

virtual servers

         

kristof_v

9:00 am on Dec 5, 2006 (gmt 0)

10+ Year Member



hi
i'm running an apache2 server.
in apache2.conf i set the server to run as user and group www-data:

User www-data
Group www-data

this is the content of the only sites-available file (sites-available/kristof):

fileserver:~# cat /etc/apache2/sites-available/kristof
<VirtualHost *>
DocumentRoot /data
ServerAdmin me@gmail.com
ErrorLog /var/log/apache2/error_kristof.log
</VirtualHost>

for authentication on the web server i use basic authentcation:

#Basic Authentication
<Directory "/data">
AuthType Basic
AuthName "Fileserver N`Kr1pt"
AuthUserFile /etc/apache2/users.passwd
Require valid-user
</Directory>

in users.passwd there are 2 users specified

now this works great.
the 2 users can login to the webserver en view all content because everything under /data is 755.
everything under /data is owned by user kristof and group root

but i want to take it a little further, for example when kristof logs in to the webserver i want him to view everything that is viewable for him.
so everything that is chmodded 700 for user kristof.

the files are already chmodded 700 for kristof atm but they don't show up because the server runs as user ww-data offcourse and not as user kristof.

is it possible to achieve this without running another apache server?

can you also provide a small example of the config fils that need to be edited if possible?

grtz

phranque

9:17 am on Dec 5, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



the users in /etc/apache2/users.passwd are completely unrelated to the users that "own" nodes (files&directories).

i think the only way you can do this is to put all the kristof-owned/700-chmodded files in a /data_kristof directory and provide directory level access to kristof-only (and maybe the other user if it applies).

regardless - they must be web readable so the chmod 700 and/or group ownership will have to change for this to ultimately work.

kristof_v

10:37 am on Dec 5, 2006 (gmt 0)

10+ Year Member



hi

i'm not quite following you with this:

... and provide directory level access to kristof-only (and maybe the other user if it applies)

do you have to do that in sites-available or something?