Needs help on configurate virtual hosts on linux

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
John.Mike
Forum Newbie
Posts: 18
Joined: Fri Sep 04, 2009 11:43 pm
Location: Canton.China

Needs help on configurate virtual hosts on linux

Post 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
John.Mike
Forum Newbie
Posts: 18
Joined: Fri Sep 04, 2009 11:43 pm
Location: Canton.China

Re: Needs help on configurate virtual hosts on linux

Post by John.Mike »

is there nobody knows how to do with it ? :(
robnet
Forum Commoner
Posts: 85
Joined: Mon Aug 10, 2009 8:32 am
Location: South East, UK

Re: Needs help on configurate virtual hosts on linux

Post 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.
John.Mike
Forum Newbie
Posts: 18
Joined: Fri Sep 04, 2009 11:43 pm
Location: Canton.China

Re: Needs help on configurate virtual hosts on linux

Post 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
TheOnly92
Forum Newbie
Posts: 19
Joined: Thu Jan 15, 2009 6:05 am

Re: Needs help on configurate virtual hosts on linux

Post by TheOnly92 »

Or you can apply open_basedir restriction on your PHP configuration to limit the accessible directories.
Post Reply