You are not authorized to post comments.

Unix Tip: Building and Using Analog on Solaris

By Sandra Henry-Stocker, ITworld.com |  Hardware Add a new comment

Send in your Unix questions today!


See additional Unix tips and tricks



Analog is a free web traffic analysis tool that prepares reports on activity on your web sites, including graphs that summarize hourly, daily, file size file type, visiting site, return codes and numerous other statistics that illustrate how your web sites are being used. I recently compiled and deployed Analog on a couple of Solaris 9 servers. Today's column is a how-to on building Analog and a quick introduction to how it works.



To compile Apache on a Solaris system, you should first grab a copy of the source code. I went to http://www.analog.cx/download.html and downloaded analog-6.0.tar.gz. This command should work on the command line if you have wget installed:



wget http://www.analog.cx/analog-6.0.tar.gz



I then gunzipped and extracted the contents of the downloaded file and attempted to compile the application:
$ gunzip analog-6.0.tar.gz
$ tar xf analog-6.0.tar
$ cd analog-6.0
$ make



My attempt to compile Analog ran into some problems -- notably undefined symbols.

        $ make
        cd src && make
        make[1]: Entering directory `/export/home/henrystocker/analog-6.0/src'
        gcc            -O2      -DUNIX          -c alias.c
        gcc            -O2      -DUNIX          -c analog.c
        gcc            -O2      -DUNIX          -c cache.c
        ... omitted output ...
        Undefined                       first referenced
         symbol                             in file
        gethostbyaddr                       alias.o
        inet_addr                           alias.o
        ld: fatal: Symbol referencing errors. No output written to ../analog
        collect2: ld returned 1 exit status
        make[1]: *** [analog] Error 1
        make[1]: Leaving directory `/export/home/henrystocker/analog-6.0/src'
        make: *** [analog] Error 2

I soon figured out that I needed to make a small change to one of my Makefiles. I made the change with this perl command, adding the network services library after noting that the man pages for the undefined symbols both referenced -lnsl.

        $ cd src
        $ perl -i -p -e "s/LIBS = -lm/LIBS = -lnsl -lm/" Makefile

My LIBS line then looked like this: 

        LIBS = -lnsl -lm (added -lnsl)

After this change, Analog compiled without a hitch: 

        $ cd ..
        $ make
        cd src && make
        make[1]: Entering directory `/export/home/shs/analog-6.0/src'
        gcc            -O2      -DUNIX          -c alias.c
        gcc            -O2      -DUNIX          -c analog.c
        gcc            -O2      -DUNIX          -c cache.c
        ... omitted output ...
        gcc            -O2     -o ../analog alias.o analog.o cache.o dates.o
        globals.o hash.o init.o init2.o input.o macinput.o macstuff.o output.o
        output2.o outcro.o outhtml.o outlatex.o outplain.o outxhtml.o outxml.o
        process.o settings.o sort.o tree.o utils.o win32.o libgd/gd.o
        libgd/gd_io.o libgd/gd_io_file.o libgd/gd_png.o libgd/gdfontf.o
        libgd/gdfonts.o libgd/gdtables.o libpng/png.o libpng/pngerror.o
        libpng/pngmem.o libpng/pngset.o libpng/pngtrans.o libpng/pngwio.o
        libpng/pngwrite.o libpng/pngwtran.o libpng/pngwutil.o pcre/pcre.o
        zlib/adler32.o zlib/compress.o zlib/crc32.o zlib/deflate.o zlib/gzio.o
        zlib/infblock.o zlib/infcodes.o zlib/inffast.o zlib/inflate.o
        zlib/inftrees.o zlib/infutil.o zlib/trees.o zlib/uncompr.o zlib/zutil.o
        unzip/ioapi.o unzip/unzip.o bzip2/bzlib.o bzip2/blocksort.o
        bzip2/compress.o bzip2/crctable.o bzip2/decompress.o bzip2/huffman.o
        bzip2/randtable.o -lnsl -lm
        make[1]: Leaving directory `/export/home/shs/analog-6.0/src'

        $ ls -l analog
        -rwxr-xr-x   1 root     other     577568 Mar 29 19:34 analog

Once Analog was compiled, I moved it into /usr/local/bin (there was no "make install" option) and ran a "make clean" to remove object files. At this point, I had switched over to root.

ITworld LIVE

HardwareWhite Papers & Webcasts

White Paper

Deliver Cost-Effective Business Continuity with Extreme Capacity

IBM DB2 provides application cluster transparency technology that equips organizations running OLTP applications with the ability to deliver high availability and continuous uptime for transactional data, plus the flexibility and capacity they need to remain competitive.

White Paper

Expert Tips for Consolidating Servers & Avoiding Sprawl

The combined computing demands of VMs can tax even the most powerful server. Cost-effectiveness doesn't mean excessive consolidation; rather, it means balancing workloads between multiple servers. This expert FAQ guide will help you to decide which servers and applications are candidates for virtualization.

White Paper

Expert Guide to Secure Your Active Directory

Layered security is the way to go when it comes to protecting Active Directory. This expert e-guide explains the best method to use when planning and designing a security solution. Find out why it is important to secure Group Policy settings and discover how managed service accounts boost server security in R2.

White Paper

Windows Server 2008 R2 Learning Guide

This expert e-guide uncovers the most common questions that have surfaced with Windows Server 2008 R2. Learn details about this Microsoft operating system and discover the direct cost saving benefits IT departments can experience when making the switch.

White Paper

Best Practices to Achieve Optimal Memory Allocation and Remote Desktop User Experience

Many virtual machines don't fully utilize their available RAM, just like they don't fully utilize their available processors. But Dynamic Memory enables you to shuffle the deck and move some of that RAM around to go where it's needed for better consolidation and efficiency.

See more White Papers | Webcasts

Ask a question

Ask a Question