# Apache set-up problems

## amort

I installed apache today and when i went to start it i got [!!] on the side and i can not view the page.

----------

## psomas

when you started it,did you get an error?...

did you properly configure apache after emerging it?...

----------

## elgato319

some output from /var/log/apache/error_log would be nice

----------

## amort

There is no error log and i followed the instructions on the apache gentoo wiki to set it up.  All it told me to do was to emerge it, then two lines in the config file and start apache.

----------

## elgato319

ok, the logfile should be in /var/log/apache2/error_log my mistake.

without some logfiles or error messages it's very hard to determine the problem.

could you check /var/log/messages or something and see if you can find something useful?

----------

## amort

The error log contains this message: 

[Mon Jan 07 00:25:09 2008] [notice] suEXEC mechanism enabled (wrapper: /usr/sbi$

[Mon Jan 07 00:25:09 2008] [alert] (EAI 2)Name or service not known: mod_unique$

Configuration Failed

[Mon Jan 07 00:47:00 2008] [notice] suEXEC mechanism enabled (wrapper: /usr/sbi$

[Mon Jan 07 00:47:00 2008] [alert] (EAI 2)Name or service not known: mod_unique$

Configuration Failed

[Mon Jan 07 00:51:32 2008] [notice] suEXEC mechanism enabled (wrapper: /usr/sbi$

[Mon Jan 07 00:51:32 2008] [alert] (EAI 2)Name or service not known: mod_unique$

Configuration Failed

[Mon Jan 07 00:53:40 2008] [notice] suEXEC mechanism enabled (wrapper: /usr/sbi$

[Mon Jan 07 00:53:40 2008] [alert] (EAI 2)Name or service not known: mod_unique$

Configuration Failed

[Mon Jan 07 00:59:35 2008] [notice] suEXEC mechanism enabled (wrapper: /usr/sbi$

[Mon Jan 07 00:59:35 2008] [alert] (EAI 2)Name or service not known: mod_unique$

Configuration Failed

----------

## elgato319

do you start anything that needs mod_unique_id?

the error message seems to be cut off, could you post the rest of it (the right side)

could you do "/etc/init.d/apache2 configtest" as well as "/etc/init.d/apache2 modules" and post the output?

----------

## amort

This the full message in the error log that was repeated.

[Sun Jan 06 22:15:47 2008] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)

[Sun Jan 06 22:15:47 2008] [alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "server"

Configuration Failed

# /etc/init.d/apache2 modules

Loaded Modules:

 core_module (static)

 mpm_prefork_module (static)

 http_module (static)

 so_module (static)

 actions_module (shared)

 alias_module (shared)

 auth_basic_module (shared)

 authn_anon_module (shared)

 authn_dbd_module (shared)

 authn_dbm_module (shared)

 authn_default_module (shared)

 authn_file_module (shared)

 authz_dbm_module (shared)

 authz_default_module (shared)

 authz_groupfile_module (shared)

 authz_host_module (shared)

 authz_owner_module (shared)

 authz_user_module (shared)

 autoindex_module (shared)

 cgi_module (shared)

 dbd_module (shared)

 deflate_module (shared)

 dir_module (shared)

 env_module (shared)

 expires_module (shared)

 ext_filter_module (shared)

 filter_module (shared)

 headers_module (shared)

 ident_module (shared)

 imagemap_module (shared)

 include_module (shared)

 info_module (shared)

 log_config_module (shared)

 logio_module (shared)

 mime_module (shared)

 mime_magic_module (shared)

 negotiation_module (shared)

 rewrite_module (shared)

 setenvif_module (shared)

 speling_module (shared)

 ssl_module (shared)

 status_module (shared)

 suexec_module (shared)

 unique_id_module (shared)

 usertrack_module (shared)

 vhost_alias_module (shared)

Syntax OK

# /etc/init.d/apache2 configtest

 * Checking Apache Configuration ...                                      [ ok ]

----------

## elgato319

thanks

could you show us your /etc/hosts?

it seems there is no entry for "server"

something like:

```

<your-ip-address>  server

```

----------

## amort

# /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.)

#

This computer's ip address is 192.168.1.75 for my home network.

----------

## alienjon

Do you know what modules you are loading? Check your apache2.conf / apache.conf files for this.

----------

## amort

This is from the httpd.conf file:

LoadModule actions_module modules/mod_actions.so

LoadModule alias_module modules/mod_alias.so

LoadModule auth_basic_module modules/mod_auth_basic.so

<IfDefine AUTH_DIGEST>

LoadModule auth_digest_module modules/mod_auth_digest.so

</IfDefine>

LoadModule authn_anon_module modules/mod_authn_anon.so

LoadModule authn_dbd_module modules/mod_authn_dbd.so

LoadModule authn_dbm_module modules/mod_authn_dbm.so

LoadModule authn_default_module modules/mod_authn_default.so

LoadModule authn_file_module modules/mod_authn_file.so

LoadModule authz_dbm_module modules/mod_authz_dbm.so

LoadModule authz_default_module modules/mod_authz_default.so

LoadModule authz_groupfile_module modules/mod_authz_groupfile.so

LoadModule authz_host_module modules/mod_authz_host.so

LoadModule authz_owner_module modules/mod_authz_owner.so

LoadModule authz_user_module modules/mod_authz_user.so

LoadModule autoindex_module modules/mod_autoindex.so

<IfDefine CACHE>

LoadModule cache_module modules/mod_cache.so

</IfDefine>

LoadModule cgi_module modules/mod_cgi.so

<IfDefine DAV>

LoadModule dav_module modules/mod_dav.so

</IfDefine>

<IfDefine DAV>

LoadModule dav_fs_module modules/mod_dav_fs.so

</IfDefine>

<IfDefine DAV>

LoadModule dav_lock_module modules/mod_dav_lock.so

</IfDefine>

LoadModule dbd_module modules/mod_dbd.so

LoadModule deflate_module modules/mod_deflate.so

LoadModule dir_module modules/mod_dir.so

<IfDefine CACHE>

LoadModule disk_cache_module modules/mod_disk_cache.so

</IfDefine>

LoadModule env_module modules/mod_env.so

LoadModule expires_module modules/mod_expires.so

LoadModule ext_filter_module modules/mod_ext_filter.so

<IfDefine CACHE>

LoadModule file_cache_module modules/mod_file_cache.so

</IfDefine>

LoadModule filter_module modules/mod_filter.so

LoadModule headers_module modules/mod_headers.so

LoadModule ident_module modules/mod_ident.so

LoadModule imagemap_module modules/mod_imagemap.so

LoadModule include_module modules/mod_include.so

<IfDefine INFO>

LoadModule info_module modules/mod_info.so

</IfDefine>

LoadModule log_config_module modules/mod_log_config.so

LoadModule logio_module modules/mod_logio.so

<IfDefine CACHE>

LoadModule mem_cache_module modules/mod_mem_cache.so

</IfDefine>

LoadModule mime_module modules/mod_mime.so

LoadModule mime_magic_module modules/mod_mime_magic.so

LoadModule negotiation_module modules/mod_negotiation.so

<IfDefine PROXY>

LoadModule proxy_module modules/mod_proxy.so

</IfDefine>

<IfDefine PROXY>

LoadModule proxy_ajp_module modules/mod_proxy_ajp.so

</IfDefine>

<IfDefine PROXY>

LoadModule proxy_balancer_module modules/mod_proxy_balancer.so

</IfDefine>

<IfDefine PROXY>

LoadModule proxy_connect_module modules/mod_proxy_connect.so

</IfDefine>

<IfDefine PROXY>

LoadModule proxy_http_module modules/mod_proxy_http.so

</IfDefine>

LoadModule rewrite_module modules/mod_rewrite.so

LoadModule setenvif_module modules/mod_setenvif.so

LoadModule speling_module modules/mod_speling.so

<IfDefine SSL>

LoadModule ssl_module modules/mod_ssl.so

</IfDefine>

<IfDefine INFO>

LoadModule status_module modules/mod_status.so

</IfDefine>

<IfDefine SUEXEC>

LoadModule suexec_module modules/mod_suexec.so

</IfDefine>

LoadModule unique_id_module modules/mod_unique_id.so

<IfDefine USERDIR>

LoadModule userdir_module modules/mod_userdir.so

</IfDefine>

LoadModule usertrack_module modules/mod_usertrack.so

LoadModule vhost_alias_module modules/mod_vhost_alias.so

----------

## alienjon

Unfortunately, this is only putting 2 and 2 together for you. I'm not sure if I can help come up with 4 or not but here goes:

Your actual error states:

```
Name or service not known: mod_unique_id: unable to find IPv4 address of "server"
```

I find this a little ambiguous because I'm not sure if it's trying to say that it can't find the service or (as is what I'm leaning towards) it can find the service, but the service can't find your 'server' correctly.

```
LoadModule unique_id_module modules/mod_unique_id.so 
```

Here is where this module is loaded in your httpd.conf file, so, as a non-apache guru, I'd recommend checking to make sure this file exists on your system and, if not, try commenting out this line in the file and then restarting apache. (Actually, you could try commenting it out anyway, but I don't know what the module does, so it may disable something important)

----------

## elgato319

@amort

please add

```

192.168.1.75   server

```

to your /etc/hosts

than restart apache

i think this will solve the problem

----------

## amort

Thanks, that got it working.

----------

## amort

Now that apache is starting I changed the port for apache to listen to, to 8080 and i get this error:

Forbidden

You don't have permission to access / on this server.

--------------------------------------------------------------------------------

Apache Server at 192.168.1.75 Port 8080

I could view it when it was on port 80 but port 80 is blocked by my isp.

----------

## elgato319

Did you forget change the virtualhosts settings?

```

Listen 80

# Use name-based virtual hosting.

NameVirtualHost *:80

<VirtualHost *:80>

        Include /etc/apache2/vhosts.d/default_vhost.include

        <IfModule mpm_peruser_module>

                ServerEnvironment apache apache

        </IfModule>

</VirtualHost>

```

----------

