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 mod_security to centos 5 via easyapache ?

Discussion in 'EasyApache' started by nyjimbo, Mar 26, 2008.

  1. nyjimbo

    nyjimbo Well-Known Member

    Joined:
    Jan 25, 2003
    Messages:
    1,125
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    New York
    Just got a centos 5 box (we usually run freebsd) and noticed it didnt have mod_security installed. Went to the "plugins" and told it to install but it still didnt seem to add anthing to apache nor change the control panel in whm to allow for mod_security log viewing, etc.

    So went to WHM -> Apache update and added mod_security to the config and told it to start the build. Shortly after it dumped this to the screen and bailed out:

    Distilled successfully !! Verbose logfile is at
    '/usr/local/cpanel/logs/easy/apache/build.1206582926' !! !! Ouput from '/bin/sh -c "ulimit -a"':
    core file size (blocks, -c) 524288 data seg size (kbytes, -d) unlimited max nice (-e) 0 file size
    (blocks, -f) unlimited pending signals (-i) 32750 max locked memory (kbytes, -l) 32 max memory size
    (kbytes, -m) 524288 open files (-n) 1024 pipe size (512 bytes, -p) 8 POSIX message queues (bytes,
    -q) 819200 max rt priority (-r) 0 stack size (kbytes, -s) 10240 cpu time (seconds, -t) unlimited max
    user processes (-u) 32750 virtual memory (kbytes, -v) 524288 file locks (-x) unlimited !! !!
    Creating backup of working apache in '/usr/local/apache.backup'. !! !! Backup of working apache
    complete. !! Checking that all tarballs are present and up to date. !!
    Downloading
    '/var/cpanel/perl/easy/Cpanel/Easy/ModSec.pm.tar.gz'
    !!
    Checking that all packages are present and
    up to date. !!
    Trying to auto repair package system !!
    Fetching
    http://httpupdate.cpanel.net/syspkgs/templates/centos/5/default/CentOS-Base.repo
    (0)....@75.126.236.226......connected......receiving...100%......Done checkyum version 20.5 Fetching
    http://httpupdate.cpanel.net/syspkgs/templates/centos/5/cpanel/CentOS-Base.repo
    (0)....@75.126.236.226......connected......receiving...100%......Done checkyum version 20.5 checkyum
    version 20.5 !!

    Package system can not be repaired automatically !! !!
    Please visit
    http://www.cpanel.net/support/could_not_ensurepkgs.htm for help with this error. !! !!


    Restoring
    original working apache !! !! Executing '/scripts/initsslhttpd' !! !! Restarting 'httpd' ... !! !!
    'httpd' restart complete. !! !! Executing '/scripts/initfpsuexec' !! !! Executing
    '/scripts/initsslhttpd' !! Compiling report... Sending report (18 bytes)... Bad arg length for
    Socket::pack_sockaddr_in, length is 0, should be 4 at
    /usr/lib/perl5/5.8.8/i386-linux-thread-multi/Socket.pm line 373.


    Apache is running ok but we cannot install mod_security.

    I visited the above recommended page but got this :

    Error: Package system can not be repaired automatically
    Suggestion: This means that Cpanel::SysPkgs's config check returned a failed status and it's attempt to auto fix the problem did not work. You will need to manually troubleshoot fix your OS's update system at this point.


    Of course that means "you figure it out". Anyone see this sort of thing before?. Any tips or quick fixes?. We compiled apache several times this week adding other missing things and all went in fine before this attempt.

    Thanks.
     
  2. Tina

    Tina Well-Known Member

    Joined:
    Jan 27, 2003
    Messages:
    63
    Likes Received:
    0
    Trophy Points:
    6
    Same exact problem here.

    The tech at my colo says it has something to do with how temp is mounted and that it interferes with yum.

    He says 'umount /tmp' solved the problem.
     
  3. nyjimbo

    nyjimbo Well-Known Member

    Joined:
    Jan 25, 2003
    Messages:
    1,125
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    New York
    Are you saying you did the umount and it worked or they did it and then fixed your problem?. Did you have to remount the /tmp later or do anything else ?
     
  4. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Try rebuilding the RPM database:

    cd /var/lib/rpm
    rm __db.*
    rpm --rebuilddb
     
  5. nyjimbo

    nyjimbo Well-Known Member

    Joined:
    Jan 25, 2003
    Messages:
    1,125
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    New York
    Wow, that was easy. Thank you it worked perfectly.
     
  6. jekab

    jekab Registered

    Joined:
    Aug 24, 2008
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Problem with rebuild any profiles with easyapache

    Hi to everyone,

    can you please share your experience and knowledge to help solve my issue.
    I am trying to install few additional PHP extensions like GD, mbstring and XSL using easyapache. I've created a new profile, put check all interesting extensions and press to rebuild,
    here is the response I having all the time:

    Code:
    !! Creating backup of working apache in '/usr/local/apache.backup'. !!
    [COLOR="Blue"]!! Symlink encountered (/usr/local/apache/etc), preserving target (conf)... !![/COLOR]
    !! Backup of working apache complete. !!
    Checking that all tarballs are present and up to date.
    Checking that all packages are present and up to date.
    [COLOR="Orange"]!! Trying to auto repair package system !![/COLOR]
    Fetching http://httpupdate.cpanel.net/syspkgs/templates/centos/5/default/CentOS-Base.repo (0)....@74.200.65.162......connected......receiving...100%......Done
    checkyum version 20.5
    Fetching http://httpupdate.cpanel.net/syspkgs/templates/centos/5/cpanel/CentOS-Base.repo (0)....@74.200.65.162......connected......receiving...100%......Done
    checkyum version 20.5
    checkyum version 20.5
    [COLOR="Red"]!! Package system can not be repaired automatically !!
    !! Please visit http://www.cpanel.net/support/could_not_ensurepkgs.htm for help with this error. !!
    !! Restoring original working apache !![/COLOR]
    !! Executing '/scripts/initsslhttpd' !!
    !! Restarting 'httpd' ... !!
    !! 'httpd' restart complete. !!
    !! Executing '/scripts/initfpsuexec' !!
    !! Executing '/scripts/initsslhttpd' !!
    Compiling report...
    Sending report (18 bytes)...
    Bad arg length for Socket::pack_sockaddr_in, length is 0, should be 4 at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/Socket.pm line 373.
    

    I've tried to rebuild RPM as you just said under SSH:
    Code:
    cd /var/lib/rpm
    rm __db.*
    rpm --rebuilddb
    
    Also I've tried the same under WHM -> Software -> Rebuild RPM

    But it still shows the same issue.
    Can anyone help me to solve this as I really need easy process to rebuild php configurations.

    Also is it able to add php extensions with easyapache which are not listed in the list of PHP extensions. For example ImageMagic library. Is there any way to add it to easyapache's list of extensions and rebuild php with it?

    Thanks
     
  7. 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
    You may want to have our technical analysts take a look at your server to resolve the RPM issue you are experiencing.

    As for additional PHP Extensions, you could develop a custom optional module for EasyApache. However, if you're just looking for a quick fix- that is not possible at this time given the nature of the process of fetching a module, its dependencies, ensuring it is properly functioning then compiling it into Apache or PHP.
     
  8. redwood

    redwood Member

    Joined:
    Apr 4, 2007
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    Had exactly the same problem, after trying to rebuilddb and updated system software it didn't work. I've rebooted and that did the trick, everything is fine now!
     
  9. cpane1

    cpane1 Well-Known Member

    Joined:
    Jun 10, 2007
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    yes...this is a very old thread...but I would like to tell what I did to resolve this issue on the Centos 4.7 server.

    while easyapache I received the below errors in RED..

    !! Package system can not be repaired automatically !!
    !! Please visit http://www.cpanel.net/support/could_not_ensurepkgs.htm for help with this error. !!
    !! Restoring original working apache !!
    !! Executing '/scripts/initsslhttpd' !!


    I tried all the ways as discussed above...

    But soon found that this issue seemed to be a YUM issue..

    I simply removed the current version of YUM and all its dependencies..
    [root@server1 rpm]# rpm -qa | grep yum
    yum-2.4.3-4.el4.centos
    yum-metadata-parser-1.0-8.el4.centos
    yum-plugin-fastestmirror-0.2.4-3.c4

    And reinstalled the YUM rpm I found at:
    http://mirror.nsc.liu.se/CentOS/4.7/os/i386/CentOS/RPMS/


    Once installed.. I ran the easyapache again which went on to complete flawlessly :)
     
  10. livewebcs

    livewebcs Member

    Joined:
    Jun 11, 2004
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    I got the same error today on a server.

    In etc/yum.config
    there was an extra linefeed in line 3,
    removed that and yum then worked.

    In almost all cases fixing yum or reinstalling yum seems to fix this error message
     
  11. rkane

    rkane Registered

    Joined:
    Dec 17, 2007
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Possible fix

    If you haven't checked it already. And I know this post is old so just posting my findings for others...

    try to run a "yum -v update" from the command line and see if it gives you and useful information...

    I found that my dns server was not resolving the Repositories and had to reconfigured named. I was getting the same error that you reported in this post.
     
Loading...

Share This Page