# syntax error in apache after world update

## manji_

After a world update , i got this error when trying to run apache:

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

Syntax error on line 81 of /etc/apache2/modules.d/00_default_settings.conf:

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

The lines in the file containing the error are:

```
# LogLevel: Control the number of messages logged to the error_log.

# Possible values include: debug, info, notice, warn, error, crit,

# alert, emerg.

LogLevel warn

# We configure the "default" to be a very restrictive set of features.

<Directory />

        Options FollowSymLinks

        AllowOverride None

        Order deny,allow

        Deny from all

</Directory>

# DirectoryIndex: sets the file that Apache will serve if a directory

# is requested.
```

I read somewhere that some modules must not have been loaded, so if it helps, here is this section from httpd.conf:

```
# Change these at your own risk!

<IfDefine AUTHNZ_LDAP>

LoadModule authnz_ldap_module modules/mod_authnz_ldap.so

</IfDefine>

LoadModule cgi_module modules/mod_cgi.so

<IfDefine LDAP>

LoadModule ldap_module modules/mod_ldap.so

</IfDefine>

<IfDefine SSL>

LoadModule ssl_module modules/mod_ssl.so

</IfDefine>
```

Can someone plz help me?

----------

## linear

What about this module?  Is it being loaded too?  This module controls the Order config.

```
LoadModule access_module                 modules/mod_access.so
```

In fact, in the version of one of our apache servers, the httpd.conf file says:

```
### Dynamic Shared Object (DSO) Support

###

### You should always leave these three, as they are needed for normal use.

### mod_access (Order, Allow, etc..)

### mod_log_config (Transferlog, etc..)

### mod_mime (AddType, etc...)

###
```

HTH.  Let us know...

/bk

----------

## manji_

Sorry but I am not so familiar with these. Could you please tell me what I should do? Should I add a line in httpd.conf?

----------

## manji_

And here is something I don't get. I followed the instructions in http://www.gentoo.org/doc/en/apache-upgrading.xml doing:

```
$ echo APACHE2_MODULES=\"$(sed '/^mod_/s/mod_\(.*\)\s\+\(shared\|static\)/\1/;t n;d;:n' /etc/apache2/apache2-builtin-mods)\" >> /etc/make.conf

# rm /etc/apache2/apache2-builtin-mods
```

So now my /etc/make.conf file has the line

```
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 useid userdir usertrack vhost_alias"
```

Now, when i try to update apache, I get this:

```
[ebuild  N    ] www-servers/apache-2.2.6-r7  USE="ldap ssl -apache2_modules_actions -apache2_modules_alias -apache2_modules_asis -apache2_modules_auth_basic -apache2_modules_auth_digest -apache2_modules_authn_alias -apache2_modules_authn_anon -apache2_modules_authn_dbd -apache2_modules_authn_dbm -apache2_modules_authn_default -apache2_modules_authn_file -apache2_modules_authz_dbm -apache2_modules_authz_default -apache2_modules_authz_groupfile -apache2_modules_authz_host -apache2_modules_authz_owner -apache2_modules_authz_user -apache2_modules_autoindex -apache2_modules_cache -apache2_modules_cern_meta -apache2_modules_charset_lite -apache2_modules_dav -apache2_modules_dav_fs -apache2_modules_dav_lock -apache2_modules_dbd -apache2_modules_deflate -apache2_modules_dir -apache2_modules_disk_cache -apache2_modules_dumpio -apache2_modules_env -apache2_modules_expires -apache2_modules_ext_filter -apache2_modules_file_cache -apache2_modules_filter -apache2_modules_headers -apache2_modules_ident -apache2_modules_imagemap -apache2_modules_include -apache2_modules_info -apache2_modules_log_config -apache2_modules_log_forensic -apache2_modules_logio -apache2_modules_mem_cache -apache2_modules_mime -apache2_modules_mime_magic -apache2_modules_negotiation -apache2_modules_proxy -apache2_modules_proxy_ajp -apache2_modules_proxy_balancer -apache2_modules_proxy_connect -apache2_modules_proxy_ftp -apache2_modules_proxy_http -apache2_modules_rewrite -apache2_modules_setenvif -apache2_modules_speling -apache2_modules_status -apache2_modules_unique_id -apache2_modules_userdir -apache2_modules_usertrack -apache2_modules_version -apache2_modules_vhost_alias -apache2_mpms_event -apache2_mpms_itk -apache2_mpms_peruser -apache2_mpms_prefork -apache2_mpms_worker -debug -doc (-selinux) -sni -static -suexec -threads" 0 kB
```

