How to compile 'webalizer' (without errors) to add the functionality we want

redesb

Verified User
Joined
May 10, 2004
Messages
207
Location
Spain
Since most of my users do not read English too well, needed 'webalizer' submit their reports in his native language, for this reason it was necessary to recompile.

However, in doing so I found a problem with the inclusion of the 'gd' library, which obviously was not available because he had not installed the 'gd-devel' package.

Calling the package manager (yum in this case) to install 'gd-devel' forced me to install more than 12 packages for dependency issues, most packages already installed by 'custombuild' and did not wish to install only to compile 'webalizer'.

To avoid having to install all these packages and to compile 'webalizer' error free, we can do the following:

First, we disable 'webalizer' in 'custombuild' (webalizer=no).

Next, we go to the 'custombuild' directory, which should already have the sources of 'webalizer', otherwise, we will download it as also download the 'gd' sources.

Code:
cd /usr/local/directadmin/custombuild
wget http://pkgs.fedoraproject.org/repo/pkgs/gd/gd-2.0.35.tar.bz2/6c6c3dbb7bf079e0bb5fbbfd3bb8a71c/gd-2.0.35.tar.bz2

# If needed
wget ftp://ftp.mrunix.net/pub/webalizer/webalizer-2.23-08-src.tgz

Then compile 'gd'.
Code:
tar xjf gd-2.0.35.tar.bz2 --no-same-owner
cd gd-2.0.35
./configure
make
# Install on default '/usr/local' path
make install

And then, we compiled 'webalizer', but first rename the current file in case we needed to go back.
Code:
mv /usr/bin/webalizer /usr/bin/webalizer.moved
tar xzf webalizer-2.23-08-src.tgz --no-same-owner
cd webalizer-2.23-08
./configure --prefix=/usr --with-png=/usr/lib --with-gdlib=/usr/local/lib --with-gd=/usr/local/include --enable-dns --with-dblib --with-db --with-z-inc --with-zlib --with-language=catalan
make
make install
To select the language you want, check the 'lang' directory that exists within the webalizer directory.

Now, to check it, we will run the new 'webalizer' with data from one of our domains, but first to make sure nothing is lost, we can compress the existing statistical data.

To compress...
Code:
cd /home/[username]/domains/[domain.tld]/stats
tar cz --remove-files -f old_stats.tgz
And then...
Code:
webalizer -p -n [domain.tld] -o /home/[username]/domains/[domain.tld]/stats /var/log/httpd/domains/[domain.tld].log
If the test worked properly, we should be able to access the new statistics (remember to clear the cache, 'Ctrl + F5' in Firefox)

And finally, we will clean...
Code:
cd /usr/local/directadmin/custombuild/gd-2.0.35
make uninstall
cd ..
rm -rf gd-2.0.35
rm -rf webalizer-2.23-08
rm -f /usr/bin/webalizer.moved

Note:
These operations were performed on a server with 'CentOS 6.6 Final', DirectAdmin 1.46.3 and custombuild 2.0, if conditions change, may have to slightly adapt the procedure.

That's all, I hope it helps someone...
 
Back
Top