Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 18801 - The new baselayout hostname setting breaks Apache2 Config
Summary: The new baselayout hostname setting breaks Apache2 Config
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Martin Schlemmer (RETIRED)
Depends on:
Reported: 2003-04-05 08:33 UTC by Tony Murray
Modified: 2005-01-24 10:49 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Tony Murray 2003-04-05 08:33:10 UTC
I cannot set my hostname correctly for apache because of the new
/etc/init.d/hostname. This is a result of two problems, at least one needs to be

I need to set my hostname to, which is what I have in
/etc/hostname, but the new hostname mangles it down to just murrant, which will
not work...

When I uncomment "ServerName" in
/etc/apache2/conf/apache2.conf it does not take the hostname I give it, but uses
what /bin/hostname gives.  If I set hostname to with
/bin/hostname, apache will start.

Comment 1 Tony Murray 2003-04-05 15:34:13 UTC
The problem still occurs with apache 2.0.45.
Comment 2 Donny Davies (RETIRED) gentoo-dev 2003-04-06 00:57:04 UTC
what does your hosts file look like, afaik it should appear thusly:

# /etc/hosts alias

Comment 3 Tony Murray 2003-04-06 01:00:20 UTC
I have nothing in it (except localhost) because I am on a college campus and I get DHCP IP address, and it changes, so I would have to change it all the time...
Comment 4 Bjarke Istrup Pedersen (RETIRED) gentoo-dev 2003-04-06 06:06:42 UTC
This should be fixed ASAP.
Comment 5 Stefan Förster 2003-04-12 06:26:24 UTC
/bin/hostname should never be used to set the result of gethostname(2) to soemthing containig a dot ;-)
In fact, if your are using DHCP to configure your local system, it is the responsibility of your DHCP-client to set the local hostname to an unqualified form which can easyily be qualified (remember, a FQDN is not the result fo gethostname(2) but the result of calling gethostbyname(3) for the result of gethostname(2)).
Using static IP configuration, this is achieved using a line in /etc/hosts which contains the FQDN in the second and the unqualified name in the third column, using dynamic configuration, you will have to set up a nameserver which is updated by the DHCP-server.
This is not a bug in baselayout. And I guess that apache2 ignores a hostname given in the config files is due to the fact that the hostname could either not be qualified or was already given in a qualified form.
Comment 6 Stefan Förster 2003-04-12 06:32:25 UTC
Well, I don't use DHCP at home, but I think, if you do not want to dynamically update a DNS server, it would be sufficient to have the DHCP-client adding a line of the form like Donny Davies suggested it to /etc/hosts.
Comment 7 Tony Murray 2003-04-13 22:52:57 UTC
Okey dokie.  Well I modified /etc/resolv.conf and /etc/yp.conf to use "" instead of "".  And that resolved the problem.

Sorry about the invalid bug guys, the new baselayout just exposed a misconfiguration of my system.  Now it is fixed and humming along.
Comment 8 Martin Holzer (RETIRED) gentoo-dev 2003-04-22 06:28:24 UTC
closing with comment #7
Comment 9 Tony Murray 2005-01-24 10:49:14 UTC
Closing old bugs.