Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 180692 - net-www/apache-2.2 - add modules function to initscript
Summary: net-www/apache-2.2 - add modules function to initscript
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Apache Team - Bugzilla Reports
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2007-06-03 05:44 UTC by Caleb Cushing
Modified: 2007-06-15 15:12 UTC (History)
2 users (show)

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 05:44:48 UTC
I'm actually having a couple of problems with this. 

#1 if I run apache2 -M it lists modules... but if I run apache2 -M | grep rewrite it doesn't filter everything... or anything for that matter.

secondly I added -D USERDIR to /etc/conf.d/apache2 and added this line

UserDir public_html

to httpd.conf the directive seems to work fine. but if I do an apache2 -M with it in there I get this.

Syntax error on line 394 of /etc/apache2/httpd.conf:
Invalid command 'UserDir', perhaps misspelled or defined by a module not included in the server configuration


Reproducible: Always
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2007-06-03 08:14:56 UTC
Erm, see /etc/apache2/modules.d/00_mod_userdir.conf and configure things properly there; for your grep problem, I don't understand what it should filter or what are you trying to do even.
Comment 2 Caleb Cushing 2007-06-03 08:34:31 UTC
when you run a command that has stdout output and pipe it to grep it should filter what it shows you

apache2 -M shows me this

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

apache2 -M |grep Syntax 

should show me
Syntax OK

my understanding is this command should be grep-able however |grep (whatever) still shows me the above. 

