{"id":135,"date":"2009-01-10T13:44:34","date_gmt":"2009-01-10T06:44:34","guid":{"rendered":"http:\/\/blog.binus-edu.com\/?p=135"},"modified":"2009-04-02T10:58:26","modified_gmt":"2009-04-02T03:58:26","slug":"how-to-install-and-configure-webalizer-in-multiple-domain-on-centos-46","status":"publish","type":"post","link":"https:\/\/adityo.blog.binusian.org\/?p=135","title":{"rendered":"How to install and configure webalizer in multiple domain on Centos 4.6"},"content":{"rendered":"<p style=\"text-align: justify;\"><span style=\"font-size: large;\">What is Webalizer ? <\/span><\/p>\n<p class=\"rtejustify\" style=\"line-height: 18.75pt; text-align: justify;\"><span style=\"border: 1pt none windowtext; padding: 0in; font-size: 10pt; font-family: Verdana;\">Webalizer is a fast, free web server log file analysis program. It produces highly detailed, easily configurable usage reports in HTML format, for viewing with a standard web browser. It was written to solve several problems with currently available analysis packages. A vast majority of them were written in Perl or some other scripting language, and took forever to run. Some were not free. Some even produced wrong results, or results that were not in a useful format.<\/span><\/p>\n<h2 class=\"rtejustify\" style=\"text-align: justify;\"><span style=\"font-size: medium;\"><span style=\"border: 1pt none windowtext; padding: 0in; font-family: Verdana;\">Webalizer features<\/span><\/span><\/h2>\n<ul>\n<li style=\"text-align: justify;\"><span style=\"border: 1pt none windowtext; padding: 0in; font-size: 10pt; font-family: Verdana;\">It is written in C to be extremely fast and highly portable. On a 200 MHz Pentium machine, over 10,000 records can be processed in one second, with a 40 Megabyte file taking roughly 15 seconds (over 150,000 records). <\/span><\/li>\n<li style=\"text-align: justify;\"><span style=\"border: 1pt none windowtext; padding: 0in; font-size: 10pt; font-family: Verdana;\">Supports standard Common log file Format server logs. In addition, several variations of the combined log file Format are supported, allowing statistics to be generated for referring sites and browser types as well. Now also has native support for wu-ftpd xferlog FTP and squid log formats as well. <\/span><\/li>\n<li style=\"text-align: justify;\"><span style=\"border: 1pt none windowtext; padding: 0in; font-size: 10pt; font-family: Verdana;\">Generated reports can be configured from the command line, or by use of one or more configuration files. Detailed information on configuration options can be found in the README file, supplied with all distributions. <\/span><\/li>\n<li style=\"text-align: justify;\"><span style=\"border: 1pt none windowtext; padding: 0in; font-size: 10pt; font-family: Verdana;\">Supports multiple languages. Currently, Catalan, Chinese (traditional and simplified), Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, Galician, German, Greek, Hungarian, Icelandic, Indonesian, Italian, Japanese, Korean, Latvian, Malay, Norwegian, Polish, Portuguese (Portugal and Brazil), Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, Turkish and Ukrainian are available. <\/span><\/li>\n<li style=\"text-align: justify;\"><span style=\"border: 1pt none windowtext; padding: 0in; font-size: 10pt; font-family: Verdana;\">Unlimited log file sizes and partial logs are supported, allowing logs to be rotated as often as needed, and eliminating the need to keep huge monthly files on the system.<\/span><\/li>\n<li style=\"text-align: justify;\"><span style=\"border: 1pt none windowtext; padding: 0in; font-size: 10pt; font-family: Verdana;\">Distributed under the GNU General Public License, complete source code is available as well as binary distributions for some of the more popular platforms.<\/span><\/li>\n<\/ul>\n<h2 class=\"rtejustify\" style=\"text-align: justify;\"><span style=\"font-size: medium;\">Installation<\/span><\/h2>\n<p class=\"rtejustify\" style=\"text-align: justify;\">\u00a0I assume you have apache \/ httpd installed now we just need to install the webalizer, and we can do it using yum or compile the sourcode. Let&#8217;s start by compile it through source code.<\/p>\n<p class=\"rtejustify\" style=\"text-align: justify;\">Installing through sourcecode<\/p>\n<p class=\"rtejustify\" style=\"text-align: justify;\">1. First we need to download the webalizer sourcode first<\/p>\n<p style=\"text-align: justify;\"><code>wget <a title=\"ftp:\/\/ftp.mrunix.net\/pub\/webalizer\/webalizer-2.20-01-src.tgz\" href=\"ftp:\/\/ftp.mrunix.net\/pub\/webalizer\/webalizer-2.20-01-src.tgz\">ftp:\/\/ftp.mrunix.net\/pub\/webalizer\/webalizer-2.20-01-src.tgz<\/a><\/code><\/p>\n<p class=\"rtejustify\" style=\"text-align: justify;\">2. Then we need to uncompress it<\/p>\n<pre class=\"rtejustify\" style=\"text-align: justify;\"> tar zxvf webalizer-2.20-01-src.tgz<\/pre>\n<p class=\"rtejustify\" style=\"text-align: justify;\">\u00a03. Makesure you have gcc compiler and Gd library installed, you can installed it using yum<\/p>\n<pre class=\"rtejustify\" style=\"text-align: justify;\"> yum install gcc gcc-c++ gd-devel<\/pre>\n<p class=\"rtejustify\" style=\"text-align: justify;\">4.. Then we go to webalizer-2.20-01 directory , compile and install it<\/p>\n<pre class=\"rtejustify\" style=\"text-align: justify;\"> cd webalizer-2.20-01\r\n .\/configure\r\n make\r\n make instal<\/pre>\n<p class=\"rtejustify\" style=\"text-align: justify;\">\u00a0It is installed and you can checked the version now<\/p>\n<pre class=\"rtejustify\" style=\"text-align: justify;\">webalizer --version\r\nWebalizer V2.20-01 (Linux 2.6.18-92.1.1.el5.028stab057.2 i686) English<\/pre>\n<p class=\"rtejustify\" style=\"text-align: justify;\">Installing with YUM<\/p>\n<p class=\"rtejustify\" style=\"text-align: justify;\">1. Just run the yum install\u00a0 command<\/p>\n<pre class=\"rtejustify\" style=\"text-align: justify;\">yum -y install webalizer<\/pre>\n<p class=\"rtejustify\" style=\"text-align: justify;\">it should install the webalizer but the version are more old that the sourcode version, the yum webalizer version was webalizer 2.01_10-25\u00a0<\/p>\n<h2 class=\"rtejustify\" style=\"text-align: justify;\">How to configure it<\/h2>\n<p class=\"rtejustify\" style=\"text-align: justify;\">1. Create a central directory for the <tt class=\"command\">webalizer<\/tt> configuration files<\/p>\n<pre class=\"screen rtejustify\" style=\"text-align: justify;\">mkdir \/etc\/webalizer<\/pre>\n<p class=\"rtejustify\" style=\"text-align: justify;\">2. Create two <tt class=\"command\">webalizer<\/tt> configuration files, <tt class=\"command\">a.example.conf<\/tt> from the<br \/>\nsample file and put it into <tt class=\"command\">\/etc\/webalizer<\/tt> directory. You need to locate the webalizer.conf.sample files and copy it to \/etc\/webalizer directory<\/p>\n<pre class=\"screen rtejustify\" style=\"text-align: justify;\">cp \/usr\/local\/etc\/webalizer.conf.sample  \/etc\/webalizer\/a.example.com.conf<\/pre>\n<p class=\"rtejustify\" style=\"text-align: justify;\">\u00a0<\/p>\n<p class=\"rtejustify\" style=\"text-align: justify;\">3. Modify <tt class=\"command\">LogFile<\/tt>, <tt class=\"command\">OutputDir<\/tt> and <tt class=\"command\">HostName<\/tt> of the\u00a0 <tt class=\"command\">webalizer<\/tt> config files. For example, for <tt class=\"command\">a.example.com.conf<\/tt><\/p>\n<p class=\"rtejustify\" style=\"text-align: justify;\">\u00a0<\/p>\n<p style=\"text-align: justify;\">vi \/etc\/webalizer\/a.example.com.conf<br \/>\nand changes the content<\/p>\n<p style=\"text-align: justify;\"><code>LogFile \/var\/log\/httpd\/access_log<br \/>\ninto<br \/>\nLogFile \/var\/log\/httpd\/access_log_1\u00a0 # <span style=\"color: #ff0000;\">it depend on your httpd access_log you\u00a0 can search it on \/var\/log\/httpd\/ directory <\/span><br \/>\nOutputDir \/var\/www\/usage\/a into OutputDir\u00a0 \/home\/praetorian-id.org\/public_html\/webalizer\u00a0 # <span style=\"color: #ff0000;\">it depend on your\u00a0 apache virtual directory that you set on httpd.conf (\/etc\/httpd\/conf\/httpd.conf)<\/span> <\/code><\/p>\n<p style=\"text-align: justify;\"><code>HostName\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 localhost\u00a0 into <\/code><\/p>\n<p style=\"text-align: justify;\"><code>HostName\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 praetorian-id.org\u00a0 # <span style=\"color: #ff0000;\">it depend on your web hostname<\/span>\u00a0 <\/code><\/p>\n<p class=\"rtejustify\" style=\"text-align: justify;\"><strong>Note:<\/strong>You may want to specify other settings specific to the domain, such as <tt class=\"command\">HideReferrer<\/tt>, <tt class=\"command\">HideSite<\/tt>, etc.<\/p>\n<p class=\"rtejustify\" style=\"text-align: justify;\">4. To process all the virtual sites, run the following command:<\/p>\n<pre class=\"screen rtejustify\" style=\"text-align: justify;\"># for i in \/etc\/webalizer\/*.conf; do webalizer -c $i; done<\/pre>\n<p class=\"rtejustify\" style=\"text-align: justify;\">Now you can see the webalizer files on your site, example :<\/p>\n<p class=\"rtejustify\" style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-185\" title=\"3-12-2009-12-34-14-pm\" src=\"http:\/\/adityo.blog.binusian.org\/files\/2009\/01\/3-12-2009-12-34-14-pm.png\" alt=\"3-12-2009-12-34-14-pm\" width=\"600\" height=\"354\" srcset=\"https:\/\/adityo.blog.binusian.org\/files\/2009\/01\/3-12-2009-12-34-14-pm.png 600w, https:\/\/adityo.blog.binusian.org\/files\/2009\/01\/3-12-2009-12-34-14-pm-300x177.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p class=\"rtejustify\" style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-187\" title=\"3-12-2009-12-34-53-pm1\" src=\"http:\/\/adityo.blog.binusian.org\/files\/2009\/01\/3-12-2009-12-34-53-pm1.png\" alt=\"3-12-2009-12-34-53-pm1\" width=\"600\" height=\"2660\" \/><\/p>\n<p class=\"rtejustify\" style=\"text-align: justify;\"><span style=\"font-size: medium;\"><strong>How to set Webalizer on multiple virtual domain <\/strong>:<\/span><\/p>\n<p class=\"rtejustify\" style=\"text-align: justify;\">Tha above tutorial are to set the webalizer for singel domain, how about if\u00a0 you needed to create webalizer for multiple domain ? , you need to makesure that you have create custom log on your every virtual domain setting on httpd.conf it is usually on \/usr\/local\/apache\/conf\/httpd.conf , here is the eample :<\/p>\n<pre class=\"rteleft\" style=\"text-align: justify;\">&lt;VirtualHost 222.11.222.33&gt;\r\n    ServerName test.com\r\n    ServerAlias <a title=\"www.test.com\" href=\"http:\/\/www.test.com\/\">www.test.com<\/a>\r\n\u00a0\u00a0\u00a0 DocumentRoot \"\/home\/domains\/test.com\/htdocs\"\r\n\u00a0\u00a0\u00a0 CustomLog \"\/home\/domains\/test.com\/logs\/access_log\" common\r\n&lt;\/VirtualHost&gt;<\/pre>\n<p class=\"rtejustify\" style=\"text-align: justify;\">as you can see above, i set the custom log on \/home\/domains\/test.com\/logs\/access_log , please also make sure you have create the\u00a0 \/home\/domains\/test.com\/logs directory and set\u00a0 the permission was set for\u00a0 domains users<\/p>\n<pre class=\"rteleft\" style=\"text-align: justify;\">-rw-r--r-- 1 domains users 677485 Jan  7 19:55 access_log<\/pre>\n<p class=\"rtejustify\" style=\"text-align: justify;\">\u00a0<\/p>\n<p class=\"rtejustify\" style=\"text-align: justify;\">then set the log path on your webalizer conf on \/etc\/webalizer\/<\/p>\n<pre class=\"rteleft\" style=\"text-align: justify;\"># vi \/etc\/webalizer\/test.conf\r\n\r\nLogFile         \/home\/domains\/test.com\/logs\/access_log<\/pre>\n<p class=\"rtejustify\" style=\"text-align: justify;\">\u00a0<\/p>\n<p class=\"rtejustify\" style=\"text-align: justify;\">then set it per virtual domain that you have \ud83d\ude42<\/p>\n<p class=\"rtejustify\" style=\"text-align: justify;\">and last thing ,\u00a0 restart the httpd , if you are using rpm<\/p>\n<pre class=\"rteleft\" style=\"text-align: justify;\"># service httpd restart<\/pre>\n<p class=\"rtejustify\" style=\"text-align: justify;\">if using httpd source binary, checked the apache process on ps aux<\/p>\n<pre class=\"rteleft\" style=\"text-align: justify;\"># ps aux | grep daemon\r\n\r\ndaemon   10523  0.0  0.0  21556  8704 ?   S    20:07   0:00 \/usr\/local\/apache\/bin\/httpd<\/pre>\n<p class=\"rtejustify\" style=\"text-align: justify;\">the apache was installed on  \/usr\/local\/apache find the apachectl on \/usr\/local\/apache\/bin\/apachectl and restart it<\/p>\n<pre class=\"rteleft\" style=\"text-align: justify;\"># \/usr\/local\/apache\/bin\/apachectl restart<\/pre>\n<p class=\"rtejustify\" style=\"text-align: justify;\">You should see the size of the access_logs on \/home\/domains\/test.com\/logs\/access_log increase , if not checked the permission and webalizer config on \/etc\/webalizer\/test.com.conf<\/p>\n<p class=\"rtejustify\" style=\"text-align: justify;\">\u00a0Do not forget to add cron so the webalizer can be udpated automaticly<\/p>\n<pre class=\"rteleft\" style=\"text-align: justify;\">#crontab -e\r\n\r\n1 * * * * \/root\/dowebalizer &gt;&gt;\/dev\/null 2&gt;&amp;1<\/pre>\n<p class=\"rtejustify\" style=\"text-align: justify;\">i will set the crontab every 1 hour to execute the shell script on \/root\/dowebalizer<\/p>\n<p class=\"rtejustify\" style=\"text-align: justify;\">Here is the cron list explanation\u00a0 :<\/p>\n<ol>\n<li class=\"rteleft\" style=\"text-align: justify;\">minute (0-59),<\/li>\n<li class=\"rteleft\" style=\"text-align: justify;\">hour (0-23),<\/li>\n<li class=\"rteleft\" style=\"text-align: justify;\">day of the month (1-31),<\/li>\n<li class=\"rteleft\" style=\"text-align: justify;\">month of the year (1-12),<\/li>\n<li class=\"rteleft\" style=\"text-align: justify;\">day of the week (0-6 with 0=Sunday).<\/li>\n<\/ol>\n<p class=\"rteleft\" style=\"text-align: justify;\">ooh ya , don&#8217;t forget to create the shell script on \/root\/dowebalizer<\/p>\n<pre class=\"rteleft\" style=\"text-align: justify;\">vi \/root\/dowebalizer<\/pre>\n<pre class=\"rteleft\" style=\"text-align: justify;\">#!\/usr\/bin\/perl\r\nuse strict;\r\n\r\nmy @files = &lt;\/etc\/webalizer\/*.conf&gt;;\r\n\r\nforeach my $file (@files) {\r\n        chomp($file);\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 system(\"\/usr\/local\/bin\/webalizer -c $file\");\r\n}\r\n\u00a0<\/pre>\n<p style=\"text-align: justify;\">\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>What is Webalizer ? Webalizer is a fast, free web server log file analysis program. It produces highly detailed, easily configurable usage reports in HTML format, for viewing with a standard web browser. It was written to solve several problems with currently available analysis packages. A vast majority of them were written in Perl or [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[487,498],"tags":[904],"class_list":["post-135","post","type-post","status-publish","format-standard","hentry","category-centos","category-webalizer","tag-modifconfigure-webalizer-on-centos"],"_links":{"self":[{"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/posts\/135","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=135"}],"version-history":[{"count":3,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/posts\/135\/revisions"}],"predecessor-version":[{"id":275,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/posts\/135\/revisions\/275"}],"wp:attachment":[{"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=135"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}