Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Adding apache module

Discussion in 'cPanel Developers' started by pthirose, Sep 20, 2011.

  1. pthirose

    pthirose Member

    Mar 30, 2010
    Likes Received:
    Trophy Points:
    Am I the only one that finds /scripts/easyapache --perldoc to be somewhat incomprehensible?

    I've a basic apache module that compiles and installs nicely with apxs -i -lssl -lcurl -c mod_auth_cas.c. But whenever I rebuild apache via Main >> Software >> EasyApache method, it's not happy, and I have to remember to add the module.

    I created /var/cpanel/easy/apache/custom_opt_mods/ file, stripped down from the one for downloadable example custom module from cPanel. I then went to EasyApache and did Build Now, but I got an error because of the missing module (I have a LoadModule auth_cas_module modules/ in Main >> Service Configuration >> Apache Configuration >> Include Editor >> Pre VirtualHost Include.) I'm not sure if that's the right place to put that directive, but it works fine, as long as I manually do apxs...

    I'm just trying to figure out how to have to manually do the apxs stuff and have EA do this whenever I build.

    This uses Apache 2.2.20 and I'm on WHM 11.30.3 (build 5) REDHAT Enterprise 6.1 x86_64 vmware

    Maybe I misunderstood, but I thought simply dropping the stuff into .../custom_opt_mods/ was that it'd get picked up automatically by EA during the build process?

    The /var/cpanel/easy/apache/custom_opt_mods/ file is as follows. I created a /var/cpanel/easy/apache/custom_opt_mods/mod_auth_cas/ and put mod_auth_cas.c and mod_auth_cas.h into them.

    package Cpanel::Easy::ModAuthCAS;

    our $easyconfig = {
    'version' => '',
    'name' => 'mod_auth_cas',
    'note' => 'Builds manually apxs -i -lssl -lcurl -c mod_auth_cas.c',
    'url' => '',
    'src_cd2' => 'mod_auth_cas',
    'hastargz' => 1,
    'step' => {
    '0' => {
    'name' => 'Compiling, installing, and activating',
    'command' => sub {
    my ($self) = @_;

    my ($rc, @msg) = $self->run_system_cmd_returnable( [ $self->_get_main_apxs_bin(), qw(-i -lssl -lcurl mod_auth_cas.c)] );
    return ($rc, @msg);

  2. sirdopes

    sirdopes Well-Known Member

    Sep 25, 2007
    Likes Received:
    Trophy Points:
    The module should go into /var/cpanel/easy/apache/custom_opt_mods/Cpanel/Easy/

    The src files in the folder /home/cpeasyapache/src/

    The src folder that you specified would be:


    Then you should see it listed under "Other Modules". It needs to be enabled there so it gets built.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice