I'm rebuilding my web server and (finally) moving to a newer
configuration that should finally bring some more decent security and
performance. However there are quite a few questions I have left and I
have trouble finding information about. Hopefully some knowledgeable
people can give me the practical information about this...
From a lot older mail I got this advice ("Server hacked" thread at 1 &
2 january 2008):
> On Wed, 2 Jan 2008, Joris Dobbelsteen wrote:
>> At least there are some lessons in this:
>> * Use one-user-per-website only (easier auditing).
> Good idea...
> Dirs should be 710 for htdocs root
> eg: chmod 710 /var/www/vhosts
> chmod 710 /var/www/vhosts/example.com
> chmod 710 /var/www/vhosts/example.net
This would imply that
- user can do anything
- group can enter the directory (and nothing more?)
> Ensure the users who own those domains are the only ones with access,
> except group must be web server.
> eg: chown -R jack.apache /var/www/vhosts/example.com
> chown -R jill.apache /var/www/vhosts/example.net
In this case I'm puzzled how:
* apache, as the user is capable of actually reading htdocs.
> Use suexec in every virtualhost block in Apache
> eg: SuexecUserGroup jack apache
I didn't do this, instead I did SuexecUserGroup user user
If I do "SuexecUserGroup user apache", how does this isolate the
different users? As apache web server is capable of reading (through
group permissions), so should the user? Or what am I missing?
Any help, hints, pointers and good advice for this?
ubuntu-users mailing list
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
06-25-2008, 10:25 PM
Web server security: file permissions
Joris Dobbelsteen wrote:
> > Dirs should be 710 for htdocs root
> > eg: chmod 710 /var/www/vhosts
> > chmod 710 /var/www/vhosts/example.com
> > chmod 710 /var/www/vhosts/example.net
> This would imply that
> - user can do anything
> - group can enter the directory (and nothing more?)
> > Ensure the users who own those domains are the only ones with access,
> > except group must be web server.
> > eg: chown -R jack.apache /var/www/vhosts/example.com
> > chown -R jill.apache /var/www/vhosts/example.net
> /var/www/vhost/example.com 755 user:user
> /var/www/vhost/example.com/cgi-bin 555 user:user
> /var/www/vhost/example.com/htdocs 750 user:apache
> In this case I'm puzzled how:
> * apache, as the user is capable of actually reading htdocs.
> > Use suexec in every virtualhost block in Apache
> > eg: SuexecUserGroup jack apache
It will work. Directories need bit 0 set (x) for both user(owner) and
web server(group) so that both fellows can get into these. Only owner
needs to write - normally. Give write permission to web server(group) in
cases like log files and directories where people can upload pictures or
other files. Meke sure the FTP server sets user:www-data and 640 for all
I have a https web page where my users can login and change permissions
on all files below their document root, exept for the logs directory.