From owner-freebsd-questions@FreeBSD.ORG Tue Jan 25 09:28:24 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 757FC16A4CE for ; Tue, 25 Jan 2005 09:28:24 +0000 (GMT) Received: from smtp1.wanadoo.fr (smtp1.wanadoo.fr [193.252.22.30]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2E8CA43D54 for ; Tue, 25 Jan 2005 09:28:24 +0000 (GMT) (envelope-from atkielski.anthony@wanadoo.fr) Received: from me-wanadoo.net (unknown [127.0.0.1]) by mwinf0108.wanadoo.fr (SMTP Server) with ESMTP id 6750A1C00CEB for ; Tue, 25 Jan 2005 10:28:23 +0100 (CET) Received: from pix.atkielski.com (ASt-Lambert-111-2-1-3.w81-50.abo.wanadoo.fr [81.50.80.3]) by mwinf0108.wanadoo.fr (SMTP Server) with ESMTP id 474711C00CF4 for ; Tue, 25 Jan 2005 10:28:23 +0100 (CET) X-ME-UUID: 20050125092823292.474711C00CF4@mwinf0108.wanadoo.fr Date: Tue, 25 Jan 2005 10:28:23 +0100 From: Anthony Atkielski X-Priority: 3 (Normal) Message-ID: <1725708654.20050125102823@wanadoo.fr> To: freebsd-questions@freebsd.org In-Reply-To: <48a5f32a05012501075d2ebef5@mail.gmail.com> References: <48a5f32a05012501075d2ebef5@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: A simple CGI question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: freebsd-questions@freebsd.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2005 09:28:24 -0000 Gareth Bailey writes: GB> If a cgi script is in my /usr/local/www/cgi-bin directory, what url GB> would i use to access the cgi from the web. Would i need to copy the GB> cgi into my data directory? - i tried this and the browser treated it GB> as a download. It all depends on how you have Apache configured, but a typical configuration would require that you reference the CGI script with something like http://www.yourdomain.com/cgi-bin/mycgiprog.pl The extension on mycgiprog depends on what form the CGI takes; .pl is for Perl programs. Your Apache server has to be configured to either treat all files in a certain directory (usually cgi-bin) as executable programs, or to recognize certain extensions as executable programs, or both. Note that there are many security issues with providing something as sensitive as a password-changing program on your Web server, so take great care in your implementation. (And remember that Apache normally does not execute as root, so it cannot change passwords in executable CGI programs without special configuration.) -- Anthony