possibly another problem I don't see mod_userdir for example in that list but I have it loaded in /etc/conf.d/apache2 and my understanding of the -M option is that it will show all loaded modules. note: -M is new in apache 2.2.
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2007-06-03 08:48:29 UTC
You know; we have an initscript for apache installed to /etc/init.d/apache2 -> use it (otherwise you'll have to pass all the -D options etc. to apachectl manually or don't expect to get the proper modules loaded because it won't parse APACHE2_OPTS in /etc/conf.d/apache2). And you can also use it to check your configuration, just run `/etc/init.d/apache2 configtest`.

Take your grep issue to another bug if you think it behaves improperly, it has nothing to do with apache.
Comment 4 Caleb Cushing 2007-06-03 08:54:48 UTC
(In reply to comment #3)
> You know; we have an initscript for apache installed to /etc/init.d/apache2 ->
> use it (otherwise you'll have to pass all the -D options etc. to apachectl
> manually or don't expect to get the proper modules loaded because it won't
> parse APACHE2_OPTS in /etc/conf.d/apache2). And you can also use it to check
> your configuration, just run `/etc/init.d/apache2 configtest`.
> 
> Take your grep issue to another bug if you think it behaves improperly, it has
> nothing to do with apache.
> 
grep works properly elsewhere which is why I'm wondering if there is something different with the way this puts things out. what does the config test have to do with anything the syntax thing was an example. although it might be good to mention that I've managed to get your configtest and -M configtest to differ in results. meaning there's probably another bug. your configtest and the one apache supplies shouldn't disagree unless there is a bug in one of the 2.
Comment 5 Jakub Moc (RETIRED) gentoo-dev 2007-06-03 09:28:03 UTC
OK... we'll add modules() stuff to the initscript (which should be more convenient that `apache2 -M 2>&1 | grep "something"` and will include all the configured modules). 

(In reply to comment #4)
> I've managed to get your configtest and -M configtest to differ in
> results. meaning there's probably another bug. your configtest and the one
> apache supplies shouldn't disagree unless there is a bug in one of the 2.

configtest runs apache2 -t, not apache2 -M (so your test is wrong).
Comment 6 Caleb Cushing 2007-06-03 09:37:55 UTC
I wouldn't actually have expected it to run -M because like I said it's new. but um...

 * Caching service dependencies ...                                                                                                                               [ ok ]
 * Checking Apache Configuration ...
 * Apache2 has detected a syntax error in your configuration files:                                                                                               [ !! ]
slave7 pc # apache2 -t
Syntax OK

the init script still conflicts... 

it's this in one of my vhosts files

    <IfDefine SUEXEC>
        SuexecUserGroup regen2 users
    </IfDefine>

I don't know why but that's setting the init scripts config test off but apache clears it. they shouldn't conflict. if something is wrong it's wrong and vice versa.
Comment 7 Jakub Moc (RETIRED) gentoo-dev 2007-06-03 09:41:13 UTC
(In reply to comment #6)

OK, not here. This bug is about adding modules functionality to the initscript *only*. Anything else -> file a new bug instead of making this one a dumpspace for unrelated stuff.
Comment 8 Jakub Moc (RETIRED) gentoo-dev 2007-06-03 20:02:27 UTC
*** Bug 180788 has been marked as a duplicate of this bug. ***
Comment 9 Christian Heim (RETIRED) gentoo-dev 2007-06-05 16:44:46 UTC
Just committed this with apache-2.2.4-r5.
Comment 10 Caleb Cushing 2007-06-06 23:40:47 UTC
I hate to reopen this... but I was just testing r6 and /etc/init.d/apache2 modules doesn't seem to do anything. I assume it's just supposed to output -M to stdout right? that's what it looks like in the init script...

/etc/init.d/apache2 modules
 * Caching service dependencies ...                                                                                                                              [ ok ]

that's it... that's all I get.
Comment 11 Christian Heim (RETIRED) gentoo-dev 2007-06-07 06:44:15 UTC
*shrug* Could you please post your emerge --info, the output of emerge -pvq =net-www/apache-2.2.4-r6 then ?

It works perfeclty fine here ..

$ qlist -ICv net-www/apache
net-www/apache-2.2.4-r6
$ emerge -pqv apache
[ebuild   R   ] net-www/apache-2.2.4-r6 USE="ssl -debug -doc -ldap -mpm-event -mpm-itk -mpm-peruser -mpm-prefork -mpm-worker -no-suexec (-selinux) -static-modules -threads"
$ sudo /etc/init.d/apache2 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)
 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)
 info_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)
 status_module (shared)
 unique_id_module (shared)
 userdir_module (shared)
 usertrack_module (shared)
 vhost_alias_module (shared)
 ssl_module (shared)
 suexec_module (shared)
 php5_module (shared)
Syntax OK
Comment 12 Caleb Cushing 2007-06-07 16:50:05 UTC
 emerge -pvq apache
[ebuild   R   ] net-www/apache-2.2.4-r6  USE="mpm-worker ssl threads -debug -doc -ldap -mpm-event -mpm-itk -mpm-peruser -mpm-prefork -no-suexec (-selinux) -static-modules" 

Portage 2.1.2.7 (default-linux/x86/2007.0, gcc-4.1.2, glibc-2.5-r3, 2.6.20-gentoo-r8 i686)
=================================================================
System uname: 2.6.20-gentoo-r8 i686 Intel(R) Xeon(R) CPU            5130  @ 2.00GHz
Gentoo Base System release 1.12.9
Timestamp of tree: Thu, 07 Jun 2007 07:00:01 +0000
ccache version 2.4 [enabled]
dev-lang/python:     2.4.4-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.4-r7
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.61
sys-devel/automake:  1.10
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=prescott -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /var/bind"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -march=prescott -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache distlocks metadata-transfer parallel-fetch sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="acl apache2 bash-completion berkdb bitmap-fonts bzip2 cli cracklib crypt cups curl dri fortran gdbm gnutls gpm iconv imap isdnlog libg++ libww logrotate maildir midi milter mudflap mysql ncurses nls nptl nptlonly openmp pam pcre perl pppd python readline reflection sasl session spl sse2 ssl symlink tcpd threads truetype-fonts type1-fonts unicode vhosts x86 xml xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i740 i810 imstt mach64 mga neomagic nsc nv r128 radeon rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng v4l vesa vga via vmware voodoo"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY


Comment 13 Jakub Moc (RETIRED) gentoo-dev 2007-06-15 15:12:44 UTC
(In reply to comment #11)
> It works perfeclty fine here ..

Same here; sorry but this is not reproducible at all, fix your shell.