Apache2 /etc/apache2/mod_log_config error on line #11

Not sure what happened, rebooted my PC, wonder why apache isn’t running… so I tried to start it with “rcapache2 start” as root and get

Starting httpd2 (prefork) Syntax error on line 11 of /etc/apache2/mod_log_config.conf:
Invalid command 'LogFormat', perhaps misspelled or defined by a module not included in the server configuration

The command line was:
/usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
                                                                      failed

So I open up the file in question and don’t see anything wrong with it… though I’ve no clue as to what it should look like.
Contents are as follows:

#
# The following directives define some format nicknames for use with
# a CustomLog directive.
#
# http://httpd.apache.org/docs-2.2/mod/mod_log_config.html
#

#
#         Format string:				Nickname:
#
LogFormat "%h %l %u %t \"%r\" %>s %b"			common
LogFormat "%v %h %l %u %t \"%r\" %>s %b"		vhost_common
LogFormat "%{Referer}i -> %U"				referer
LogFormat "%{User-agent}i"				agent
LogFormat "%h %l %u %t \"%r\" %>s %b \
\"%{Referer}i\" \"%{User-Agent}i\""			combined
LogFormat "%v %h %l %u %t \"%r\" %>s %b \
\"%{Referer}i\" \"%{User-Agent}i\""			vhost_combined

# To use %I and %O, you need to enable mod_logio
<IfModule mod_logio.c>
LogFormat "%h %l %u %t \"%r\" %>s %b \
\"%{Referer}i\" \"%{User-Agent}i\" %I %O"		combinedio
</IfModule>

# Use one of these when you want a compact non-error SSL logfile on a virtual
# host basis:
<IfModule mod_ssl.c>
Logformat "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \
\"%r\" %b"						ssl_common
Logformat "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \
\"%r\" %b \"%{Referer}i\" \"%{User-Agent}i\""		ssl_combined
</IfModule>

Line 11 is the first logFormat (common)

Hi,

The syntax is correct. First of all go to


vi /etc/sysconfig/apache2

and look for the line that begins with


APACHE_MODULES

There must be


log_config

in that line. The vi command you may replace with any other editor you like. :wink:

hth

Bye

Erik

That worked thanks, didn’t get me a whole lot further though

Module "TypesConfig" is not installed, ignoring.
Check the APACHE_MODULES setting in /etc/sysconfig/apache2.
Starting httpd2 (prefork) Syntax error on line 139 of /etc/apache2/httpd.conf:
Invalid command 'TypesConfig', perhaps misspelled or defined by a module not included in the server configuration

The command line was:
/usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf

Tried adding TypesConfig to the same line but that didn’t change anything so I changed it back.
(didn’t really expect it to either seeing as it uses caps as seperators instead of underscores)

Any way to reset the defaults? Think somehow running the command:
aen2mod mod_deflate
and then starting the YaST webserver module messed things up, only got

APACHE_MODULES="deflate php5 config_log"

in /etc/sysconfig/apache2. Think there should be quite a bit more in there?

Hi,


# apache's default installation
# APACHE_MODULES="access actions alias asis auth autoindex cgi dir imap include log_config mime negotiation setenvif         status userdir"

That’s the default in my sysconfig. For TypesConfig you need mod_mime I think. I’m not 100% sure but give it a shot. :wink:

hth

Bye

Erik

Pasted the line and got.

# rcapache2 start
Module "access" is not installed, ignoring.
Check the APACHE_MODULES setting in /etc/sysconfig/apache2.
Module "auth" is not installed, ignoring.
Check the APACHE_MODULES setting in /etc/sysconfig/apache2.
Module "imap" is not installed, ignoring.
Check the APACHE_MODULES setting in /etc/sysconfig/apache2.
Starting httpd2 (prefork) Syntax error on line 10 of /etc/apache2/mod_status.conf:
Invalid command 'Order', perhaps misspelled or defined by a module not included in the server configuration

The command line was:
/usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf

Uff… wonder what’s going on.

If you pasted that line in with the # in front, then it would have no effect, as it’s a comment. You need far more modules than three of four. Look at the sample line provided and use that, adding php5.

Ye, left the comment character out.

I managed to fix it… be it in a somewhat silly way (pulling in 220MB of software for probably some textfile changes).
Set YaST software management to patterns, selected LAMP server and forced a “upgrade unconditionally”.

PHP5 was yet again disabled, so I enabled it via YaST control center > Network Services > HTTP Server. (followed by a rcapache2 restart)

Thanks for the help.

Hi,

