From owner-freebsd-questions@FreeBSD.ORG Wed Jul 11 08:20:55 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9BB6A16A400 for ; Wed, 11 Jul 2007 08:20:55 +0000 (UTC) (envelope-from bsd@kajs.co.nz) Received: from mail5.inspire.net.nz (mail.inspire.net.nz [203.114.168.5]) by mx1.freebsd.org (Postfix) with ESMTP id 4C50B13C465 for ; Wed, 11 Jul 2007 08:20:54 +0000 (UTC) (envelope-from bsd@kajs.co.nz) Received: from localhost (unknown [10.0.168.8]) by mail5.inspire.net.nz (Postfix) with ESMTP id B33C6DBC5C for ; Wed, 11 Jul 2007 20:20:51 +1200 (NZST) Received: from mail5.inspire.net.nz ([10.0.168.5]) by localhost (mail8.inspire.net.nz [10.0.168.8]) (amavisd-new, port 10024) with ESMTP id 5e4Ns-ogLzuq for ; Wed, 11 Jul 2007 20:17:37 +1200 (NZST) Received: from jbox.kajs.co.nz (203-114-173-171.eth.sta.inspire.net.nz [203.114.173.171]) by mail5.inspire.net.nz (Postfix) with ESMTP id 7810BDBD93 for ; Wed, 11 Jul 2007 20:20:51 +1200 (NZST) Message-ID: <469492E4.2030609@kajs.co.nz> Date: Wed, 11 Jul 2007 20:20:52 +1200 From: Josh User-Agent: Thunderbird 2.0.0.0 (X11/20070620) MIME-Version: 1.0 To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Securing php X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2007 08:20:55 -0000 I am setting up a apache + php + mysql which will have shared hosts on it, How do I make it so that php cant read or execute files outside of /home/user/web for example. I know that there is safe_mode, but there must be a more definite way, and safe_mode is gone in php6 anyway. Is there some sort of acl/mac thing I can use, or something magical I have not heard of yet? At the moment I am running php as a cgi with fastcgi + suexec, so I can run each vhost under a different uid/gid. Any ideas? Main goal: PHP instances unable to access out side of relevant vhost document roots. Thanks, Josh