Page 1 of 1

Needs help on configurate virtual hosts on linux

Posted: Sun Oct 04, 2009 11:16 pm
by John.Mike
hi,all,i am configurating my vhost system,when users register and apply for a virtual host space ,users can get ftp and mysql accounts ,and they also are able to run websites on my server based on LAMP and pure-ftpd ,ubuntu server 8.04.
But some system security appears when i have following steps done.
First,i apply for a vhost spaces named "test" on the server.
Secondly , upload a file hack.php to the space.
Last,edit the hack.php: <?php
umask(0);
mkdir("/var/www/foolish",0777);
?>
when i try to run this script by typing "test.domain.com/hack.php" in my browser,a folder name "foolish" appears in my DocumentRoot.
wat should i do about distributting permissions between my apache2 and pure-ftpd users?Hopes anyone would help mee,thanks! :o

Re: Needs help on configurate virtual hosts on linux

Posted: Tue Oct 06, 2009 3:52 am
by John.Mike
is there nobody knows how to do with it ? :(

Re: Needs help on configurate virtual hosts on linux

Posted: Tue Oct 06, 2009 3:37 pm
by robnet
I've spent a few minutes on Google and not found a quick and easy solution: it doesn't look like you can have a different user running each vhost in a single apache installation. (But I could be wrong.)
So I think you'd have to go with multiple daemons, each running as the user whose access you want to limit.

Re: Needs help on configurate virtual hosts on linux

Posted: Wed Oct 07, 2009 12:20 am
by John.Mike
Thanks robnet,
After doing much homework on it,i've found that the module Suexec belongs to apache can help me,this module can "have Apache execute CGI scripts as the owner of the script" .Suggest u to have a glance of it . :D

Re: Needs help on configurate virtual hosts on linux

Posted: Fri Oct 23, 2009 11:19 pm
by TheOnly92
Or you can apply open_basedir restriction on your PHP configuration to limit the accessible directories.