Details for GPGME within Apache

Arturo 'Buanzo' Busleiman buanzo at buanzo.com.ar
Wed Jun 20 15:30:56 CEST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

I've created an apache module that links to gpgme. Some GPGME functions, like verification, work ok,
but others, like import do not. I've found out that the GPGHOME environment variable should exist,
but using Apache's SetEnv does not work for modules.

So, I'm posting these so others can benefit from my experience:

The most generic way to provide Apache with env-vars is to export them before spawning it. The most
generic hack would be to modify the /etc/init.d script.

As a test, I've modified Gentoo's Apache script's start() function like this:

start() {
        checkconfig || return 1
        ebegin "Starting apache2"
        [ -f /var/log/apache2/ssl_scache ] && rm /var/log/apache2/ssl_scache
# Enable this if you need debugging info
#       export GPGME_DEBUG=5:/tmp/apache-gpgme.out
        export GNUPGHOME=/var/www/.gnupg
        start-stop-daemon --start --exec ${APACHE2} -- ${APACHE2_OPTS} -k start
        eend $?
}

Depending on your GNU/Linux distribution, or other OS, you might discover better places where to put
this.

- --
Arturo "Buanzo" Busleiman - Consultor Independiente en Seguridad Informatica
Free Music: http://www.buanzo.com.ar/files/buanzo-ultimamente.ogg
Consulting and Secure Mail Hosting: http://www.buanzo.com.ar/pro/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGeSwQAlpOsGhXcE0RCtOzAJ9KYvWiTO2vYfe6bmkjBu60cKZUBQCbBFch
MEOoqqlTUIxGCmGWG1HUsD8=
=CCUQ
-----END PGP SIGNATURE-----



More information about the Gnupg-devel mailing list