Vote for this blog. Thank you

agungprasetyo blog's

It's about technology and life experience

Instalasi awstats di ubuntu server 8.10

Tutorial ini mengacu pada http://heker86.wordpress.com/2008/10/27/install-dan-kofigurasi-awstats/. Tetapi karena saya menggunakan ubuntu server 8.10, jadi beberapa bagian ada yang berbeda. Karena ubuntu sekarang untuk file konfigurasi apache bukan lagi httpd.conf, tetapi sudah menjadi apache2.conf dan beberapa penggolongan file menjadikannya lebih spesifik, tetapi lebih memusingkan.

Karena langkahnya hampir mirip, maka proses pertama kali cek apakah sudah terinstall perl. Pada ubuntu, anda bisa menggunakan perintah :

$ apt-get install perl

Oke… selanjutnya adalah proses instalasi untuk awstats. Sebenarnya untuk instalasi awstats ini juga bisa dilakukan dengan perintah apt-get install awstats, tetapi melihat beberapa tutorial di website lain, ada perbedaan path/file yang menyebabkan saya kurang “sreg” dengan instalasi hasil apt-get. Jadi memutuskan untuk menggunakan file sourcenya langsung.

  1. Langkah pertama, download terlebih dahulu paket awstats.
    • wget http://prdownloads.sourceforge.net/awstats/awstats-6.8.tar.gz


  2. Lakukan ekstrak ke direktori apache2 anda
    • tar xzvf awstats-6.8.tar.gz -C /var/www/
  3. Pindahlah ke direktori apache anda.
    • cd /var/www/
  4. Rename/rubah nama folder aswtats-6.8 menjadi awstats
    • mv awstats-6.8 awstats
  5. Setelah itu, masuk ke direktori tools
    • cd awstats/tools/
  6. Jalankan script perl di bawah ini untuk membuat file statistiknya.
    • ./awstats_configure.pl
      —– AWStats awstats_configure 1.0 (build 1.8) (c) Laurent Destailleur —–
      This tool will help you to configure AWStats to analyze statistics for
      one web server. You can try to use it to let it do all that is possible
      in AWStats setup, however following the step by step manual setup
      documentation (docs/index.html) is often a better idea. Above all if:
      – You are not an administrator user,
      – You want to analyze downloaded log files without web server,
      – You want to analyze mail or ftp log files instead of web log files,
      – You need to analyze load balanced servers log files,
      – You want to ‘understand’ all possible ways to use AWStats…
      Read the AWStats documentation (docs/index.html).
      —–> Running OS detected: Linux, BSD or Unix
      Warning: AWStats standard directory on Linux OS is ‘/usr/local/awstats’.
      If you want to use standard directory, you should first move all content
      of AWStats distribution from current directory:
      /var/www/html/awstats
      to standard directory:
      /usr/local/awstats
      And then, run configure.pl from this location.
      Do you want to continue setup from this NON standard directory [yN] ? y
      —–> Check for web server install
      Enter full config file path of your Web server.
      Example: /etc/httpd/httpd.conf
      Example: /usr/local/apache2/conf/httpd.conf
      Example: c:\Program files\apache group\apache\conf\httpd.conf
      Config file path (’none’ to skip web server setup):
      > /etc/apache2/apache2.conf
      —–> Check and complete web server config file ‘/etc/apache2/apache2.conf’
      Add Alias ‘/awstatsclasses “/var/www/awstats/wwwroot/classes/”‘
      Add Alias ‘/awstatscss “/var/www/awstats/wwwroot/css/”‘
      Add Alias ‘/awstatsicons “/var/www/awstats/wwwroot/icon/”‘
      Add ‘ScriptAlias /awstats/ “/var/www/awstats/wwwroot/cgi-bin/”‘
      Add ‘’ directive
      AWStats directives added to Apache config file.
      —–> Update model config file ‘/var/www/awstats/wwwroot/cgi-bin/awstats.model.conf’
      File awstats.model.conf updated.
      —–> Need to create a new config file ?
      Do you want me to build a new AWStats config/profile
      file (required if first install) [y/N] ? y
      —–> Define config file name to create
      What is the name of your web site or profile analysis ?
      Example: www.mysite.com
      Example: demo
      Your web site, virtual server or profile name:
      > digilib.stikom.edu
      —–> Define config file path
      In which directory do you plan to store your config file(s) ?
      Default: /etc/awstats
      Directory path to store config file(s) (Enter for default):
      > <== Silahkan tekan enter saja
      —–> Create config file ‘/etc/awstats/awstats.digilib.stikom.edu.conf’
      Config file /etc/awstats/awstats.digilib.stikom.edu.conf created.
      —–> Restart Web server with ‘/sbin/service httpd restart’
      Stopping httpd: [ OK ]
      Starting httpd: [ OK ]
      —–> Add update process inside a scheduler
      Sorry, configure.pl does not support automatic add to cron yet.
      You can do it manually by adding the following command to your cron:
      /var/www/awstats/wwwroot/cgi-bin/awstats.pl -update -config=digilib.stikom.edu
      Or if you have several config files and prefer having only one command:
      /var/www/awstats/tools/awstats_updateall.pl now
      Press ENTER to continue… <== Tekan enter
      A SIMPLE config file has been created: /etc/awstats/awstats.digilib.stikom.edu.conf
      You should have a look inside to check and change manually main parameters.
      You can then manually update your statistics for ‘digilib.stikom.edu’ with command:
      > perl awstats.pl -update -config=digilib.stikom.edu
      You can also read your statistics for ‘digilib.stikom.edu’ with URL:
      > http://localhost/awstats/awstats.pl?config=digilib.stikom.edu
      Press ENTER to finish… <== Tekan enter untuk finish
  7. Script awstats_configure.pl tadi secara otomatis akan menambahkan pada file konfigurasi apache2.conf
    • pico /etc/apache2/apache2.conf
      [..]
      #
      # Directives to allow use of AWStats as a CGI
      #
      Alias /awstatsclasses “/var/www/awstats/wwwroot/classes/”
      Alias /awstatscss “/var/www/awstats/wwwroot/css/”
      Alias /awstatsicons “/var/www/awstats/wwwroot/icon/”
      ScriptAlias /awstats/ “/var/www/awstats/wwwroot/cgi-bin/”
      #
      # This is to permit URL access to scripts/files in AWStats directory.
      #
      <Directory “/var/www/awstats/wwwroot”>
      Options None
      AllowOverride None
      Order allow,deny
      Allow from all
      </Directory>
      [..]
  8. Edit file awstats.digilib.stikom.edu.conf menjadi seperti dibawah ini.
    • pico /etc/awstats/awstats.digilib.stikom.edu.conf
      LogFile="/var/log/httpd/mylog.log" menjadi LogFile="/var/log/apache2/access.log"
      DirData="/var/lib/awstats” menjadi DirData="/var/www/awstats"
      SiteDomain="digilib.stikom.edu" <== Pastikan juga terdapat ini.
  9. Jalankan command dibawah ini untuk update database awstats.
    • /var/www/awstats/wwwroot/cgi-bin/awstats.pl -config=digilib.stikom.edu -update
      Create/Update database for config “/etc/awstats/awstats.digilib.stikom.edu.conf” by AWStats version 6.8 (build 1.910)
      From data in log file “/var/log/apache2/access.log”…
      Phase 1 : First bypass old records, searching new record…
      Searching new records from beginning of log file…
      Phase 2 : Now process new records (Flush history on disk after 20000 hosts)…
      Jumped lines in file: 0
      Parsed lines in file: 123
      Found 0 dropped records,
      Found 0 corrupted records,
      Found 0 old records,
      Found 123 new qualified records.
  10. Kemudian buka browser anda dengan mengetikkan http://digilib.stikom.edu/awstats/awstats.pl?config=digilib.stikom.edu
  11. Nah, dari sini error mulai muncul. Karena apache2 menggunakan file berbeda untuk penempatan alias, maka anda perlu melakukan sedikit modifikasi agar alias anda dikenali. Edit file apache2.conf.
    • pico /etc/apache2/apache2.conf
      [..]
      #
      # Directives to allow use of AWStats as a CGI
      #
      Alias /awstatsclasses “/var/www/awstats/wwwroot/classes/”
      Alias /awstatscss “/var/www/awstats/wwwroot/css/”
      Alias /awstatsicons “/var/www/awstats/wwwroot/icon/”
      ScriptAlias /awstats/ “/var/www/awstats/wwwroot/cgi-bin/”
      #
      # This is to permit URL access to scripts/files in AWStats directory.
      #
      <Directory “/var/www/awstats/wwwroot”>
      Options None
      AllowOverride None
      Order allow,deny
      Allow from all
      </Directory>
      [..]
  12. Carilah bagian script seperti contoh diatas, lalu lakukan Copy dan Paste ke file alias.conf. Anda bisa membuka 2 terminal untuk proses ini atau melakukan Paste terlebih dahulu di misalkan notepad atau editor yang anda sukai.
    • pico /etc/apache2/mods-available/alias.conf
      <IfModule alias_module>
      #
      # Aliases: Add here as many aliases as you need (with no limit). The format is
      # Alias fakename realname
      #
      # Note that if you include a trailing / on fakename then the server will
      # require it to be present in the URL.  So “/icons” isn’t aliased in this
      # example, only “/icons/”.  If the fakename is slash-terminated, then the
      # realname must also be slash terminated, and if the fakename omits the
      # trailing slash, the realname must also omit it.
      #
      # We include the /icons/ alias for FancyIndexed directory listings.  If
      # you do not use FancyIndexing, you may comment this out.
      #
      Alias /awstatsclasses “/var/www/awstats/wwwroot/classes/”
      Alias /awstatscss “/var/www/awstats/wwwroot/css/”
      Alias /awstatsicons “/var/www/awstats/wwwroot/icon/”
      ScriptAlias /awstats/ “/var/www/awstats/wwwroot/cgi-bin/”#
      # This is to permit URL access to scripts/files in AWStats directory.
      #
      <Directory “/var/www/awstats/wwwroot”>
      Options None
      AllowOverride None
      Order allow,deny
      Allow from all
      </Directory>
      [..]
  13. Jika sudah, simpan file alias.conf. Sedangkan untuk potongan script alias dari awstats pada file apache2.conf, hapus saja.
  14. Sekarang buka kembali http://digilib.stikom.edu/awstats/awstats.pl?config=digilib.stikom.edu, dan violaa!!! aplikasi awstats berjalan sukses!
  15. Untuk melakukan update database melalui browser, anda harus merubah command seperti dibawah ini.
    • pico /etc/awstats/awstats.digilib.stikom.edu.conf
      AllowToUpdateStatsFromBrowser=0 menjadi
      AllowToUpdateStatsFromBrowser=1
  16. Serta jangan lupa juga merubah permision folder di bawah ini.
    • chmod 777 -R /var/log/apache2/
    • chmod 777 -R /var/www/awstats/
  17. Sekarang buka kembali browser anda dan click tombol “Update Now”

    copyright image by heker86.wordpress.com
  18. Maka secara otomatis database awstats akan terupdate, coba perhatikan HITS – nya apakah ada perubahan atau tidak. Jika ada, maka selamat! anda baru saja mempunyai tools untuk menganalisa statistik log dari sistem anda.

Nah, itulah sedikit pengalaman sewaktu instalasi awstats kemarin. Bagi yang tidak menggunakan ubuntu bisa mengacu pada link heker86, tetapi jika anda menggunakan ubuntu, saya berharap tutorial ini berguna dan bermanfaat bagi anda.

Previous

Nasi Rawon rasa standar harga mengecewakan

Next

Kerja Keras Untuk Website Perpustakaan

1 Comment

  1. mas, setelah updating kok yg muncul ini ya?
    “No qualified records found in log (0 corrupted, 0 dropped) ” 

    trus satu lg, spy awstats kita gak bisa dibuka org lain gmn? 

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Powered by Lovecraft & Theme by Anders Norén

Policy Privacy | Disclaimer

Verified by MonsterInsights