You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Tim Edwards <t....@tideway.com> on 2008/03/06 19:25:27 UTC
[users@httpd] how would I serve up an upload/download directory for each user
Hi,
I'm trying to use Apache to essentially replicate the functionality of
our FTP server (we've found a lot of customers have corporate
policies/firewalls stopping them accessing FTP but not http/s). The idea
is that each customer has a Linux user created for them and can login
with Apache setup to use mod_auth_shadow. However I want each user to
have a directory into which they can upload files, as well as download.
I can see a few possibilities:
* Use mod_userdir so each user has a https://servername.com/~username
site. My problem with this is that I'd have to give the apache user
rights to write to user's home directories to allow uploads, I'm not
sure if this is a good idea security-wise. However this server is
single-purpose - no one except administrators will be logging into it or
interacting with it in any way except through httpd.
* Use some kind of module that allows apache to spawn a sub-process
running as the user who logged in through mod_auth_shadow. Does such a
module exist?
* Give up on the idea of using user's home dirs and create a setup with
virtual hosts and a directory owned by the apache user. Eg. have all
user's files under /var/www/users/<username> and have a virtual host for
each /var/www/users/<username> dir. I'm not sure how to do this in any
automated fashion though - is there a way to coerce mod_userdir into
working like this?
Any help/suggestions greatly appreciated.
--
Tim Edwards
Re: [users@httpd] how would I serve up an upload/download directory for each user
Posted by "Ronald C.F.Antony" <rc...@cubiculum.com>.
This should IMO really make it into the standard distribution, maybe
even replace the webdav module. The main reason I don't use webdav is
that its privilege model is useless for all I'd ever want to do with
it (e.g. make user's home directory available to them as webdav mount
while they are on the road).
I'll have to check this out, sounds just about what I've been looking
for.
Ronald
On 8 Mar 2008, at 22:10, Michael Clark wrote:
> We have some patches against apache to do something similar to this
> using a modified mod_dav with a privilege separation mechanism similar
> to openssh. In this model, apache still runs as an unprivileged
> process
> and it sends privileged file-system requests overs a unix socket to a
> pre-spawned privileged monitor process. This means you get all the
> benefits of mod_dav but with the addition of unix authentication,
> permissions and quotas, etc.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
RE: [users@httpd] how would I serve up an upload/download directory for each user
Posted by Tim Edwards <t....@tideway.com>.
I ended up using a cgi script which provides a nice upload/download
interface (http://encodable.com/filechucker/) with suexec, which means
that the cgi runs as the user who's logged in.
> -----Original Message-----
> From: Michael Clark [mailto:michael@metaparadigm.com]
> Sent: 09 March 2008 03:10
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] how would I serve up an upload/download
> directory for each user
>
> Tim Edwards wrote:
> >
> > * Use some kind of module that allows apache to spawn a sub-process
> > running as the user who logged in through mod_auth_shadow. Does such
a
> > module exist?
> >
>
> We have some patches against apache to do something similar to this
> using a modified mod_dav with a privilege separation mechanism similar
> to openssh. In this model, apache still runs as an unprivileged
process
> and it sends privileged file-system requests overs a unix socket to a
> pre-spawned privileged monitor process. This means you get all the
> benefits of mod_dav but with the addition of unix authentication,
> permissions and quotas, etc.
>
> http://privsep.org/ModPrivsepDocs
>
> The 2.2 series patches are still experimental but the 1.3.x patches we
> have been running in production for some years now. I will have some
> production quality patches for 2.2 coming out very soon now.
>
> http://privsep.org/ModPrivsepPatches
>
> The 1.3.41 version includes a script to download apache, mod_ssl and
> mod_dav sources and to patch them (not required for 2.2 since mod_dav
> and mod_ssl are now included). The docs for the 1.3.41 patch are here:
>
> http://privsep.org/patches/1.3.41/README.html
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server
Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] how would I serve up an upload/download directory
for each user
Posted by Michael Clark <mi...@metaparadigm.com>.
Tim Edwards wrote:
>
> * Use some kind of module that allows apache to spawn a sub-process
> running as the user who logged in through mod_auth_shadow. Does such a
> module exist?
>
We have some patches against apache to do something similar to this
using a modified mod_dav with a privilege separation mechanism similar
to openssh. In this model, apache still runs as an unprivileged process
and it sends privileged file-system requests overs a unix socket to a
pre-spawned privileged monitor process. This means you get all the
benefits of mod_dav but with the addition of unix authentication,
permissions and quotas, etc.
http://privsep.org/ModPrivsepDocs
The 2.2 series patches are still experimental but the 1.3.x patches we
have been running in production for some years now. I will have some
production quality patches for 2.2 coming out very soon now.
http://privsep.org/ModPrivsepPatches
The 1.3.41 version includes a script to download apache, mod_ssl and
mod_dav sources and to patch them (not required for 2.2 since mod_dav
and mod_ssl are now included). The docs for the 1.3.41 patch are here:
http://privsep.org/patches/1.3.41/README.html
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] how would I serve up an upload/download directory for each user
Posted by Danie Qian <da...@bestningning.com>.
Have you considered the possibility of using some kind of file management software in PHP?
----- Original Message -----
From: Tim Edwards
To: users@httpd.apache.org
Sent: Thursday, March 06, 2008 1:25 PM
Subject: [users@httpd] how would I serve up an upload/download directory for each user
Hi,
I��m trying to use Apache to essentially replicate the functionality of our FTP server (we��ve found a lot of customers have corporate policies/firewalls stopping them accessing FTP but not http/s). The idea is that each customer has a Linux user created for them and can login with Apache setup to use mod_auth_shadow. However I want each user to have a directory into which they can upload files, as well as download. I can see a few possibilities:
* Use mod_userdir so each user has a https://servername.com/~username site. My problem with this is that I��d have to give the apache user rights to write to user��s home directories to allow uploads, I��m not sure if this is a good idea security-wise. However this server is single-purpose �C no one except administrators will be logging into it or interacting with it in any way except through httpd.
* Use some kind of module that allows apache to spawn a sub-process running as the user who logged in through mod_auth_shadow. Does such a module exist?
* Give up on the idea of using user��s home dirs and create a setup with virtual hosts and a directory owned by the apache user. Eg. have all user��s files under /var/www/users/<username> and have a virtual host for each /var/www/users/<username> dir. I��m not sure how to do this in any automated fashion though �C is there a way to coerce mod_userdir into working like this?
Any help/suggestions greatly appreciated.
--
Tim Edwards
Re: [users@httpd] how would I serve up an upload/download directory for each user
Posted by Joshua Slive <jo...@slive.ca>.
On Thu, Mar 6, 2008 at 1:25 PM, Tim Edwards <t....@tideway.com> wrote:
> I'm trying to use Apache to essentially replicate the functionality of our
> FTP server (we've found a lot of customers have corporate policies/firewalls
> stopping them accessing FTP but not http/s). The idea is that each customer
> has a Linux user created for them and can login with Apache setup to use
> mod_auth_shadow. However I want each user to have a directory into which
> they can upload files, as well as download. I can see a few possibilities:
>
> * Use mod_userdir so each user has a https://servername.com/~username site.
> My problem with this is that I'd have to give the apache user rights to
> write to user's home directories to allow uploads, I'm not sure if this is a
> good idea security-wise. However this server is single-purpose – no one
> except administrators will be logging into it or interacting with it in any
> way except through httpd.
>
>
>
> * Use some kind of module that allows apache to spawn a sub-process running
> as the user who logged in through mod_auth_shadow. Does such a module exist?
>
>
>
> * Give up on the idea of using user's home dirs and create a setup with
> virtual hosts and a directory owned by the apache user. Eg. have all user's
> files under /var/www/users/<username> and have a virtual host for each
> /var/www/users/<username> dir. I'm not sure how to do this in any automated
> fashion though – is there a way to coerce mod_userdir into working like
> this?
You should probably start by reading this:
http://wiki.apache.org/httpd/PrivilegeSeparation
Then you need to ask youself: do the users absolutely need to be able
to access the uploaded content through their unix logins as well as
through apache? If they don't, then just let apache manage all the
authorization process internally under its own userid.
If they do need direct access to these files, then you basically have
two choices: 1) use a CGI script to do the file management, and have
this cgi script switch users using suexec or cgiwrap; 2) setup a
separate apache install (not just a vhost) for each user and run that
install under that user. The technique is described here:
http://wiki.apache.org/httpd/DifferentUserIDsUsingReverseProxy
Joshua.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org