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>
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?
# 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
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.
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)
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.
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.
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)
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.
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: