Menu

#40 Unable to upgrade SARG

v1.0_(example)
open
nobody
None
5
2015-06-27
2015-06-08
Dario Bruno
No

Hi there,
I have a problem that drives me crazy.
I'using Endian firewall (a Red Hat distro tailored for security) and the graph produced by SARG doesn't show any word, just the bars.
The version of SARG used by Endian is 2.2.2 so I would like to upgrade it at the last one (2.3.10).
I downloaded sarg-2.3.10.tar.gz
I extracted the tarbal (tar zxfv sarg-2.3.10.tar.gz)
then cd sarg-2.3.10 and ./configure but I got the following error:
./configure
checking build system type... i686-pc-linux-gnuoldld
checking host system type... i686-pc-linux-gnuoldld
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in /temp/sarg-2.3.10': configure: error: no acceptable C compiler found in $PATH Seeconfig.log' for more details

(See in attach for the config.log)

Do you have any suggestion for me?
thank you so much
Best regards
Dario

1 Attachments

Related

Support Requests: #40

Discussion

  • Frederic Marchal

    You need a C compiler on the computer where you want to compile sarg. You'll also need make and a few development packages.

    But, I don't recommend to install all those packages on a server you want to keep secure. A compiler would allow an attacker to compile exploits once he has successfully broken into the computer.

    Instead, have a look at the wiki page explaining how to [Build] sarg. If you have another identical system (possibly running on a virtual machine), you can install all the packages there, build sarg and then move the executable to the final system.

    If you can't duplicate your system or you think it is safe enough to install the development packages, or you plan to remove the tools once sarg is compiled, then install gcc, make and the development libraries. I don't have an exhaustive list. You'll have to run the configure script, find out what is required to satisfy the script and then find what package provides it on Endian. Don't hesitate to post the output. I'll help you find what is missing.

     
    • Dario Bruno

      Dario Bruno - 2015-06-13

      Hello Frederic,
      I let you know regarding the issue:
      I installed RHEL 4.5 and compiled the 2.3.10 release of SARG but the
      command "make install" give me the following error:

      [dario@RedHat/Fedora-based sarg-2.3.10]$ make install
      cd po ; make install
      make[1]: Entering directory /home/dario/sarg-2.3.10/po' *** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version 0.18 but the autoconf macros are from gettext version 0.19 make[1]: *** [check-macro-version] Error 1 make[1]: Leaving directory/home/dario/sarg-2.3.10/po'
      make: *** [install-po] Error 2
      [dario@RedHat/Fedora-based sarg-2.3.10]$

      I think the problem is regarding the version of gettext, isn't?
      So I try to install gettex from .rpm file but it ask me for dependecies
      that I'm not able to install.
      Do you have any idea?
      Thank you very much
      Best regards
      Dario

      Il 08/06/2015 19:06, Frederic Marchal ha scritto:

      You need a C compiler on the computer where you want to compile sarg.
      You'll also need make and a few development packages.

      But, I don't recommend to install all those packages on a server you
      want to keep secure. A compiler would allow an attacker to compile
      exploits once he has successfully broken into the computer.

      Instead, have a look at the wiki page explaining how to [Build]
      http://sourceforge.net/p/sarg/wiki/Build sarg. If you have another
      identical system (possibly running on a virtual machine), you can
      install all the packages there, build sarg and then move the executable
      to the final system.

      If you can't duplicate your system or you think it is safe enough to
      install the development packages, or you plan to remove the tools once
      sarg is compiled, then install gcc, make and the development libraries.
      I don't have an exhaustive list. You'll have to run the configure
      script, find out what is required to satisfy the script and then find
      what package provides it on Endian. Don't hesitate to post the output.
      I'll help you find what is missing.


      [support-requests:#40]
      http://sourceforge.net/p/sarg/support-requests/40 Unable to upgrade SARG

      Status: open
      Group: v1.0_(example)
      Created: Mon Jun 08, 2015 03:06 PM UTC by Dario Bruno
      Last Updated: Mon Jun 08, 2015 03:06 PM UTC
      Owner: nobody

      Hi there,
      I have a problem that drives me crazy.
      I'using Endian firewall (a Red Hat distro tailored for security) and the
      graph produced by SARG doesn't show any word, just the bars.
      The version of SARG used by Endian is 2.2.2 so I would like to upgrade
      it at the last one (2.3.10).
      I downloaded sarg-2.3.10.tar.gz
      I extracted the tarbal (tar zxfv sarg-2.3.10.tar.gz)
      then cd sarg-2.3.10 and ./configure but I got the following error:
      ./configure
      checking build system type... i686-pc-linux-gnuoldld
      checking host system type... i686-pc-linux-gnuoldld
      checking for gcc... no
      checking for cc... no
      checking for cl.exe... no
      configure: error: in |/temp/sarg-2.3.10': configure: error: no
      acceptable C compiler found in $PATH See|config.log' for more details

      (See in attach for the config.log)

      Do you have any suggestion for me?
      thank you so much
      Best regards
      Dario


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/sarg/support-requests/40/
      https://sourceforge.net/p/sarg/support-requests/40

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/
      https://sourceforge.net/auth/subscriptions

      --
      Dario Bruno
      PGP key: 0x8D83F768
      (keys.gnupg.net)

      ========================================================================

      ATTENZIONE!!
      Il presente messaggio ha contenuto confidenziale, e la sua lettura,
      allegati compresi, e' riservata esclusivamente ai destinatari previsti.
      Nel caso riteniate di non essere uno dei destinatari previsti, siete
      pregati di distruggere il messaggio e di informarne il mittente.

      WARNING!!
      This message contains confidential information, and it is intended to be
      read, attachments included, only by intended recipients.
      If you believe not to be one of the intended recipients, please destroy
      the message and inform the sender.

      ========================================================================

       

      Related

      Support Requests: #40

  • Dario Bruno

    Dario Bruno - 2015-06-08

    Hi Frederic,
    I'm using a test environment so I can install the compiler, create the executable then remove the compiler.
    I appreciate your kindness and I will keep you informed about this job.
    Best regards
    Dario

     
  • Frederic Marchal

    Right. My Gentoo box has gettext 0.19. Even thought the source code is designed to require gettext 0.18, the configure script was build with version 0.19. I'll have to find a way to guard the code against that…

    Nevertheless, it should be easily fixed by rebuilding the configure script with

    autoreconf -fi
    

    Run it in the sarg source directory where the configure script is. It will rebuild the configure script for the gettext version that's available on your system.

    You may need to install some development packages such as automake and autoconf but just try it out first.

    Then run ./configure and make as usual.

     
  • Evgeniy Yakushev

    Hello!
    I have the same message as Dario. So step by step.
    I run autoreconf -fi and see some output related to copying files.
    Then ./configure --prefix=/ --sysconfdir=/etc/sarg --enable-extraprotection
    Last lines of output:

    configure: creating ./config.status
    config.status: creating Makefile
    config.status: creating po/Makefile.in
    config.status: executing po-directories commands
    config.status: creating po/POTFILES
    config.status: creating po/Makefile
    configure: gd.h was not found so the graphs won't be available in the report
    configure: pcre.h was not found so the regexp won't be available in hostalias
    configure: ldap header files not found so LDAP is not available to resolve user's names
    configure: zlib.h was not found so it won't be possible to process gzipped files
    configure: bzlib.h was not found so it won't be possible to process bzipped files

    make runs with no issues.
    Then make install prints this:

    make -C po install
    make[1]: entering directory «/tmp/sarg-code/po»
    * error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version 0.18 but the autoconf macros are from gettext version 0.19
    Makefile:190: error executing recipe for target «check-macro-version»
    make[1]: * * [check-macro-version] Error 1
    make[1]: leaving directory «/tmp/sarg-code/po»
    Makefile:157: error executing recipe for target «install-po»
    make: *
    * [install-po] Error 2

    (These messages may look a bit different on system with only English language installed, it's a translation from system language of my PC).

    I've edited Makefile, found a line "install: all install-po" and removed "install-po". Then make install printed this:

    cp sarg //bin/sarg;
    chmod 755 //bin/sarg;
    cp sarg.1 //share/man/man1/sarg.1
    chmod 755 //share/man/man1/sarg.1
    cp ./exclude_codes /etc/sarg;
    cp ./user_limit_block /etc/sarg;
    cp -r ./images/* //share/sarg/images;
    cp -r ./css.tpl /etc/sarg;

    and sarg seems like installed.

    I guess it is installed with only English messages. Is it right? Will the program function normally? If yes, then is there a way to compile sarg with no extra language support? Some distros have gettext-0.17 only and upgrading it can be problematic.
    Will it plot graphs? What about gzipped files support and regexps in hostaliases?

     

    Last edit: Evgeniy Yakushev 2015-06-17
  • Frederic Marchal

    Yes, you are right! This is a solution and it is indeed possible to compile sarg without national language support. Run:

    ./configure --disable-nls
    

    I can't try it out myself as I completely broke the configure script trying to get rid of gettext 0.19.

    As for the last lines reported by configure, it means some optional development packages are not installed on your computer. Sarg can be compiled without them but the corresponding feature will be missing.

    For instance, gd.h is installed with libgd-dev or something equivalent for your distro. Without it, graphs won't be generated.

    zlib.h and bzlib.h means compressed access.log can't be read. You need to install the equivalent for zlib-dev and bzlib-dev.

    pcre.h is necessary to use regular expression in the host names.

     
  • Evgeniy Yakushev

    Hello!
    On my production server with CentOS 6.6 x86_64 I get this error:

    [root@proxy sarg-code]# autoreconf -fi
    configure.ac:126: warning: macro `AM_ICONV' not found in library
    configure.ac:222: warning: macro `AM_GNU_GETTEXT_VERSION' not found in library
    configure.ac:223: warning: macro `AM_GNU_GETTEXT' not found in library
    autoreconf: configure.ac: AM_GNU_GETTEXT_VERSION is used, but not AM_GNU_GETTEXT
    configure.ac:126: error: possibly undefined macro: AM_ICONV
          If this token and others are legitimate, please use m4_pattern_allow.
          See the Autoconf documentation.
    configure.ac:222: error: possibly undefined macro: AM_GNU_GETTEXT_VERSION
    configure.ac:223: error: possibly undefined macro: AM_GNU_GETTEXT
    autoreconf: /usr/local/bin/autoconf failed with exit status: 1
    

    In configure.ac I commented 12 lines after the line

    #Build with iconv
    

    and two lines starting with

    AM_GNU_GETTEXT
    

    Then autoreconf passed with no error. Okay, going on.

    Running

    ./configure --prefix=/ --sysconfdir=/etc/sarg --enable-extraprotection --disable-nls
    

    Errors and warnings:

    configure: WARNING: unrecognized options: --disable-nls
    

    Okay.
    The make command interrupts on this:

    gcc -std=gnu99  util.o log.o report.o topuser.o email.o sort.o html.o index.o getconf.o usage.o decomp.o ip2name.o ip2name_dns.o useragent.o exclude.o convlog.o totday.o repday.o datafile.o indexonly.o splitlog.o lastlog.o topsites.o siteuser.o css.o smartfilter.o denied.o authfail.o dichotomic.o redirector.o auth.o download.o grepday.o ip2name_exec.o dansguardian_log.o dansguardian_report.o realtime.o btree_cache.o usertab.o userinfo.o longline.o url.o fnmatch.o stringbuffer.o filelist.o readlog.o alias.o fileobject.o readlog_squid.o readlog_sarg.o readlog_extlog.o readlog_common.o -o sarg -lz -lldap -lgd  -lpcre @LIBINTL@ -lm
    gcc: @LIBINTL@: No such file or directory
    make: *** [sarg] Error 1
    

    I found out that it is a library related with gettext.
    Removing it from Makefile.in and changing "install: all install-po" to "install: all" in Makefile allow to compile and install the program with no errors.

    The installation process is quite complicated. Frederic, can you make it more simple?

     
  • Frederic Marchal

    Nobody is supposed to remove gettext from sarg. Doing that is expected to be difficult as you found out.

    The solution was to rebuild the configure script to use gettext 0.18 and not require 0.19 as I mistakenly packaged it.

    On this point, I finally managed to fix my problem with the autotools (one week lost for one stupid typo). I now have a working configure script and it looks like gettext 0.18 is now sufficient. I don't have the slightest idea about what I did to fix it!

    When you have all the required packages, the installation process is simple. Unfortunately, I was never able to build the list of required packages myself because, on my gentoo box, all the packages are already installed to build the system.

    If you or anybody else can help and provide a list of dependencies, I'll post it on the wiki page.

     
  • Evgeniy Yakushev

    I tried to install sarg on a clean system, CentOS 6.6 x86_64 (minimal).

    To run autoconf two packages are needed: autoconf and automake.
    The command to install is

    yum install autoconf automake
    

    Then you might have these errors:

    configure: gd.h was not found so the graphs won't be available in the report
    configure: zlib.h was not found so it won't be possible to process gzipped files
    configure: pcre.h was not found so the regexp won't be available in hostalias
    configure: ldap header files not found so LDAP is not available to resolve user's names
    configure: bzlib.h was not found so it won't be possible to process bzipped files
    

    Type

    yum install gd-devel pcre-devel bzip2-devel openldap-devel
    

    zlib-devel will be installed with dg-devel.

    But I can't get rid of this error:

    configure.ac:135: warning: macro `AM_ICONV' not found in library
    configure.ac:231: warning: macro `AM_GNU_GETTEXT_VERSION' not found in library
    configure.ac:232: warning: macro `AM_GNU_GETTEXT' not found in library
    autoreconf: configure.ac: AM_GNU_GETTEXT_VERSION is used, but not AM_GNU_GETTEXT
    configure.ac:10: error: possibly undefined macro: AM_GNU_GETTEXT
          If this token and others are legitimate, please use m4_pattern_allow.
          See the Autoconf documentation.
    configure.ac:135: error: possibly undefined macro: AM_ICONV
    configure.ac:231: error: possibly undefined macro: AM_GNU_GETTEXT_VERSION
    autoreconf: /usr/bin/autoconf failed with exit status: 1
    

    even though gettext-0.18.3 is installed from sources.

     
  • Frederic Marchal

    You must install gettext.

     
  • Evgeniy Yakushev

    Gettext was already installed. The pachacke gettext-devel was missing.

     
  • Evgeniy Yakushev

    On Open-SuSE 13.2 automake and autoconf packages were needed.
    Also you will need gd-devel pcre-devel openldap2-devel libbz2-devel.
    As related to gettext, install packages gettext-runtime and gettext-tools.
    This is for wiki.

     
  • Frederic Marchal

    Thank you very much. That is the information I was missing. I'll try to update the wiki soon.

     

Log in to post a comment.