# Apache doesn't starts

## DeIM

Hi I have problem with Apache (2.2.11-r2)

/etc/init.d/apache2 reload

 * Gracefully restarting apache2 ...

httpd not running, trying to start                                        [ !! ]

but httpd doesn't starts

less /var/log/apache2/error_log:

[Sun Sep 06 15:29:45 2009] [crit] (38)Function not implemented: mod_rewrite: could not create rewrite_log_lock

Configuration Failed

httpd.conf:

ServerRoot "/usr/lib64/apache2"

LoadModule actions_module modules/mod_actions.so

LoadModule alias_module modules/mod_alias.so

LoadModule auth_basic_module modules/mod_auth_basic.sofiguration file

LoadModule authn_alias_module modules/mod_authn_alias.so

LoadModule authn_anon_module modules/mod_authn_anon.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 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 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

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 STATUS>

LoadModule status_module modules/mod_status.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

User apache

Group apache

Include /etc/apache2/modules.d/*.conf

Include /etc/apache2/vhosts.d/*.conf

ServerName phobos

default_vhost.include:

DocumentRoot "/var/www/localhost/htdocs"

<Directory "/var/www/localhost/htdocs">

       Options Indexes FollowSymLinks

       Order allow,deny

        Allow from all

</Directory>

<IfModule alias_module>

       ScriptAlias /cgi-bin/ "/var/www/localhost/cgi-bin/"

</IfModule>

<Directory "/var/www/localhost/cgi-bin">

        AllowOverride None

        Options None

        Order allow,deny

        Allow from all

</Directory>

00_default_vhost.conf:

<IfDefine DEFAULT_VHOST>

Listen 80

NameVirtualHost localhost:80

<VirtualHost localhost:80>

        ServerName localhost

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

        <IfModule mpm_peruser_module>

                ServerEnvironment apache apache

        </IfModule>

</VirtualHost>

</IfDefine>

don't know where is the problem

Thanx for any help

----------

## beerbellyswan

i had a similar problem and was able to isolate the bad configuration through process of elimination (it helped understand the nested vhosts configuration as well).  i think i would try commenting out the vhosts.d conf files first to see if the problem is the

```

vim httpd.conf

Change

Include /etc/apache2/vhosts.d/*.conf 

to

#Include /etc/apache2/vhosts.d/*.conf

```

if you still get the problem, start commenting out the LoadModules.  it can be tedious - but it should definately help

----------

## DeIM

I tried to # almost every module and get:

 /etc/init.d/apache2 reload

 * Gracefully restarting apache2 ...

httpd not running, trying to start                                        [ ok ]

but port 80 is not listening.

it's the same with 

```
#Include /etc/apache2/vhosts.d/*.conf  
```

or

```
Include /etc/apache2/vhosts.d/*.conf  
```

----------

## beerbellyswan

you need to check the /var/log/apache2/error_log again.  at any rate, from your previous post, it looks like this is your culprit:

LoadModule rewrite_module modules/mod_rewrite.so 

try commenting that out

----------

## Mike Hunt

Is your firewall accepting connections on port 80?

----------

## DeIM

 *beerbellyswan wrote:*   

> you need to check the /var/log/apache2/error_log again.  at any rate, from your previous post, it looks like this is your culprit:
> 
> LoadModule rewrite_module modules/mod_rewrite.so 
> 
> try commenting that out

 

first I get:

```
[Sun Sep 06 17:59:54 2009] [alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "phobos"

Configuration Failed

```

tried comment out mod_unique_id and error_log says:

```
[Sun Sep 06 18:01:37 2009] [warn] pid file /var/run/apache2.pid overwritten -- Unclean shutdown of previous Apache run?

[Sun Sep 06 18:01:37 2009] [emerg] (38)Function not implemented: Couldn't create accept lock (/var/run/accept.lock.4873) (5)

```

----------

## Mike Hunt

Is your /etc/hosts correctly configured?

----------

## DeIM

 *Mike Hunt wrote:*   

> Is your /etc/hosts correctly configured?

 

```
192.168.1.2     phobos

127.0.0.1       localhost

/etc/host lines 1-2/2 (END)

```

----------

## Mike Hunt

That doesn't look right because you have no FQDN in there

it should look something like this

```
127.0.0.1       localhost.localdomain   localhost

192.168.1.2     phobos.at.myplace        phobos 
```

PS you can change .at.myplace to whatever you like or need.  :Smile: 

then run

```
hostname phobos && hostname -f
```

----------

## richermartyn

If your Apache doesn't start You have to go to it's service than after right click on the Apache and start the service than open the Apache server it will work.

----------

## xaviermiller

 *richermartyn wrote:*   

> If your Apache doesn't start You have to go to it's service than after right click on the Apache and start the service than open the Apache server it will work.

 

Erm... you are on Gentoo Linux, not Windows  :Laughing: 

----------

## richard.scott

Do you have unique_id in your APACHE2_MODULES in /etc/make.conf?

----------

## DeIM

```
phobos ~ # hostname

phobos

phobos ~ # hostname -f

hostname: unknown computer

phobos ~ # domainname

(none)

```

/etc/host:

```

127.0.0.1 localhost.razor localhost

192.168.1.2 phobos.razor phobos

```

I've commented out in /etc/conf.d/net but nothing changed

```
dns_domain_lo="razor"

```

I've nothing in APACHE2_MODULES in /etc/make.conf

but eix apache shows, that most of modules was included in emerging.

/var/log/apache2/error_log:

```
[emerg] (38)Function not implemented: Couldn't create accept lock (/var/run/accept.lock.3809) (5)
```

----------

