# Apache Fails with APR Random Support Error [RESOLVED]

## ryker

I am trying to emerge Apache 2.0.53 and it fails with the following error:

```
checking whether to enable mod_auth_digest... checking dependencies

You need APR random support to use mod_auth_digest.

Look at APR configure options --with-egd and --with-devrandom.

checking whether to enable mod_auth_digest... configure: error: mod_auth_digest has been requested but can not be built due to prerequisite failures

!!! ERROR: net-www/apache-2.0.53 failed.

!!! Function src_compile, Line 136, Exitcode 1

!!! bad ./configure please submit bug report to bugs.gentoo.org. Include your config.layout and config.log

```

After searching, it seemed like it would be a good idea to make sure APR was the latest version and/or rebuild it.  When trying to emerge APR-0.9.6-r2, I get the following error:

```
checking if POSIX sems affect threads in the same process... no

checking if SysV sems affect threads in the same process... no

checking if fcntl locks affect threads in the same process... no

checking if flock locks affect threads in the same process... no

checking for entropy source... configure: error: /dev/random not found or unreadable.

!!! Please attach the config.log to your bug report:

!!! /var/tmp/portage/apr-0.9.6-r2/work/apr-0.9.6/config.log

!!! ERROR: dev-libs/apr-0.9.6-r2 failed.

!!! Function econf, Line 485, Exitcode 0

!!! econf failed
```

I'm not sure where to go next.  I couldn't find anything searching the forums or bugzilla.

For completeness, here is my emerge --info:

```
Portage 2.0.51.20 (default-linux/x86/2005.0, gcc-3.4.3-20050110, glibc-2.3.5-r0, 2.6.5-gentoo-r1 i686)

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

System uname: 2.6.5-gentoo-r1 i686 Pentium III (Katmai)

Gentoo Base System version 1.6.11

ccache version 2.4 [disabled]

dev-lang/python:     2.3.5

sys-devel/autoconf:  2.13, 2.59-r6

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

sys-devel/binutils:  2.15.92.0.2-r8

sys-devel/libtool:   1.5.14

virtual/os-headers:  2.6.11

ACCEPT_KEYWORDS="x86 ~x86"

AUTOCLEAN="yes"

CBUILD="i686-pc-linux-gnu"

CFLAGS="-O2 -march=pentium3 -pipe -fomit-frame-pointer"

CHOST="i686-pc-linux-gnu"

CONFIG_PROTECT="/var/qmail/alias /var/qmail/control"

CONFIG_PROTECT_MASK="/etc/terminfo /etc/env.d"

CXXFLAGS="-O2 -march=pentium3 -pipe -fomit-frame-pointer"

DISTDIR="/usr/portage/distfiles"

FEATURES="autoconfig distlocks sandbox sfperms strict"

GENTOO_MIRRORS="ftp://ftp.ussg.iu.edu/pub/linux/gentoo"

MAKEOPTS="-j2"

PKGDIR="/usr/portage/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/usr/local/portage"

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

USE="x86 aliaschain alsa apache2 berkdb bitmap-fonts clamav cpdflib crypt curlwrappers dba emboss extensions fortran fwdzone gd gdbm gif imap imlib ipv6 jpeg ldap libg++ libwww maildir memlimit mp3 mysql ncurses nls nptl oav offensive pam pcntl perl php qmail readline sdl session slang soap spamassassin spell spl sse ssl svga tcpd tidy tokenizer truetype truetype-fonts type1-fonts virus-scan vpopmail webmin-minimal xml xml2 zlib"

Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS

```

Thanks for any help.

----------

## moocha

Sounds like wrong permissions on /dev/random. What's the output of

```
grep -r random /etc/udev/
```

? Mine is

```
router ~ # grep -r random /etc/udev/

/etc/udev/rules.d/50-udev.rules:KERNEL="random",        NAME="%k", MODE="0666"

/etc/udev/rules.d/50-udev.rules:KERNEL="urandom",       NAME="%k", MODE="0444"

/etc/udev/permissions.d/50-udev.permissions:random:root:root:0666

/etc/udev/permissions.d/50-udev.permissions:urandom:root:root:0444
```

----------

## umbra obscura

First of all, the apr problem you have problems with compiles without problems here. (it is a amd64 box too)

Seems like configure cannot read from /dev/random. Make sure it does exist and there is entropy in it. Have a look at the config.log of configure for any suspicious errors.

----------

## ryker

I'm not using udev, so I don't have /etc/udev.  Looking for /dev/random it is not there at all.

Here is my output of ls -la /dev

```
total 8

drwxr-xr-x   2 root root 4096 Mar 22 12:54 .

drwxr-xr-x  19 root root 4096 Mar 30 20:00 ..

crw-rw----   1 root root 5, 1 Mar 22 12:54 console

-rw-r--r--   1 root root    0 Apr 24 10:26 null

```

I'm sorry about the confusion with my signature.  This box is not my amd64 box listed in my signature.  I have about 10 different Gentoo boxes, and this is one of my x86 boxes that I am using for a server for mail/web/ldap etc.  After a couple of years of using (experimenting) with this box, I decided I wanted to start over from scratch.  Problem is, I am actively using it as a mail and web server.  So I installed a new system using chroot.  When I was done with the basic install, my plan was to install apache and qmail and then move my backup files to it and reboot and use it.  All has gone well until I tried to emerge Apache.  I can even boot into the new system, and all seems to work well, except emerging apache.  :Sad: 

If this is too difficult to fix, I will probably just start over with a nice new 2005 tarball.  I used a 2003 for this one.

What do you guys think?  Would it be easier to just start over?

----------

## moocha

Hm, /dev/null is a regular file on that box, not a device node. You've been hit by a GCC bug - you probably used GCC 3.4.3 and it's a known bug in the ebuild that unlinks /dev/null and recreates it as a file (fixed in gcc-3.4.3.20050110-r2).

cd into the dev directory in the chroot, remove the file null forcibly, and recreate it with

```
mknod null c 1 3
```

Perhaps it'll work.

----------

## umbra obscura

Is this really your complete listing of devices? I wonder how you can any other filesystem besides the root filesystem when you only have this two device nodes. 

You might want to try to reemerge baselayout or start to use udev for device node managment

----------

## moocha

Oh, I assumed he meant the dev directory inside the chroot, where obviously there wouldn't be any dynamic device nodes.

```
mount --bind /dev /mnt/gentoo/dev

mount --bind /sys /mnt/gentoo/sys
```

from outside the chroot may help too in this case.

----------

## umbra obscura

he said he did not use udev, so it is probably his decision not to use it. or is using udev now a strict requirement for gentoo?

----------

## moocha

 *umbra obscura wrote:*   

> he said he did not use udev, so it is probably his decision not to use it. or is using udev now a strict requirement for gentoo?

 Not at all. It's still possible to just ignore the whole devfsd / udev mess and go with the tried and tested static nodes, especially for a non-desktop system on which you're not likely to swap out hardware all the time.

----------

## ryker

Thanks for the tips.  I'll give them a try and see what happens.

I'll probably move to udev.  I used the 2003 tarball to install this system, and I don't think udev was the default then.

----------

## ryker

IT WORKED!  Thank you!  I just binded the /dev and /sys dirs.  I first re-emerged apr and apr-utils, next I emerged apache without problems.  Next, I'm going to switch to udev and hope that all of the device nodes are created properly.

Thanks again.

----------

