# apache problem[SOLVED]

## apiaio

A few days ago I have changed internet connection from wireless into DSL. At the same time I have purchased modem/router ZyXEL 	 P-660HW-T3 v2.

Everything works fine but Apache. I have to admit, that networking is not my best point, but I think that the problem is that my new router every time

when I start Gentoo assigns  new hostname to my system. In my /etc/hosts  is *Quote:*   

> 127.0.0.1       localhost
> 
> ::1             localhost
> 
> 

 But 

```
dhcppc0 / # echo $HOSTNAME

dhcppc0
```

Some times it is dhcppc1 or 2.Start of Apache gives

```
dhcppc0 / # /etc/init.d/apache2 start

 * Starting apache2 ...

apache2: apr_sockaddr_info_get() failed for dhcppc0

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

and http://localhost  *Quote:*   

> An error occurred while loading http://localhost/:
> 
> Could not connect to host localhost.

 

Any suggestions?Last edited by apiaio on Mon Dec 15, 2008 9:34 pm; edited 2 times in total

----------

## Pliablemammal

That SHOULD still work using the 127.0.0.1, but you could always add an entry to your hosts file, and just to be safe see if your DSL Router supports naming devices via DHCP / ARP Entry

I checked out your router a bit here:

http://www.zyxel.com/web/support_feedback.php

But didn't find much out. It sounds like you'll be port forwarding port 80 tcp/udp right?

You could always setup a dyn dns entry on the router and port forward it that way, using your routers built in firewall rules set, but it's really up to you to read the httpd.conf man page, or get a book from the library to read more about how the virtual hosts portion works.

You really don't even need to use dhcp on your system, you could just input whatever address works with your router as is, that way you wouldn't have to change too much on the router, though either way you will probably have to open a port or DMZ the linux machine.

----------

## apiaio

 *Quote:*   

> That SHOULD still work using the 127.0.0.1

 127.0.0.1 doesn't work *Quote:*   

> , but you could always add an entry to your hosts file

  Should I replace localhost with dhcppc0? *Quote:*   

> and just to be safe see if your DSL Router supports naming devices via DHCP / ARP Entry

 I do not think so.

Concerning httpd.conf I think that it is OK, because it worked before I started to use new router.

I was trying to reserve IP address for my system, but as I have as well WinXP installed on my comp I am not able to reboot into Gentoo after WinXP or vice versa, because the connection

of the first system remains active on the router. I have to restart router and this is not too correct I am afraid. *Quote:*   

> You could always setup a dyn dns entry on the router and port forward it that way, using your routers built in firewall rules set,

 Don't  know too much about firewalls  :Embarassed:  I will have to study this field.Last edited by apiaio on Mon Dec 15, 2008 7:58 pm; edited 1 time in total

----------

## cach0rr0

you could also add a ServerName directive to your apache conf

/etc/apache2/modules.d/00_default_settings.conf:

```

ServerName gentoob0x.mydomain.tld

```

----------

## apiaio

For all which will have similar problem.

This was not "Apache problem", but my problem with the configuration of the new router. I believe, that there exists more solutions, as suggested above, but for the lack of time I have canceled DHCP server,used static routing and now everything works like before. Thanks for advices guys.

----------