Seems your Apache is broken. Order is part of the auth module which is part of the basic installation of Apache. I think the best solution is to reinstall the Apache server and begin from the scratch. You can force the zypper to install the apache again without uninstall it with:


zypper in -f apache2

Make a backup of your config files before doing so.

hth

Bye

Erik

I’m having similar problem. Running openSUSE 11.0 on Lenovo 3000 N100.

I’ve uninstalled and reinstalled apache2 3 times using YAST, to no avail. Installed from YAST:
apache2
apaches-devel
apache2-doc
apache2-example-pages
apache2-mod_Apparmor
apache2-mod_php5
apache2-mod_tidy
apache2-prefork
apache2-utils

This is the response I get when I run “rcapache2 start”:

linux-pczd:/home/eric # rcapache2 start
Module “include” is not installed, ignoring.
Check the APACHE_MODULES setting in /etc/sysconfig/apache2.
Module “log_config” is not installed, ignoring.
Check the APACHE_MODULES setting in /etc/sysconfig/apache2.
Module “status” is not installed, ignoring.
Check the APACHE_MODULES setting in /etc/sysconfig/apache2.
Starting httpd2 (prefork) Syntax error on line 11 of /etc/apache2/mod_log_config.conf:
Invalid command ‘LogFormat’, perhaps misspelled or defined by a module not included in the server configuration

All the supposedly missing modules seem to be installed:

your settings

APACHE_MODULES=“authz_host actions alias auth_basic authz_groupfile authn_file authz_user autoindex cgi dir include log_config mime negotiation setenvif status userdir asis imagemap php5 authz_default”

Make sure that’s one long line, not broken into two lines. Also make sure it’s the only active line that sets APACHE_MODULES and any others are commented out (the last one wins).

I used YAST to uninstall all the apache2 apps and then reinstalled them. When I went to System Services (Runlevel):Services and tried to ennable apache2, I got this message:

/etc/init.d/apache 2 start returned 1 (unspecified error).

I then tried

zypper ln -f apache2

This seemed to successfully download and install apache2-2.2.8-28.4.i586.
Then I got this:

linux-pczd:~ # rcapache2 start
Module “include” is not installed, ignoring.
Check the APACHE_MODULES setting in /etc/sysconfig/apache2.
Module “log_config” is not installed, ignoring.
Check the APACHE_MODULES setting in /etc/sysconfig/apache2.
Module “status” is not installed, ignoring.
Check the APACHE_MODULES setting in /etc/sysconfig/apache2.
Starting httpd2 (prefork) Syntax error on line 11 of /etc/apache2/mod_log_config.conf:
Invalid command ‘LogFormat’, perhaps misspelled or defined by a module not included in the server configuration

The command line was:
/usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf

And I’m still getting the same error when I try to enable apache2 at System Services (Runlevel).

And, yes, the APACHE_MODULES setting is one long line–at any rate when I adjust the width of gedit, the entry adjusts smoothly and doesn’t show any hard returns. And there’s only one un-commented line.

Thanks.

Those syntax errors “include”, “log_config”, etc, probably come from this area of /etc/apache2/httpd.conf:

# generated from APACHE_MODULES in /etc/sysconfig/apache2
Include /etc/apache2/sysconfig.d/loadmodule.conf

# IP addresses / ports to listen on
Include /etc/apache2/listen.conf

# predefined logging formats
Include /etc/apache2/mod_log_config.conf

loadmodule.conf is the one that’s generated from /etc/sysconfig/apache2. Something must have gone wrong to cause a syntax error in loadmodule.conf. Have a look at it and see if you can correlate it to an error in /etc/sysconfig/apache2.

Those three mods (include, log_config, status) are not included in the loadmodule.conf file.

Is there some other place besides APACHE_MODULES to look in apache2 to see if there’s an error?

(Btw, when I used Yast to set up HTTP Server I got some kind of warning about Network Manager. Now when I go to HTTP Server I get a notice that certain files (apache2, default-server.conf, vhosts.d/yast2_vhosts.conf) have been “changed manually” and that “Yast might lose some of the changes.” ??)

Did you configure apache from YAST? Seems like you installed and just tried to start the service. It needs configuring as well. Might be just some PATH statement you’re missing.
Yast2 - Network Services - HTTP server

No, you misunderstand. The main config file httpd.conf includes loadmodule.conf, and then afterwards log_config.conf. If there is a syntax error in loadmodule.conf, that causes the parsing to get confused and affect the next few lines. That’s why I asked you to look at (the generated) loadmodule.conf to see if there is anything visibly amiss. It should contain only lines of the form

LoadModule action_module

