From owner-freebsd-questions@FreeBSD.ORG Wed Jun 7 00:25:00 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org 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 BE60716AF2E for ; Wed, 7 Jun 2006 00:06:36 +0000 (UTC) (envelope-from john.destefano@gmail.com) Received: from nz-out-0102.google.com (nz-out-0102.google.com [64.233.162.192]) by mx1.FreeBSD.org (Postfix) with ESMTP id 330B143D45 for ; Wed, 7 Jun 2006 00:06:35 +0000 (GMT) (envelope-from john.destefano@gmail.com) Received: by nz-out-0102.google.com with SMTP id 13so49950nzn for ; Tue, 06 Jun 2006 17:06:35 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Y+Qe+mqqGXgBXbLqnPDbcgG2zfFnzEtadLFF/OXBIPoCyhDkT2w6EwxvF0UpUV3p98VG0R7a4hE0pJqWFS51tw9VzgtR7opEX3Py2P5cOQyvfxSpDZbFlYZcSUeycDcPuxEusWVQInK1fxCNgos95ZIK6K+kx8ILJUndoNCEpTM= Received: by 10.65.205.1 with SMTP id h1mr90260qbq; Tue, 06 Jun 2006 17:06:35 -0700 (PDT) Received: by 10.65.150.2 with HTTP; Tue, 6 Jun 2006 17:06:35 -0700 (PDT) Message-ID: Date: Tue, 6 Jun 2006 20:06:35 -0400 From: "John DeStefano" To: fbsd@a1poweruser.com In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: Cc: freebsd-questions@freebsd.org Subject: Re: Virtual hosts and PHP "downloads": php5 and apache22 on FreeBSD6.1-STABLE 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, 07 Jun 2006 00:25:02 -0000 First and foremost, thanks for the reply. On 6/6/06, fbsd wrote: > The php5 port is broken in 6.1. > It no longer defaults to activating the php/apache module. Thanks for that. I do appreciate it. > > This has been covered in great detail on this list in the past 6 > weeks which you would have found out if you reviewed the list > archives before posting this question. I may have missed a week or two, but the only responses I've seen personally have been "see /usr/ports/UPDATING", which I did. I'm not thrilled with the stock "RTFM" post, but I guess that's par for the course. > > After downloading the 6.1 version php5 port config files you have to > do "make config" and select the apache module. The "make install" > will automatically make the correct changes to your httpd-config > file for serving up php pages correctly. php5-extensions is not > normally needed. I did that. That's pointed out in /usr/ports/UPDATING. Unfortunately, it didn't automatically fix the issue for me. > > Your other httpd-config problems are due to you using apache22 > instead of apache13 which is the rock hard production version of > Apache web server. Apache22 is generally considered as the > developmental version. I was running 1.3 before my BSD upgrade to 6.1-STABLE. There were security issues with 1.3 that were not resolved at the time of my upgrade. And I assumed with the package changes to PHP5 in 6.1 that going with an updated version of apache as well would be the best method. If you're saying I should revert back to 1.3, should I also revert to an earlier version of PHP5, or is the latest and greatest still best compatible with apache13? Thank you, ~John > -----Original Message----- > From: owner-freebsd-questions@freebsd.org > [mailto:owner-freebsd-questions@freebsd.org]On Behalf Of John > DeStefano > Sent: Tuesday, June 06, 2006 3:46 PM > To: freebsd-questions@freebsd.org > Subject: Virtual hosts and PHP "downloads": php5 and apache22 on > FreeBSD6.1-STABLE > > > I upgraded my system from 5.4-RELEASE to 6.1-STABLE last week, and > my > web server immediately stopped serving PHP pages, where I had no > problem doing so before. Instead of processing the PHP code on the > server and displaying the result in a browser, browsing to any page > containing PHP code resulted in a prompt to download the PHP page as > a > file. > > /usr/ports/UPGRADING mentions that PHP has been streamlined and must > be recompiled to work with Apache and other packages. After > deinstalling, configuring (where applicable), and reinstalling PHP5, > php5-extensions, and apache2 to the latest versions, not only were > PHP > files not being served, but my web server was toast: > "Forbidden You don't have permission to access / on this server." > > I edited the new apache config file (now located in > /usr/local/etc/apache22/httpd.conf) with my system information, > including a DocumentRoot path. But when I started apache, I got some > very peculiar errors: > "Warning: DocumentRoot [/www/docs/dummy-host.example.com] does not > exist > Warning: DocumentRoot [/www/docs/dummy-host2.example.com] does not > exist" > > Not only did I confirm beforehand that I had set the DocumentRoot > path, and that apache was using the correct config file... but these > "dummy" paths didn't exist in the config file! I learned eventually > that a new apache directive splits out virtual host directives to a > new include file (/usr/local/etc/apache22/extra/httpd-vhosts.conf). > Then I learned after getting a server warning ("NameVirtualHost *:80 > has no VirtualHosts") that the syntax has been slightly modified, so > that the IP/port value of each VirtualHost specification must match > that of the NameVirtualHost directive (i.e., "NameVirtualHost *:80" > and ""). > > Still having trouble though: my "main" site loads properly, but the > other virtual hosts aren't. Browsing to any virtual host address > other > than the default results in either the wrong content or an error. > Here's what my httpd-vhosts.conf looks like: > > NameVirtualHost *:80 > > > ServerName www.SiteA.com > ServerAlias SiteA.com *.SiteA.com > DocumentRoot /usr/www > ErrorLog /var/log/httpd-SiteA-error.log > CustomLog /var/log/httpd-SiteA-access.log combined > > > > ServerName www.SiteB.com > ServerAlias SiteB.com *.SiteB.com > DocumentRoot /usr/www2 > ErrorLog /var/log/httpd-SiteB-error.log > CustomLog /var/log/httpd-SiteB-access.log combined > > > So, what's happening is that SiteA works as expected, but browsing > to > SiteB brings you to SiteA, or doesn't load at all ("403" error). > > In addition, I'm back to my original problem, where PHP files are > not > loading, and browsing to a PHP page prompts the user to download the > page as a file. > > Any help on either the virtual hosts or the PHP download issue would > be greatly appreciated. > > Thanks, > ~John