# can't load modules in apache

## vito_huang

i emerge apache with apache2 USE flag on, everything seems fine during installation but i can't start apache, i got the following error

localhost ~ # /etc/init.d/apache2 start

 * Apache2 has detected a syntax error in your configuration files:

Syntax error on line 277 of /etc/apache2/httpd.conf:

module alias_module is built-in and can't be loaded

then i comment out line 277, but it seems this error is for all the load module in apache configuration file.

can someone help me please?

thank you

----------

## magic919

I'd be tempted to emerge it again.  But here's a Q.  Did you compile it with only apache2 USE?  Do emerge -pv apache2.  Could this be static modules, perhaps?

----------

## vito_huang

yes, i did use static modules USE flag, and other ldap,ssl and thread. but what is wrong with using those flag. sorry about this noob quesiton, i also tried use all the mpm USE flag, but it turns out can't compile it at all ( all mpm contrudict with each other).

i did remerge apache without andy mpm and static modules on, but i still get the following errors

localhost ~ # /etc/init.d/apache2 start

 * Re-caching dependency info (mtimes differ)...

 * Re-caching dependency info (mtimes differ)...

 * Re-caching dependency info (mtimes differ)...

 * Re-caching dependency info (mtimes differ)...

 * Apache2 has detected a syntax error in your configuration files:

Syntax error on line 13 of /etc/apache2/modules.d/00_apache_manual.conf:

Invalid command 'Order', perhaps mis-spelled or defined by a module not included in the server configuration

what does it means, do i have to take other USE flag off?

----------

## magic919

What flags do you have on?  Can you paste output of emerge -pv apache.

----------

## vito_huang

here is the output of my emerge -av apache

localhost ~ # emerge -av apache

These are the packages that I would merge, in order:

Calculating dependencies ...done!

[ebuild   R   ] net-www/apache-2.0.55-r1  +apache2 +debug +doc +ldap -mpm-leader -mpm-peruser -mpm-prefork -mpm-threadpool -mpm-worker -no-suexec (-selinux) +ssl -static-modules +threads 0 kB

Total size of downloads: 0 kB

----------

## magic919

I think you'll need to do some more digging to see what some of those use flags are doing.  I just use SSL and Apache2 and mine are fine.  I favour leaving out any I don't need, rather than putting too many in.

----------

## vito_huang

one wired thing, when i comment out my old USE flag in make.conf and make an new one like this

USE="apache2 ssl"

and then emerge -av apache, i got the following output

localhost ~ # emerge -av apache

These are the packages that I would merge, in order:

Calculating dependencies ...done!

[ebuild   R   ] net-www/apache-2.0.55-r1  +apache2 -debug* -doc* +ldap -mpm-leader -mpm-peruser -mpm-prefork -mpm-threadpool -mpm-worker -no-suexec (-selinux) +ssl -static-modules -threads 0 kB

i don't know why there is +ldap? since i don't have any ldap in my use flag.

----------

## magic919

Do you have OpenLDAP installed?  Otherwise you could run emerge --info and check the output.

----------

## vito_huang

i don't have openLDAP installed,

----------

## magic919

 *Quote:*   

> Otherwise you could run emerge --info and check the output.

 

----------

## vito_huang

here are the output of emerge --info 

Portage 2.0.54-r2 (default-linux/amd64/2006.0, gcc-3.4.5, glibc-2.3.6-r3, 2.6.15-gentoo-r5 x86_64)

=================================================================

System uname: 2.6.15-gentoo-r5 x86_64 AMD Athlon(tm) 64 Processor 3000+

Gentoo Base System version 1.6.14

dev-lang/python:     2.4.2

dev-python/pycrypto: [Not Present]

dev-util/ccache:     [Not Present]

dev-util/confcache:  [Not Present]

sys-apps/sandbox:    1.2.17

sys-devel/autoconf:  2.13, 2.59-r7

sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1

sys-devel/binutils:  2.16.1

sys-devel/libtool:   1.5.22

virtual/os-headers:  2.6.11-r2

ACCEPT_KEYWORDS="amd64"

AUTOCLEAN="yes"

CBUILD="x86_64-pc-linux-gnu"

CFLAGS="-O2 -pipe"

CHOST="x86_64-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib64/mozilla/defaults/pref /usr/share/config /var/qmail/control"