(only the first 2 are selected flags)

Shouldn't more of these be selected? Doesn't the new line n make.conf define this flags? Or am i wrong?

----------

## linear

Okay...

I had to check the docs on the Apache website for this one.

In the new version of Apache, if you want to be able to use "Order", "Allow" or "Deny", the new module named mod_authz_host must be loaded.  The rename was documented here.

HTH.  Let us know.

/bk

----------

## manji_

Thank you very much for your concern linear. I will do that, and i wiil post the results.

----------

## tgice

 *linear wrote:*   

> Okay...
> 
> I had to check the docs on the Apache website for this one.
> 
> In the new version of Apache, if you want to be able to use "Order", "Allow" or "Deny", the new module named mod_authz_host must be loaded.  The rename was documented here.
> ...

 

I'm getting a similar problem with apache-2.2.6-r7, apache2ctl configtest fails with:

 *Quote:*   

>  * Checking Apache Configuration ...
> 
>  * Apache2 has detected a syntax error in your configuration files:
> 
> Syntax error on line 83 of /etc/apache2/modules.d/00_default_settings.conf:
> ...

 

I have all of these:

```
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 charset_lite 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 useid userdir usertrack vhost_alias"
```

including authz_host and I'm still getting the error on "Deny".  Anyone else have ideas?

----------

## manji_

i hadn't mentioned it before, but when I tried to emerge the new apache version, I got this message:

```
 Selected default MPM: prefork

 *

 * Module 'authz_host' is required in the default apache configuration.

 * Module 'dir' is required in the default apache configuration.

 * Module 'mime' is required in the default apache configuration.

 *

 * You have disabled one or more required modules

 * for the default apache configuration.

 * Although this is not an error, please be

 * aware that this setup is UNSUPPORTED.

 *

 * Please note that you need SysV IPC support in your kernel.

 * Make sure CONFIG_SYSVIPC=y is set.
```

So it seems that 3 use flags are required. I entered this line in /etc/portage/package.use

```
www-servers/apache apache2_modules_authz_host apache2_modules_dir apache2_modules_mime
```

and i reemerged apache. Everything works as it used to, but I am not sure that this is how it should be done.

----------

## EzMe

I had the same problem as you Manji_ except i had the "order" command error:

```

# /etc/init.d/apache2 start

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

Syntax error on line 81 of /etc/apache2/modules.d/00_default_settings.conf:

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

```

I did the same to fix it tho my prob aint solved yet.. Donno how come 

```

 * Messages for package www-servers/apache-2.2.8:

 *

 * Selected default MPM: prefork

 *

 * Please note that you need SysV IPC support in your kernel.

 * Make sure CONFIG_SYSVIPC=y is set.

 *

 * The default webroot has not been installed into

 * /var/www/localhost because the directory already exists

 * and we do not want to overwrite any files you have put there.

 *

 * If you would like to install the latest webroot, please run

 * emerge --config =apache-2.2.8

 *

 * GNU info directory index is up-to-date.

# emerge --config =apache-2.2.8

Configuring pkg...

 * Installing default webroot to /var/www/localhost

# /etc/init.d/apache2 start

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

Syntax error on line 81 of /etc/apache2/modules.d/00_default_settings.conf:

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

```

while

```

# cat /etc/portage/package.use

www-servers/apache apache2_modules_authz_host apache2_modules_dir apache2_modules_mime

```

and

```

# cat /etc/make.conf

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 proxy"

```

----------

