Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
apache: unable to find IPv4 address of "Gentoo"
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
jhon987
Apprentice
Apprentice


Joined: 18 Nov 2013
Posts: 225

PostPosted: Wed May 06, 2015 9:54 pm    Post subject: apache: unable to find IPv4 address of "Gentoo" Reply with quote

hi,
I'm having troubles resolving this issue (taken from /var/log/apache2/error_log):

Code:
[alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "Gentoo"
Configuration Failed


I realize it has something to do with my /etc/hosts yet I'm not sure what is the exact course of action I should take, this my hosts file:

Code:
# cat /etc/hosts
# /etc/hosts: Local Host Database
#
# This file describes a number of aliases-to-address mappings for the for
# local hosts that share this file.
#
# In the presence of the domain name service or NIS, this file may not be
# consulted at all; see /etc/host.conf for the resolution order.
#

# IPv4 and IPv6 localhost aliases
127.0.0.1       Gentoo
::1             localhost
0.0.0.0         localhost


# Imaginary network.
#10.0.0.2               myname
#10.0.0.3               myfriend
#
# According to RFC 1918, you can use the following IP networks for private
# nets which will never be connected to the Internet:
#
#       10.0.0.0        -   10.255.255.255
#       172.16.0.0      -   172.31.255.255
#       192.168.0.0     -   192.168.255.255
#
# In case you want to be able to connect directly to the Internet (i.e. not
# behind a NAT, ADSL router, etc...), you need real official assigned
# numbers.  Do not try to invent your own network numbers but instead get one
# from your network provider (if any) or from your regional registry (ARIN,
# APNIC, LACNIC, RIPE NCC, or AfriNIC.)
#


when I run rc-service apache2 start in terminal this is what I see:

Code:
apache2            | * Starting apache2 ...
apache2            |apache2: apr_sockaddr_info_get() failed for Gentoo
apache2            |apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
apache2            | * start-stop-daemon: failed to start `/usr/sbin/apache2'   [ !! ]
apache2            | * ERROR: apache2 failed to start


can someone please help?
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 6971
Location: Saint Amant, Acadiana

PostPosted: Wed May 06, 2015 9:59 pm    Post subject: Reply with quote

Code:
0.0.0.0         localhost
? Try

Code:
127.0.0.1       localhost Gentoo

_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
SwordArMor
n00b
n00b


Joined: 21 Feb 2015
Posts: 55
Location: Bretagne

PostPosted: Wed May 06, 2015 10:11 pm    Post subject: Reply with quote

I don’t have any entry about Gentoo in my /etc/hosts and my apache works. What do you have with `grep -r Gentoo /etc/apache2/` ?
Back to top
View user's profile Send private message
jhon987
Apprentice
Apprentice


Joined: 18 Nov 2013
Posts: 225

PostPosted: Wed May 06, 2015 10:12 pm    Post subject: Reply with quote

Jaglover wrote:
Code:
0.0.0.0         localhost
? Try

Code:
127.0.0.1       localhost Gentoo


as you can see, I already have:
0.0.0.0 localhost
defined in there.
I've also tried:
127.0.0.1 localhost Gentoo
but still get same results
Back to top
View user's profile Send private message
jhon987
Apprentice
Apprentice


Joined: 18 Nov 2013
Posts: 225

PostPosted: Wed May 06, 2015 10:13 pm    Post subject: Reply with quote

SwordArMor wrote:
I don’t have any entry about Gentoo in my /etc/hosts and my apache works. What do you have with `grep -r Gentoo /etc/apache2/` ?


Code:
# grep -r Gentoo /etc/apache2/
/etc/apache2/httpd.conf:# for Gentoo Linux.
/etc/apache2/httpd.conf:# Gentoo has made using virtual-hosts easy. In /etc/apache2/vhosts.d/ we
Back to top
View user's profile Send private message
SwordArMor
n00b
n00b


Joined: 21 Feb 2015
Posts: 55
Location: Bretagne

PostPosted: Wed May 06, 2015 10:16 pm    Post subject: Reply with quote

And what is the content of /etc/apache2/modules.d/mod_unique_id.conf?
Back to top
View user's profile Send private message
jhon987
Apprentice
Apprentice


Joined: 18 Nov 2013
Posts: 225

PostPosted: Wed May 06, 2015 10:20 pm    Post subject: Reply with quote

SwordArMor wrote:
And what is the content of /etc/apache2/modules.d/mod_unique_id.conf?


hmmm, strangely enough, I don't have such file, do you have one? (in that location)

I only have:
Code:
# locate mod_unique
/usr/lib64/apache2/modules/mod_unique_id.so
Back to top
View user's profile Send private message
SwordArMor
n00b
n00b


Joined: 21 Feb 2015
Posts: 55
Location: Bretagne

PostPosted: Wed May 06, 2015 10:31 pm    Post subject: Reply with quote

I don’t have this file but it would have been the logical location for the configuration of that module. I’m trying to understand why your apache wants to bind the “Gentoo” IPv4 address.
However, I checked on my side and I also only have this .so:
Code:
alarig@bulbizarre ~ $ equery files =www-servers/apache-2.2.29 | grep mod_unique
/usr/lib64/apache2/modules/mod_unique_id.so

But, by reading the doc¹ I can see that this module have to resolve the hostname of the local box. What is the hostname of your box and is it resolvable with the hosts file?

[1] https://httpd.apache.org/docs/2.2/mod/mod_unique_id.html
Back to top
View user's profile Send private message
jhon987
Apprentice
Apprentice


Joined: 18 Nov 2013
Posts: 225

PostPosted: Wed May 06, 2015 10:42 pm    Post subject: Reply with quote

SwordArMor wrote:
I don’t have this file but it would have been the logical location for the configuration of that module. I’m trying to understand why your apache wants to bind the “Gentoo” IPv4 address.
However, I checked on my side and I also only have this .so:
Code:
alarig@bulbizarre ~ $ equery files =www-servers/apache-2.2.29 | grep mod_unique
/usr/lib64/apache2/modules/mod_unique_id.so

But, by reading the doc¹ I can see that this module have to resolve the hostname of the local box. What is the hostname of your box and is it resolvable with the hosts file?

[1] https://httpd.apache.org/docs/2.2/mod/mod_unique_id.html


yeah, so, I'm not sure. I briefly read that too but perhaps I didn't get it right...
anyways, my /etc/hostname is this:
Code:
# cat /etc/hostname
Gentoo

as you can see it matches the "127.0.0.1 Gentoo" configuration I have in /etc/hosts (same name), however this might be were I'm wrong since I tried changing any of these parameters, just to see if the log file would be different, and it didn't - meaning: ? - well, I'm not sure what it means...
shouldn't changing the hostname in /etc/hostname yield an error which ends with another name than "Gentoo", like so:
Code:
(EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "<SOME-PARAMETER>"
Configuration Failed
Back to top
View user's profile Send private message
SwordArMor
n00b
n00b


Joined: 21 Feb 2015
Posts: 55
Location: Bretagne

PostPosted: Wed May 06, 2015 11:04 pm    Post subject: Reply with quote

Yes, it’s a good way to know if it’s the hostname that generate this error.
Back to top
View user's profile Send private message
jhon987
Apprentice
Apprentice


Joined: 18 Nov 2013
Posts: 225

PostPosted: Wed May 06, 2015 11:13 pm    Post subject: Reply with quote

SwordArMor wrote:
Yes, it’s a good way to know if it’s the hostname that generate this error.


OK so as I said, changing the hostname has no effect on the error output, from where does apache draws the hostname I wonder?
Back to top
View user's profile Send private message
jhon987
Apprentice
Apprentice


Joined: 18 Nov 2013
Posts: 225

PostPosted: Thu May 07, 2015 5:19 am    Post subject: Reply with quote

Just wanted to say that I still haven't found a way how to solve this. I reverted to the only workaround I could conceive - remove apache2_modules_unique_id use-flag...
Back to top
View user's profile Send private message
jhon987
Apprentice
Apprentice


Joined: 18 Nov 2013
Posts: 225

PostPosted: Thu May 07, 2015 6:22 am    Post subject: Reply with quote

Finally, SOLVED!

Just couldn't helped it and had to figure out the culprit, the problem was /etc/host.conf wasn't configured correctly.

How did I figured it?

So, I tried pinging localhost and everything went fine, then tried pinging "gentoo" which is defined in my /etc/hosts as 127.0.0.1 and it couldn't resolve, tried pinging 127.0.0.1 directly and it worked.
I realized my /etc/hosts wasn't even used all along - that happened because I recently played with multilib and no-multilib profiles (testing each one) and the last time I moved to no-multilib I didn't emerged glibc but used quickpkg to build it from gentoo stage 3.
This move, in turn, lead to that /etc/host.conf simply wasn't configured (who would have thought that host.conf is actually dependent of glibc, I still can't see the relation between the two), anyways, once glibc's emerge was finished, I dispatched the configuration and suddenly, everything is back to normal.

The funny thing is, the configuration is so minimal, it only uses 2 options:
order hosts, bind
and
multi on

could've written it manually and be done with it yesterday...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum