Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have to customize my Apache2 suExec module to ensure some special environment variables getting passed through suExec.

How to download the source code form Debian package apache2-suexec, modify suexec.c -> safe_env_lst, recompile and build a .deb package again to rollout on the production systems?

I tried apt-get source apache2-suexec but didn't found the suexec.c within the occurred apache2-* folder.

The altered source code should be like this:

static const char *const safe_env_lst[] =
{
    /* variable name starts with */
    "HTTP_",
    "SSL_",

    /* NEW: Perl debugging variables */
    "PERL5OPT=",
    "PERL5LIB=",
    "PERLDB_OPTS=",
    "DBGP_IDEKEY=",

    /* NEW: FCGI variables */
    "FCGI=",
    "FCGI_CONNECTION=",
    "FCGI_RUNTIME=",
    "FCGI_STARTTIME=",

draft based on: http://static.askapache.com/httpd/support/suexec.c

share|improve this question

1 Answer 1

up vote 1 down vote accepted

I tried apt-get source apache2-suexec but didn't found the suexec.c within the occurred apache2-* folder.

On my Ubuntu 12.04:

# cd apache2-2.2.22/
# find . -name 'suexec.c'
./support/suexec.c
./.pc/045_suexec_log_cloexec/support/suexec.c
./.pc/058_suexec-CVE-2007-1742/support/suexec.c

How to download the source code form Debian package apache2-suexec, modify suexec.c -> safe_env_lst, recompile and build a .deb package again to rollout on the production systems?

# apt-get build-dep apache2-suexec
# apt-get install devscripts
# debuild -i -us -uc -b
# dpkg -i ../apache2-suexec_2.2.22-1ubuntu1_amd64.deb
share|improve this answer
    
thanks, @quanta. I give it a try, but I already searched for the file like you did... strange (maybe spelling error or special char). –  burnersk Sep 26 '12 at 7:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.