Bug 131563 - [patch] Edit www/apache22/pkg-message to prompt user to add hostname to /etc/hosts
Summary: [patch] Edit www/apache22/pkg-message to prompt user to add hostname to /etc/...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-apache (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-10 16:30 UTC by Glen Barber
Modified: 2009-04-10 07:40 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Glen Barber 2009-02-10 16:30:01 UTC
Patch to remind user(s) to edit /etc/hosts with the output of the `hostname` command:

--- pkg-message 2009-02-10 16:15:04.000000000 +0000
+++ pkg-message_edit    2009-02-10 16:17:03.000000000 +0000
@@ -1,2 +1,5 @@
+You must have output from the 'hostname' command in your /etc/hosts file
+for apache to start properly.
+
 To run apache www server from startup, add apache22_enable="YES"
 in your /etc/rc.conf. Extra options can be found in startup script.

Fix: 

See above.
Comment 1 Edwin Groothuis freebsd_committer 2009-02-10 16:30:14 UTC
Responsible Changed
From-To: freebsd-ports-bugs->apache

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Philip M. Gollucci freebsd_committer 2009-02-11 01:14:17 UTC
This is not true.  Largely, this depends on the modules you have loaded (in 
particular, mod_uniqueid and mod_usertrack).

Additionally, it also depends on if you hostname resolves via DNS.

Finally, it depends on what you have set for the ServerName directive in
httpd.conf

(x 3 bugs)
Comment 3 Glen Barber 2009-02-11 01:25:35 UTC
On Tue, Feb 10, 2009 at 8:14 PM, Philip M. Gollucci
<pgollucci@freebsd.org> wrote:
> This is not true.  Largely, this depends on the modules you have loaded (in
> particular, mod_uniqueid and mod_usertrack).
>

AFAIK, these are 'default'.

> Additionally, it also depends on if you hostname resolves via DNS.
>

Right.  Most of the apache startup problems on FreeBSD I see are
/etc/hosts related.  Most of the users experiencing are "new" to
FreeBSD, and neglect adding their hostname to /etc/hosts.  (I know I
still do on occasion.)

> Finally, it depends on what you have set for the ServerName directive in
> httpd.conf
>

I have successfully run Apache (2.0.x and 2.2.x) without a ServerName
directive but a resolvable address (/etc/hosts entry).

I think adding this patch would be a "convenience reminder" rather
than "this will fix all of the problems."  At least, it is a step to
try to prevent a FAQ I see too often.

Regards,

-- 
Glen Barber
Comment 4 Philip M. Gollucci 2009-02-12 05:52:10 UTC
Glen Barber wrote:
> Right.  Most of the apache startup problems on FreeBSD I see are
> /etc/hosts related.  Most of the users experiencing are "new" to
> FreeBSD, and neglect adding their hostname to /etc/hosts.  (I know I
> still do on occasion.)
Configuring the network in /sysinstall at install time does this for you.

> I have successfully run Apache (2.0.x and 2.2.x) without a ServerName
> directive but a resolvable address (/etc/hosts entry).
While its good to have your hostname in /etc/hosts, it doesn't have to be
a remote dns server can have it and answer it just fine.

The pkg-message isn't meant to replace docs, rather it should really reference 
docs.


-- 
------------------------------------------------------------------------
1024D/DB9B8C1C B90B FBC3 A3A1 C71A 8E70  3F8C 75B8 8FFB DB9B 8C1C
Philip M. Gollucci (pgollucci@p6m7g8.com) c: 703.336.9354
Consultant          - P6M7G8 Inc.                http://p6m7g8.net
Senior Sys Admin    - RideCharge, Inc.           http://ridecharge.com
Contractor          - PositiveEnergyUSA          http://positiveenergyusa.com
ASF Member          - Apache Software Foundation http://apache.org
FreeBSD Committer   - FreeBSD Foundation         http://freebsd.org

Work like you don't need the money,
love like you'll never get hurt,
and dance like nobody's watching.
Comment 5 Glen Barber 2009-02-12 14:50:08 UTC
On Thu, Feb 12, 2009 at 12:52 AM, Philip M. Gollucci
<pgollucci@p6m7g8.com> wrote:
> Glen Barber wrote:
>>
>> Right.  Most of the apache startup problems on FreeBSD I see are
>> /etc/hosts related.  Most of the users experiencing are "new" to
>> FreeBSD, and neglect adding their hostname to /etc/hosts.  (I know I
>> still do on occasion.)
>
> Configuring the network in /sysinstall at install time does this for you.
>

To be honest, I have yet to see this happen, even when using a FQDN as
a hostname.

>> I have successfully run Apache (2.0.x and 2.2.x) without a ServerName
>> directive but a resolvable address (/etc/hosts entry).
>
> While its good to have your hostname in /etc/hosts, it doesn't have to be
> a remote dns server can have it and answer it just fine.
>

Not everyone needs an internal DNS server, and if the hostname is not
a resolvable FQDN, this won't work.

> The pkg-message isn't meant to replace docs, rather it should really
> reference docs.

I agree.  My intent with the PR I submitted was to try to make things
a little more clear on, as I stated, one of the most common FAQs I see
regarding Apache on FreeBSD.

-- 
Glen Barber
Comment 6 Philip M. Gollucci 2009-02-12 14:53:09 UTC
Glen Barber wrote:
> I agree.  My intent with the PR I submitted was to try to make things
> a little more clear on, as I stated, one of the most common FAQs I see
> regarding Apache on FreeBSD.
How about we compromise and say, something related to ....

'... Your hostname must be resolvable using at least 1 mechanism in 
/etc/nsswitch typically DNS or /etc/hosts or apache will have issues starting.'





-- 
------------------------------------------------------------------------
1024D/DB9B8C1C B90B FBC3 A3A1 C71A 8E70  3F8C 75B8 8FFB DB9B 8C1C
Philip M. Gollucci (pgollucci@p6m7g8.com) c: 703.336.9354
Consultant          - P6M7G8 Inc.                http://p6m7g8.net
Senior Sys Admin    - RideCharge, Inc.           http://ridecharge.com
Contractor          - PositiveEnergyUSA          http://positiveenergyusa.com
ASF Member          - Apache Software Foundation http://apache.org
FreeBSD Committer   - FreeBSD Foundation         http://freebsd.org

Work like you don't need the money,
love like you'll never get hurt,
and dance like nobody's watching.
Comment 7 Glen Barber 2009-02-12 14:54:19 UTC
On Thu, Feb 12, 2009 at 9:53 AM, Philip M. Gollucci
<pgollucci@p6m7g8.com> wrote:
> How about we compromise and say, something related to ....
>
> '... Your hostname must be resolvable using at least 1 mechanism in
> /etc/nsswitch typically DNS or /etc/hosts or apache will have issues
> starting.'
>

You beat me to it.  I was just about to edit the patch(es) I submitted. :)

-- 
Glen Barber
Comment 8 Philip M. Gollucci freebsd_committer 2009-04-10 07:40:20 UTC
State Changed
From-To: open->closed

Committed. Thanks!