From nobody@FreeBSD.org  Thu Dec 24 00:48:00 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B766110656AA
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 24 Dec 2009 00:48:00 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id A53D18FC12
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 24 Dec 2009 00:48:00 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id nBO0m0co022585
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 24 Dec 2009 00:48:00 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id nBO0m0Nq022584;
	Thu, 24 Dec 2009 00:48:00 GMT
	(envelope-from nobody)
Message-Id: <200912240048.nBO0m0Nq022584@www.freebsd.org>
Date: Thu, 24 Dec 2009 00:48:00 GMT
From: "Igor Gali&#263;" <i.galic@brainsware.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: FreeBSD Handbook on Apache/PHP needs updating
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         141937
>Category:       docs
>Synopsis:       [handbook] FreeBSD Handbook on Apache/PHP needs updating
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-doc
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Thu Dec 24 00:50:06 UTC 2009
>Closed-Date:    Sat Dec 26 07:26:41 UTC 2009
>Last-Modified:  Sat Dec 26 07:26:41 UTC 2009
>Originator:     Igor Gali&#263;
>Release:        
>Organization:
>Environment:
>Description:
There are two issues I have noticed in this document
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-apache.html

On is the section on VirtualHosts, the other on how to configure PHP.

The VirtualHost section is merely imprecise: ``NameVirtualHost *'' covers
all interfaces and all ports, thus it's *very* ambiguous.


The second issue is with the PHP configuration, which is plain wrong.
AddType is something to communicate the mime-type to the browser. (See
http://www.devside.net/articles/php as an example discussion for the why.)
Also it's quite silly to have a <IfModule> section right after a LoadModule,
much more so, twice for two directives.
>How-To-Repeat:
Take a look at: 

http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-apache.html
>Fix:
The virtualhost section should be replaced with:

NameVirtualHost *:80

And: 

<VirtualHost *:80>
    ServerName www.domain.tld
    DocumentRoot /www/domain.tld
</VirtualHost>

<VirtualHost *:80>
    ServerName www.someotherdomain.tld
    DocumentRoot /www/someotherdomain.tld
</VirtualHost>



The PHP section can be simplified to:

LoadModule php5_module        libexec/apache/libphp5.so
DirectoryIndex index.php index.html
<Files *.php>
    SetHandler application/x-httpd-php
</Files>
## Optionally, pretty Source-Rendering:
#<Files *.phps>
#    SetHandler application/x-httpd-php-source
#</Files>

In general: You can, by now, refer to the PHP documentation:
http://php.net/manual/en/install.unix.apache2.php

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: sat 
State-Changed-When: Sat Dec 26 07:16:08 UTC 2009 
State-Changed-Why:  
Igor, thanks for your report! 

The Handbook section deals with Apache 1.3.x, as is explicitly stated 
in the overview. The version is still widely used. 

As for the port specification in VirtualHost directive, the Apache 
manual gives its examples without it and explains that "it defaults to 
the same port as the most recent Port statement of the main server". To 
match all ports on all addresses, I think we would need to specify 
"*:*". 
http://httpd.apache.org/docs/1.3/mod/core.html#virtualhost 

As for the the way PHP is enabled, the IfModule wrapper is a 
convenience, since it allows to disable all PHP-related configuration 
by commenting just one line. The AddType statements are the 
recommended way to enable PHP in Apache 1.3.x: 
http://www.php.net/manual/en/install.unix.apache.php 

http://www.freebsd.org/cgi/query-pr.cgi?pr=141937 
>Unformatted:
