Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 180704 - net-www/apache-2.2 configtest and apache2 -t gives conflicting answers
Summary: net-www/apache-2.2 configtest and apache2 -t gives conflicting answers
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Apache Team - Bugzilla Reports
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-03 09:49 UTC by Caleb Cushing
Modified: 2007-06-15 15:20 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Caleb Cushing 2007-06-03 09:49:31 UTC
* Caching service dependencies ...                                            
                                                                               
  [ ok ]
 * Checking Apache Configuration ...
 * Apache2 has detected a syntax error in your configuration files:            
                                                                               
  [ !! ]
slave7 pc # apache2 -t
Syntax OK

it's this in one of my vhosts files

    <IfDefine SUEXEC>
        SuexecUserGroup regen2 users
    </IfDefine>

I don't see anything wrong with this.... if it is wrong can we please get more verbose output as to where the problem is and what is wrong with it? in this case I found it quickly because I had just been editing this file.

Reproducible: Always
Comment 1 Christian Heim (RETIRED) gentoo-dev 2007-06-03 12:42:40 UTC
(In reply to comment #0)
> * Caching service dependencies ...                                            
> 
>   [ ok ]
>  * Checking Apache Configuration ...
>  * Apache2 has detected a syntax error in your configuration files:            
> 
>   [ !! ]
> slave7 pc # apache2 -t
> Syntax OK
> 
> it's this in one of my vhosts files
> 
>     <IfDefine SUEXEC>
>         SuexecUserGroup regen2 users
>     </IfDefine>

It gives you that error, because if you call it directly, you'll have to pass the -D switches from your /etc/conf.d/apache2 to apache yourself.

Something like apache2 -D SUEXEC -t should fix that.

Comment 2 Christian Heim (RETIRED) gentoo-dev 2007-06-03 13:02:45 UTC
Could you provide your /etc/conf.d/apache2 ?
Comment 3 Caleb Cushing 2007-06-03 19:21:29 UTC
APACHE2_OPTS="-D USERDIR -D DEFAULT_VHOST -D INFO -D LANGUAGE -D SSL -D SSL_DEFAULT_VHOST -D SUEXEC -D PHP5 -D ERRORDOCS"

# Extended options for advanced uses of Apache ONLY
# You don't need to edit these unless you are doing crazy Apache stuff
# As not having them set correctly, or feeding in an incorrect configuration
# via them will result in Apache failing to start
# YOU HAVE BEEN WARNED.

# ServerRoot setting
#SERVERROOT=/usr/lib/apache2

# Configuration file location
# - If this does NOT start with a '/', then it is treated relative to
# $SERVERROOT by Apache
CONFIGFILE=/etc/apache2/httpd.conf

# Location to log startup errors to
# They are normally dumped to your terminal.
STARTUPERRORLOG="/var/log/apache2/startuperror.log"

# A command that outputs a formatted text version of the HTML at the URL
# of the command line. Designed for lynx, however other programs may work.
LYNX="links -dump"

# The URL to your server's mod_status status page.
# Required for status and fullstatus
STATUSURL="http://slave-network.org/server-status"

# Method to use when reloading the server
# Valid options are 'restart' and 'graceful'
# See http://httpd.apache.org/docs/2.2/stopping.html for information on
# what they do and how they differ.
RELOAD_TYPE="graceful"


as you can see I have -D SUEXEC in my options. 
Comment 4 Caleb Cushing 2007-06-03 19:31:02 UTC
I also don't see suexec in the list of loaded modules although I don't seem to be able to grep the list or output it to a file... not sure why maybe it's not on stdout.... even though it appears to display there.... anyways the list is long so I could be reading over it.

apache2 -M
Loaded Modules:
 core_module (static)
 mpm_worker_module (static)
 http_module (static)
 so_module (static)
 actions_module (shared)
 alias_module (shared)
 auth_basic_module (shared)
 auth_digest_module (shared)
 authn_anon_module (shared)
 authn_dbd_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)
 cache_module (shared)
 cgi_module (shared)
 cgid_module (shared)
 dav_module (shared)
 dav_fs_module (shared)
 dav_lock_module (shared)
 dbd_module (shared)
 deflate_module (shared)
 dir_module (shared)
 disk_cache_module (shared)
 env_module (shared)
 expires_module (shared)
 ext_filter_module (shared)
 file_cache_module (shared)
 filter_module (shared)
 headers_module (shared)
 ident_module (shared)
 imagemap_module (shared)
 include_module (shared)
 log_config_module (shared)
 logio_module (shared)
 mem_cache_module (shared)
 mime_module (shared)
 mime_magic_module (shared)
 negotiation_module (shared)
 rewrite_module (shared)
 setenvif_module (shared)
 speling_module (shared)
 unique_id_module (shared)
 usertrack_module (shared)
 vhost_alias_module (shared)
Syntax OK
Comment 5 Luca Longinotti (RETIRED) gentoo-dev 2007-06-05 17:15:47 UTC
This is perfectly normal that you don't see suexec when just doing apache2 -M or -t, because calling apache2 directly doesn't pass any defines, thus anything that is in an <IfDefine> block doesn't get checked/executed at all. As Christian already said, apache2 -D SUEXEC -t should fail like the init-script does.
And are you sure the problem comes from that piece of configuration? Looks fine to me, unless there is some problem in SuEXEC, check the suexec logfile if it says anything helpful.
Best regards, CHTEKK.
Comment 6 Caleb Cushing 2007-06-06 01:34:51 UTC
Syntax error on line 15 of /etc/apache2/vhosts.d/regen2.org.conf:
Invalid command 'SuexecUserGroup', perhaps misspelled or defined by a module not included in the server configuration

sorry just realized there was a startup error log. We didn't have one at work. anyways... ok I stole that piece of code from gentoo's name based example file. Is there something I needed to add elsewhere perhaps?

also, would you consider making it so that when it finds config errors, that it  puts it in the log and echo's it to the terminal (maybe have that level of verbosity configurable in /etc/conf.d/apache2)?
Comment 7 Jakub Moc (RETIRED) gentoo-dev 2007-06-15 15:20:21 UTC
Either use the functionality we provide or make sure you are passing identical options to apache if you insist on doing it manually for whatever reason. Running apache with different options will of course produce different results.

Closing, this is not a bug.