# Apache2 giving error message - SOLVED

## Thaidog

I'm getting the following error message when starting apache2:

gentoo_sulaco htdocs # /etc/init.d/apache2 restart

 * Starting apache2 ...

apache2: apr_sockaddr_info_get() failed for gentoo_sulaco

apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName 

http://127.0.0.1 comes up blank - any ideas?

----------

## massimo

I guess underscores should not be used in host-/domain names... Are there any files in /var/www/localhost/htdocs?

----------

## SLBMEH

I believe the rfc standard for dns is case insensitive 'a-z', '0-9' and a hyphen...  I know search do not see an underscore as a divider, but they see it at part of the word.  I know now all dns servers and clients force scrict rules on the rfc standards, but I suppose with that error message apache does.

----------

## nixnut

Moved from Installing Gentoo to Networking & Security.

----------

## Thaidog

 *massimo wrote:*   

> I guess underscores should not be used in host-/domain names... Are there any files in /var/www/localhost/htdocs?

 

Well i changed the hostname to sulao w/o the underscore and I'm still getting errors - there is an index page in htdocs:

gentoo_sulaco tylerm # /etc/init.d/apache2 restart

 * Starting apache2 ...

apache2: apr_sockaddr_info_get() failed for sulaco

apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName                        [ !! ]

gentoo_sulaco tylerm # cd /var/www/localhost/htdocs

gentoo_sulaco htdocs # ls

htdig  index.html

gentoo_sulaco htdocs # cat index.html

<HTML>

<HEAD>

<TITLE>

Apache2 online

</TITLE>

</HEAD>

<BODY>

Apache 2 online

</BODY>

</HTML>

gentoo_sulaco htdocs #

----------

## massimo

What does your /etc/hosts look like?

----------

## Thaidog

 *massimo wrote:*   

> What does your /etc/hosts look like?

 

gentoo_sulaco modules.d # 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       localhost

::1             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.)

#

----------

## massimo

 *Thaidog wrote:*   

> 
> 
> gentoo_sulaco modules.d # cat /etc/hosts
> 
> 

 

Your hostname still looks the same. Anyhow, try adding an alias for your hostname to /etc/hosts, e.g.,:

```

127.0.0.1 localhost sulao

```

----------

## SLBMEH

If adding it to your hosts file doesn't work, try adding ServerName to your httpd.conf

----------

## paese

Got similar problems.. Recently updated apache to 2.2.8, updated configs and fixed some small problems to get apache starting again. Also read the update guide. Apache starts but when i try to connect to a page i get "can't establish a connection to the server", tried it from our subnet and locally from the server by using lynx. 

What' wrong? before upgrade everything worked fine and i did no changes to vhost configs or sth. Paths are right because after upgrade i first got error messages "could not find directory /var/www/" which i had fixed.

edit:

fired up nmap to check and actually i see that apache is not working on port 80.. but why? @ŧhaidog maybe this is your problem, too?

----------

## Thaidog

 *massimo wrote:*   

>  *Thaidog wrote:*   
> 
> gentoo_sulaco modules.d # cat /etc/hosts
> 
>  
> ...

 

This works! thanks!

----------

## Mgiese

here it did not help...  :Sad: 

----------

