# [solved] new apache-2.2.6-r7 fails on AddDirectoryIndex

## njuk-njuk

i am getting the following on a clean install of apache-2.2.6-r7 when i try to start it up...

```
 * Apache2 has detected a syntax error in your configuration files:

Syntax error on line 17 of /etc/apache2/modules.d/70_mod_php5.conf:

Invalid command 'AddDirectoryIndex', perhaps misspelled or defined by a module not included in the server configuration
```

i am assuming i have something missing in the build.  here are my related settings for apache...

(make.conf)

```
APACHE2_MODULES="authz_host dir mime"

APACHE2_MPMS="worker"

USE="doc ssl threads"
```

(in /etc/conf.d/apache2)

```
APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D LANGUAGE -D MANUAL -D SSL -D SSL_DEFAULT_VHOST -D PHP5 -D PYTHON"
```

any help appreciated.Last edited by njuk-njuk on Sun Feb 03, 2008 3:15 am; edited 1 time in total

----------

## OmSai

Here's your problem, your APACHE2_MODULES is incomplete.

```
APACHE2_MODULES="authz_host dir mime" 

APACHE2_MPMS="worker" 

USE="doc ssl threads"
```

Mine looks like:

```
APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias"
```

You have to move all modules over to APACHE2_MODULES in your /etc/make.conf

To do that, run Code Listing 1.1 from the Gentoo guide: Upgrading Apache.

----------

## njuk-njuk

 *om wrote:*   

> You have to move all modules over to APACHE2_MODULES in your /etc/make.conf
> 
> To do that, run Code Listing 1.1 from the Gentoo guide: Upgrading Apache.

 

thanks, om.  i actually saw that in the upgrade guide; however, since this was a clean install i didn't have any /etc/apache2/apache2-builtin-mods from which to work.  after you convinced me this was needed, i pulled a copy of this file from a similar system that still has the older version of apache.  i'm up and running now.

----------

## OmSai

njuk-njuk,

Since you've established that that was the workaround, could you please file your situation on Gentoo Bugzilla?

Your situation should not have occurred on a fresh install of Apache.

I ran the advanced search, and no-one has reported the problem yet.

----------

## njuk-njuk

 *om wrote:*   

> njuk-njuk,
> 
> Since you've established that that was the workaround, could you please file your situation on Gentoo Bugzilla?
> 
> Your situation should not have occurred on a fresh install of Apache.
> ...

 

ok created Bug #208700 (albeit a bit messy of a description since i wasn't sure what steps i performed in what order).

----------

## njuk-njuk

ah, after posting the bug they responded with the fact that it is likely a result of using '-*' in make.conf.  as they state, there are sane APACHE2_MODULES defaults in the profile.  i do use '-*' which affects the use of these variables from the default profiles.  my bad.

----------

## rmcknt

I'm having the exact problem here as well. Apache tells me that a module is missing when trying to use AddDirectoryIndex

So Which Module provides AddDirectoryIndex?

Here's my apache config

```
[ebuild   R   ] www-servers/apache-2.2.8-r1  USE="ssl suexec threads -debug -doc -ldap (-selinux) -sni -static" APACHE2_MODULES="actions alias auth_basic auth_digest authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dbd deflate dir disk_cache ext_filter file_cache filter headers include info log_config mem_cache mime mime_magic rewrite setenvif status unique_id vhost_alias -asis -authn_alias -authn_anon -authn_dbd -cern_meta -charset_lite -dav -dav_fs -dav_lock -dumpio -env -expires -ident -imagemap -log_forensic -logio -negotiation -proxy -proxy_ajp -proxy_balancer -proxy_connect -proxy_ftp -proxy_http -speling -userdir -usertrack -version" APACHE2_MPMS="worker -event -itk -peruser -prefork"
```

----------

## rmcknt

Seems like AddDirectoryIndex has been depracted and removed.

https://bugs.gentoo.org/show_bug.cgi?id=139451

----------

## OmSai

Spin-Doc,

Did you emerge --sync before emerging apache2?

Are you upgrading or is it a new install?

 *Spin-Doc wrote:*   

> So Which Module provides AddDirectoryIndex? 

 From njuk-njuk's OP....

* Apache2 has detected a syntax error in your configuration files:

Syntax error on line 17 of /etc/apache2/modules.d/70_mod_php5.conf:

Invalid command 'AddDirectoryIndex', perhaps misspelled or defined by a module not included in the server configuration

----------

## njuk-njuk

 *Spin-Doc wrote:*   

> I'm having the exact problem here as well. Apache tells me that a module is missing when trying to use AddDirectoryIndex
> 
> So Which Module provides AddDirectoryIndex?
> 
> Here's my apache config
> ...

 

i originally used an old /etc/apache2/apache2-builtin-mods to generate my APACHE2_MODULES but eventually reverted to the base defaults in /usr/portage/profiles/base/make.defaults (shown below).  to be honest, i don't know which one deals with the AddDirectoryIndex directive; however, upon using these i was able to get apache to run.

```
# Benedikt Böhm <hollow@gentoo.org> (27 Nov 2007)

# Sane defaults for built-in apache modules

APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias"

```

----------

## kkrizka

I tried enabling all of the apache modules,  but that did not solve the problem. Any other tips? I am running Apache 2.2.8-r1.

----------

## qQsh

 *kkrizka wrote:*   

> I tried enabling all of the apache modules,  but that did not solve the problem. Any other tips? I am running Apache 2.2.8-r1.

 Run etc-update or dispatch-conf or just change AddDirectoryIndex to DirectoryIndex .

----------

## cjubon

Same problem here (one week ago, I saw this thread just now).

Yep, simply solved by changing "AddDirectoryIndex" to "DirectoryIndex" in the relevant file (/etc/apache2/modules.d/70_mod_php5.conf, in my case).

However, some docs hidden in the default config files need an update, as well:  *grep AddDirectoryIndex /etc/apache2/modules.d/* wrote:*   

> ...
> 
> /etc/apache2/modules.d/00_default_settings.conf:# To add files to that list use AddDirectoryIndex in a custom config
> 
> ...

  I'm not sure whether to report this doc-issue in one of the bug reports cited here.

----------

## orange_juice

 *cjubon wrote:*   

> Yep, simply solved by changing "AddDirectoryIndex" to "DirectoryIndex" in the relevant file (/etc/apache2/modules.d/70_mod_php5.conf, in my case).

 

Kind regards,

orange_juice

----------

