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.

Integrating custom Apache module into Apache build process

Discussion in 'cPanel Developers' started by yev, Feb 18, 2009.

  1. yev

    yev Registered

    Joined:
    Feb 18, 2009
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    I've written a custom Apache module which I'd like to integrate with cPanel so it's automatically compiled as part of the server rebuild. What is the best approach for this? Do I just write a new cPanel module? My Apache module only has a single configuration option in httpd.conf, so that seems like overkill. But I'm new to cPanel, so I'm wondering what the best practice is. Thanks!
     
  2. vanessa

    vanessa Well-Known Member
    PartnerNOC

    Joined:
    Sep 26, 2006
    Messages:
    817
    Likes Received:
    22
    Trophy Points:
    18
    Location:
    Virginia Beach, VA
    cPanel Access Level:
    DataCenter Provider
    Yev,

    The way to do this without stepping on EA3's toes is to add it as a raw build option:

    http://www.cpanel.net/support/docs/ea/ea3/ea3custom_flags.html

    This, however, will probably require your module's source code to be in the /home/cpeasyapache (or similar) folder so that apache knows where to find it, assuming you're using a version that can dynamically compile custom modules.

    Now, the *better* way to do this if the above won't work is to create a hook that automatically compiles the module after an ea build:

    http://www.cpanel.net/support/docs/hooks.htm

    If your module is not set up to use apxs -a to add its loaders to httpd.conf automatically upon compilation, you may want to permanently add it to the apache template (/var/cpanel/templates/apacheX/main.local)

    http://www.cpanel.net/support/docs/ea/ea3/customdirectives.html

    Hope that helps
     
  3. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page