CONFIG_PROTECT_MASK="/etc/eselect/compiler /etc/gconf /etc/splash /etc/terminfo /etc/env.d"

CXXFLAGS="-O2 -pipe"

DISTDIR="/usr/portage/distfiles"

FEATURES="autoconfig distlocks sandbox sfperms strict"

GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"

LC_ALL="en_GB.UTF-8"

PKGDIR="/usr/portage/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="amd64 X aalib alsa apache2 audiofile avi berkdb bitmap-fonts bzip2 cdr cli crypt cups curl directfb dri dts eds emboss encode esd exif expat fam ffmpeg flac foomaticdb fortran gd gdbm gif glut gnome gpm gstreamer gtk gtk2 gtkhtml hal howl idn imagemagick imlib ipv6 isdnlog java jpeg kde lcms ldap libcaca lzw lzw-tiff mad mikmod mng mozilla mp3 mpeg ncurses nls nptl ogg opengl pam pcre pdflib perl png pppd python qt quicktime readline reflection samba sdl session slang spell spl ssl tcltk tcpd tiff truetype truetype-fonts type1-fonts udev usb vorbis xine xml2 xmms xorg xpm xv zlib userland_GNU kernel_linux elibc_glibc"

Unset:  ASFLAGS, CTARGET, INSTALL_MASK, LANG, LDFLAGS, LINGUAS, MAKEOPTS, PORTAGE_RSYNC_EXTRA_OPTS, PORTAGE_RSYNC_OPTS, PORTDIR_OVERLAY

i don't unstand, i am sure i haven't comment out this USE flag, but is it still there.

----------

## vito_huang

sorry, is about 3 am in here , so allow me to make mistake. i meant i have comment out the USE flag from make.conf.(don't know why i just type different things from my thought ;()

----------

## magic919

Hey don't worry.   I read it correctly.  03:00 here too  :Smile: 

This is worth a read

http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=2

In short, it is getting ldap from somewhere.  You can knock it out overall or just for Apache.  I tend to keep /etc/make.conf fairly lean and then just do any tweaks on a per-package basis.  But that's a choice that suits my servers.

----------

## vito_huang

thanks for helping m8.

it seems can't sove this problem 

 i first use emerge --unmerge it and then  used USE="-ldap" emerge -av apache to knock out ldap, and emerge it with apache2 and ssl only, but i still got this error

localhost ~ # /etc/init.d/apache2 start

 * Re-caching dependency info (mtimes differ)...

 * Re-caching dependency info (mtimes differ)...

 * Re-caching dependency info (mtimes differ)...

 * Re-caching dependency info (mtimes differ)...

 * Apache2 has detected a syntax error in your configuration files:

Syntax error on line 13 of /etc/apache2/modules.d/00_apache_manual.conf:

Invalid command 'Order', perhaps mis-spelled or defined by a module not included in the server configuration

----------

## magic919

I really don't know what that file is doing.  Can you move it somewhere safe for the moment and try to start up Apache again?

----------

## vito_huang

i used mv moved it to somewhere else, but there is another problem

localhost modules.d # /etc/init.d/apache2 start

 * Re-caching dependency info (mtimes differ)...

 * Re-caching dependency info (mtimes differ)...

 * Re-caching dependency info (mtimes differ)...

 * Re-caching dependency info (mtimes differ)...

 * Apache2 has detected a syntax error in your configuration files:

Syntax error on line 506 of /etc/apache2/httpd.conf:

Invalid command 'Order', perhaps mis-spelled or defined by a module not included in the server configuration

in httpd.conf

line 506:     Order allow,deny

it seems like apache doesn't take Order command.

----------

## magic919

Is it this bit?

```

<Files ~ "^\.ht">

    Order allow,deny

    Deny from all

</Files>

```

It's standard Apache stuff and I'm surprised it's choking on that.  Is it the same as the bit I've pasted?

----------

## vito_huang

yes, exactly the same.

----------

## magic919

After you ran the emerge --unmerge and emerged did you update the config files with etc-update or dispatch-conf?  I'm thinking something else in the config is causing this.

----------

## vito_huang

silly me, everything is fine now after i run etc-update

cheers miagic919

----------

## magic919

Glad it's all sorted.  Worth the effort when it sorts the problem!  :Smile: 

----------

## vito_huang

yes indeed,it feels good. thanks m8

----------

