# Apache Startup Problem

## emollon

Hi, I´ve installed an Apache2 webserver and everything worked fine but when i try to start it it doesn´t start succefully.... then i try to give a

```
/etc/init.d/apache2 status
```

and it gives me this ouput

```
migentoo etc # /etc/init.d/apache2 status

 * status:  stopped

Looking up localhost

Making HTTP connection to localhost

socket failed: family 10 addr ::1 port 80.

Alert!: Unable to connect to remote host.

lynx: Can't access startfile http://localhost/server-status

```

Anyone know why i got this message? should i reemerge it?

----------

## RayDude

 *emollon wrote:*   

> Hi, I´ve installed an Apache2 webserver and everything worked fine but when i try to start it it doesn´t start succefully.... then i try to give a
> 
> ```
> /etc/init.d/apache2 status
> ```
> ...

 

First off, what does it say when you try: `/etc/init.d/apache2 start`?

What does the error log say?

```
tail /var/log/apache2/error_log
```

That should give you some clues as to the problem.

It sounds like your hosts file might not be correct. You must have Fully Qualified Domain Name specified in /etc/hosts. This is a bit tricky if you are using DHCP.

Please reply with the info I asked for, hopefully there will be more clues.

Raydude

----------

## emollon

Hello, thanks for you reply... actually this machine it comes from a virtual machine in a vmware.

here is my /etc/hosts

```

# IPv4 and IPv6 localhost aliases

127.0.0.1       migentoo localhost

::1     localhost

#

```

then i try to startup the apache service and gives me this warm

```

migentoo ~ # /etc/init.d/apache2 start

 * Starting apache2 ...                                                   [ !! ]

migentoo ~ # /etc/init.d/apache2 status

 * status:  stopped

Looking up localhost

Making HTTP connection to localhost

socket failed: family 10 addr ::1 port 80.

Alert!: Unable to connect to remote host.

lynx: Can't access startfile http://localhost/server-status

migentoo ~ #

```

also here is my error log

```

migentoo ~ # tail /var/log/apache2/error_log

[Tue Oct 30 19:10:41 2007] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)

[Tue Oct 30 19:10:41 2007] [alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "migentoo"

Configuration Failed

[Tue Oct 30 20:05:13 2007] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)

[Tue Oct 30 20:05:13 2007] [alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "migentoo"

Configuration Failed

```

this is because i gived the ip adress with this sentence? 

```
ifconfig eth0 192.168.126.128 broadcast 192.168.126.255 netmask 255.255.255.0 up
```

witch is the file to edit to give the static ip adress?

thanks for your help.

----------

## RayDude

If you're running a fixed IP (version 4 only) then you should change your hosts file to look like this:

```
192.168.126.128 migentoo.<your_domain>.<ext> migentoo

# IPv4 localhost aliases

127.0.0.1       localhost
```

So it may look like this:

```
192.168.126.128 migentoo.org migentoo

# IPv4 and IPv6 localhost aliases

127.0.0.1       localhost
```

I think you must use a fully qualified domain name in your hosts file and it must match the one in httpd.conf next to the "ServerName" keyword.

I haven't tried to get it working without FQDN.

To do it with dhcp I think it would be like this (but am not sure)

```
# IPv4 and IPv6 localhost aliases

127.0.0.1       migentoo.org localhost
```

I'm not positive that will work mind you, you need to google FQDN syntax for hosts files.

Please also note that all this information must match the rest of the data in /etc/conf.d/net and /etc/conf.d/hostname and /etc/conf.d/dnsdomainname (if you have one, I think that's now gone).

Also remember /etc/resolve.conf must be correct...

I think this is why apache won't start.

Raydude

PS as for where to specify fixed IP:

/etc/conf.d/net:

```
config_eth0=( "192.168.0.1/24" )

routes_eth0=("default via 192.168.0.254")
```

Note: these are my IPs, yours are different.

----------