and so forth, and comment lines. If there is any garbage in there, it would be due to problems with sysconfig/apache2.

Ken,
The only thing that appears “wrong” is the absence of the desired mods. (I assume that the paths on each line belong there, even tho you didn’t mention them explicitly.)

Files in this directory are created at apache start time by /usr/sbin/rcapache2

Do not edit them!

as listed in APACHE_MODULES (/etc/sysconfig/apache2)

LoadModule suexec_module /usr/lib/apache2-prefork/mod_suexec.so
LoadModule authz_host_module /usr/lib/apache2-prefork/mod_authz_host.so
LoadModule actions_module /usr/lib/apache2-prefork/mod_actions.so
LoadModule alias_module /usr/lib/apache2-prefork/mod_alias.so
LoadModule auth_basic_module /usr/lib/apache2-prefork/mod_auth_basic.so
LoadModule authz_groupfile_module /usr/lib/apache2-prefork/mod_authz_groupfile.so
LoadModule authn_file_module /usr/lib/apache2-prefork/mod_authn_file.so
LoadModule authz_user_module /usr/lib/apache2-prefork/mod_authz_user.so
LoadModule authn_dbm_module /usr/lib/apache2-prefork/mod_authn_dbm.so
LoadModule autoindex_module /usr/lib/apache2-prefork/mod_autoindex.so
LoadModule cgi_module /usr/lib/apache2-prefork/mod_cgi.so
LoadModule dir_module /usr/lib/apache2-prefork/mod_dir.so
LoadModule env_module /usr/lib/apache2-prefork/mod_env.so
LoadModule expires_module /usr/lib/apache2-prefork/mod_expires.so
LoadModule mime_module /usr/lib/apache2-prefork/mod_mime.so
LoadModule negotiation_module /usr/lib/apache2-prefork/mod_negotiation.so
LoadModule setenvif_module /usr/lib/apache2-prefork/mod_setenvif.so
LoadModule userdir_module /usr/lib/apache2-prefork/mod_userdir.so
LoadModule asis_module /usr/lib/apache2-prefork/mod_asis.so
LoadModule imagemap_module /usr/lib/apache2-prefork/mod_imagemap.so
LoadModule ssl_module /usr/lib/apache2-prefork/mod_ssl.so
LoadModule php5_module /usr/lib/apache2/mod_php5.so
LoadModule authz_default_module /usr/lib/apache2-prefork/mod_authz_default.so

Thanks.

What’s the modification time on loadmodule.conf? Is it around the time you started the apache2 service? I suspect it’s not parsing sysconfig/apache2 at all, and not generating that file, which is why your modules are missing. Do this:

rpm -V apache2

That will check if there are any discrepancies between the contents of the package and what is on disk. (One or two changes are expected.) I’m thinking maybe some of your package files got corrupted and were not reinstalled.

Ken,
I rebooted the computer and re-ran “rcapache2 start.” Got the same errors about mods not being installed.

The modification time on loadmodule.conf looked right (8:30 EDT, 11 May).

The rpm -V gave this result;

linux-pczd:~ # rpm -V apache2
S.5…T c /etc/apache2/default-server.conf
S.5…T c /etc/sysconfig/SuSEfirewall2.d/services/apache2

Thanks.

That’s fine, those two changes are expected.

Are you on 32-bit arch? I hope you are not mixing 64 and 32 bit packages.

Somehow /etc/sysconfig/apache2 isn’t having any effect, as you say your modules don’t show up in loadmodule.conf. Rename or delete sysconfig/apache2 and then use YaST to reconfigure the set of modules. Before you do that, try:

diff /var/adm/fillup-templates/sysconfig.apache2 /etc/sysconfig/apache2

There should be only one line of significant difference.

Ken,

No 64-bit programs that I’m aware of.

Here’s the result from the diff command:

linux-pczd:~ # diff /var/adm/fillup-templates/sysconfig.apache2 /etc/sysconfig/apache2
3d2
<
85c84
< APACHE_MODULES=“actions alias auth_basic authn_file authz_host authz_groupfile authz_default authz_user authn_dbm autoindex cgi dir env expires include log_config mime negotiation setenvif ssl suexec userdir php5”

> APACHE_MODULES=“suexec authz_host actions alias auth_basic authz_groupfile authn_file authz_user authn_dbm autoindex cgi dir env expires include log_config mime negotiation setenvif status userdir asis imagemap ssl php5 authz_default”
115c114
< APACHE_SERVER_FLAGS=“”

> APACHE_SERVER_FLAGS=“SSL”
281d279

Would I use the HTTP Server interface to reconfigure the modules?

Thanks