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.

mod_auth_external

Discussion in 'General Discussion' started by Smitty519, Aug 18, 2011.

  1. Smitty519

    Smitty519 Member

    Joined:
    Jun 15, 2008
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    We have several applications that need the services of mod_auth[nz]_external. Is there a supported way to install this module and not have to manually edit httpd.conf every time a new configuration is built?
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,453
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
  3. Smitty519

    Smitty519 Member

    Joined:
    Jun 15, 2008
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,453
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Yes I saw that, my thought was you might be able to do something with what you need, working from those instructions.
    My apologies I can't help more than that.
     
  5. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    The better way to add any module that is dynamic is to use apxs to dynamically compile it:

    Code:
    cd /root
    wget http://mod-auth-external.googlecode.com/files/mod_authnz_external-3.2.5.tar.gz
    tar xzf mod_authnz_external-3.2.5.tar.gz 
    cd mod_authnz_external-3.2.5
    apxs -c mod_authnz_external.c
    apxs -i -a mod_authnz_external.la
    After doing the above, it will then put a "LoadModule" into /usr/local/apache/conf/httpd.conf file:

    Code:
    LoadModule authnz_external_module modules/mod_authnz_external.so
    Normally, these type of modules can cause conflicts during EasyApache, so I would suggest moving it and distilling it. Remove the line from httpd.conf file, then run these commands:

    Code:
    echo "LoadModule authnz_external_module modules/mod_authnz_external.so" >> /usr/local/apache/conf/includes/pre_main_global.conf
    cp /usr/local/apache/conf/httpd/conf /usr/local/apache/conf/httpd.conf.bak110818
    /usr/local/cpanel/bin/apache_conf_distiller --update
    /scripts/rebuildhttpdconf
    /etc/init.d/httpd restart
    Copy the mod_authnz_external.so file to /root to save a copy of it, since future /scripts/easyapache recompiles will move the file out of /usr/local/apache/modules folder:

    Code:
    cp /usr/local/apache/modules/mod_authnz_external.so /root
    Now, before you run /scripts/easyapache in the future, create these files:

    Code:
    vi /scripts/preeasyapache
    Place the following content into the file:

    Code:
    #!/bin/bash
    
    sed -i 's/LoadModule authnz_external_module/#LoadModule authnz_external_module/g' /usr/local/apache/conf/includes/pre_main_global.conf
    Next, create this file:

    Code:
    vi /scripts/posteasyapache
    Place the following content into the file:

    Code:
    #!/bin/bash
    
    cp /root/mod_authnz_external.so /usr/local/apache/modules/
    sed -i 's/#LoadModule authnz_external_module/LoadModule authnz_external_module/g' /usr/local/apache/conf/includes/pre_main_global.conf
    /etc/init.d/httpd restart
    The first script comments out the LoadModule in /usr/local/apache/conf/includes/pre_main_global.conf at the beginning of the Apache build. The second script copies mod_authnz_external.so back into /usr/local/apache/modules folder, uncomments the LoadModule, and restarts Apache at the end of the build.

    After saving these files, ensure they can execute:

    Code:
    chmod +x /scripts/preeasyapache
    chmod +x /scripts/posteasyapache
     

Share This Page