The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Adding apache module

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

  1. pthirose

    pthirose Member

    Joined:
    Mar 30, 2010
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    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/ModAuthCAS.pm file, stripped down from the one for ModAuthMySQL.pm downloadable example custom module from cPanel. I then went to EasyApache and did Build Now, but I got an error because of the missing mod_auth_cas.so module (I have a LoadModule auth_cas_module modules/mod_auth_cas.so 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/ModAuthCAS.pm 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' => '1.0.9.1',
    'name' => 'mod_auth_cas',
    'note' => 'Builds manually apxs -i -lssl -lcurl -c mod_auth_cas.c',
    'url' => 'https://source.jasig.org/cas-clients/mod_auth_cas/trunk/',
    '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);
    },
    },
    },
    };

    1;
     
  2. sirdopes

    sirdopes Well-Known Member
    PartnerNOC

    Joined:
    Sep 25, 2007
    Messages:
    141
    Likes Received:
    0
    Trophy Points:
    16
    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:

    /home/cpeasyapache/src/mod_auth_cas

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

Share This Page