# After update Apache2 will not stop/restart, Strange Error

## cayenne

Hello all,

I just updated Apache2.

I tried to restart and it failed saying there was:

```
/etc/init.d/apache2 restart

 * apache2 has detected an error in your setup:

Syntax error on line 110 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

 * ERROR: apache2 failed to stop
```

I get basically the same answer from configtest:

```
apache2ctl configtest

 * Checking apache2 configuration ...

 * apache2 has detected an error in your setup:

Syntax error on line 110 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   
```

Looking at the offending section of /etc/apache2/modules.d/00_default_settings.conf...just the default settings at this point, so not sure the problem. I'm just now getting ready to start locking things down, but haven't so far. this is the default setting for this file...?

```

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

<Directory />

        Options FollowSymLinks

        AllowOverride None

        Order deny,allow    <-----------This is line 110 that it says has the error

        Deny from all

</Directory>

```

Any thoughts?

Thanks in advance,

cayenne

----------

## eccerr0r

Thanks for being the guinea pig :)  I'm sure I'll run into this sooner or later.

It looks like you will need to build mod_access_compat to use the "Order" command now, but it seems to have been deprecated by the new authz_host module, which I will need to look at when I have the time...

----------

## cayenne

Ok...I resolved it, but it still leaves me with questions.

Mostly my question now is...where do you SET what modules you want for apache?

My trouble came because I was assuming it was in the APACHE2_MODULES portion of the make.conf file.

I was wanting to make sure I got mod_rewrite in as a module, I need it for a wordpress functionality I want.

When I was looking at just doing install of apache default it would show me:

```
emerge --ask apache

!!! SYNC setting found in make.conf.

    This setting is Deprecated and no longer used.  Please ensure your 'sync-type' and 'sync-uri' are set correctly in /etc/portage/repos.conf/gentoo.conf

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild   R    ] www-servers/apache-2.2.31  APACHE2_MODULES="actions* alias* auth_basic* authn_alias* authn_anon* authn_dbm* authn_default* authn_file* authz_dbm* authz_default* authz_groupfile* authz_owner* authz_user* autoindex* cache* cgi* cgid* 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* setenvif* speling* status* unique_id* userdir* usertrack* vhost_alias*" 

```

Ok...in this, I did NOT see rewrite listed....

So, in my make.conf  I added in:

APACHE2_MODULES="rewrite"

I was thinking it would do the default modules...and add rewrite to the list of modules.  This proved not to be the case..and it basically dropped ALL modules.

This included the dropping of the "authz_host"  module...

And this appeared to be the cause of the problem.

I removed the APACHE2_MODULES portion of the make.conf file....and re-emerged with defaults and it now works.

I was able to restart apache.

THEN...I really got surprised. I check to see the modules:

```

apache2ctl 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_alias_module (shared)

 authn_anon_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)

 cgid_module (shared)

 deflate_module (shared)

 dir_module (shared)

 env_module (shared)

 expires_module (shared)

 ext_filter_module (shared)

 filter_module (shared)

 headers_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)  <--------Now it appears to be installed?

 setenvif_module (shared)

 speling_module (shared)

 ssl_module (shared)

 unique_id_module (shared)

 usertrack_module (shared)

 vhost_alias_module (shared)

 php5_module (shared)

Syntax OK

```

Surprisingly to me, is that rewrite is now showing up.

So, my questions are:

How did rewrite get in there...when it didn't show as a module to be installed with emerge?

How does one tell portage exactly what modules to include? How do you exclude or include one specifically from the default?

If not using the APACHE2_MODULES designator in make.conf...where is it setting the defaults?

Like I said, it is working and apparently I have the module I want...with possibly others I don't need....so, I'm back to working, but I'm puzzled how to better control this and where the default module decisions are being made....what file can I adjust for this?

Just looked to add to my confusion...it doesn't appear mod_rewrite is in the modules.d directory..so, is it in Apache or not?

```
pwd

/etc/apache2/modules.d

modules.d # ls -l

total 68

-rw-r--r-- 1 root root 5339 Aug 20 11:17 00_default_settings.conf

-rw-r--r-- 1 root root 2533 Aug 20 11:17 00_error_documents.conf

-rw-r--r-- 1 root root 5040 Aug 20 11:17 00_languages.conf

-rw-r--r-- 1 root root 2896 Aug 20 11:17 00_mod_autoindex.conf

-rw-r--r-- 1 root root  265 Aug 20 11:17 00_mod_info.conf

-rw-r--r-- 1 root root 1518 Aug 20 11:17 00_mod_log_config.conf

-rw-r--r-- 1 root root 2173 Aug 20 11:17 00_mod_mime.conf

-rw-r--r-- 1 root root  498 Aug 20 11:17 00_mod_status.conf

-rw-r--r-- 1 root root 1043 Aug 20 11:17 00_mod_userdir.conf

-rw-r--r-- 1 root root 2904 Aug 20 11:17 00_mpm.conf

-rw-r--r-- 1 root root  206 Aug 20 11:17 10_mod_mem_cache.conf

-rw-r--r-- 1 root root 2650 Aug 20 11:17 40_mod_ssl.conf

-rw-r--r-- 1 root root  758 Aug 20 11:17 45_mod_dav.conf

-rw-r--r-- 1 root root  446 Aug 20 11:17 46_mod_ldap.conf

-rw-r--r-- 1 root root  486 Apr 24 16:30 70_mod_php5.conf

```

Thanks in advance,

cayenne

----------

