หน้าเว็บ

วันพฤหัสบดีที่ 15 ตุลาคม พ.ศ. 2552

What is AWStats?

What is AWStats

AWStats is a free powerful and featureful tool that generates advanced web, streaming, ftp or mail server statistics, graphically. This log analyzer works as a CGI or from command line and shows you all possible information your log contains, in few graphical web pages. It uses a partial information file to be able to process large log files, often and quickly. It can analyze log files from all major server tools like Apache log files (NCSA combined/XLF/ELF log format or common/CLF log format), WebStar, IIS (W3C log format) and a lot of other web, proxy, wap, streaming servers, mail servers and some ftp servers.
Take a look at this comparison table for an idea on features and differences between most famous statistics tools (AWStats, Analog, Webalizer,...).
AWStats is a free software distributed under the GNU General Public License. You can have a look at this license chart to know what you can/can't do.
As AWStats works from the command line but also as a CGI, it can work with all web hosting providers which allow Perl, CGI and log access.


Example :
1. Demo for web server log files
2. Static demo for ftp log files
3. Static demo for mail log files


Features

A full log analysis enables AWStats to show you the following information:
* Number of visits, and number of unique visitors,
* Visits duration and last visits,
* Authenticated users, and last authenticated visits,
* Days of week and rush hours (pages, hits, KB for each hour and day of week),
* Domains/countries of hosts visitors (pages, hits, KB, 269 domains/countries detected, GeoIp detection),
* Hosts list, last visits and unresolved IP addresses list,
* Most viewed, entry and exit pages,
* Files type,
* Web compression statistics (for mod_gzip or mod_deflate),
* OS used (pages, hits, KB for each OS, 35 OS detected),
* Browsers used (pages, hits, KB for each browser, each version (Web, Wap, Media browsers: 97 browsers, more than 450 if using browsers_phone.pm library file),
* Visits of robots (319 robots detected),
* Worms attacks (5 worm's families),
* Search engines, keyphrases and keywords used to find your site (The 115 most famous search engines are detected like yahoo, google, altavista, etc...),
* HTTP errors (Page Not Found with last referrer, ...),
* Other personalized reports based on url, url parameters, referer field for miscellanous/marketing purpose,
* Number of times your site is "added to favourites bookmarks".
* Screen size (need to add some HTML tags in index page).
* Ratio of Browsers with support of: Java, Flash, RealG2 reader, Quicktime reader, WMA reader, PDF reader (need to add some HTML tags in index page).
* Cluster report for load balanced servers ratio.

AWStats also supports the following features:
* Can analyze a lot of log formats: Apache NCSA combined log files (XLF/ELF) or common (CLF), IIS log files (W3C), WebStar native log files and other web, proxy, wap or streaming servers log files (but also ftp or mail log files). See AWStats F.A.Q. for examples.
* Works from command line and from a browser as a CGI (with dynamic filters capabilities for some charts),
* Update of statistics can be made from a web browser and not only from your scheduler,
* Unlimited log file size, support split log files (load balancing system),
* Support 'not correctly sorted' log files even for entry and exit pages,
* Reverse DNS lookup before or during analysis, support DNS cache files,
* Plugin for country detection from IP location (use geoip country database or client domain name),
* Plugin for city detection from IP location (use geoip city database),
* Plugins for US/Canadian Region , ISP and/or Organizations reports (require non free third product geoipregion, geoipisp and/or geoiporg database)
* WhoIS links,
* A lot of options/filters and plugins can be used,
* Multi-named web sites supported (virtual servers, great for web-hosting providers),
* Cross Site Scripting Attacks protection,
* Several languages. See AWStats F.A.Q. for full list.
* No need of rare perl libraries. All basic perl interpreters can make AWStats working,
* Dynamic reports as CGI output.
* Static reports in one or framed HTML/XHTML pages, experimental PDF export,
* Look and colors can match your site design, can use CSS,
* Help and tooltips on HTML reported pages,
* Easy to use (Just one configuration file to edit),
* Analysis database can be stored in XML format for XSLT processing,
* A Webmin module,
* Absolutely free (even for web hosting providers), with sources (GNU General Public License),
* Available on all platforms,
* AWStats has a XML Portable Application Description.

Requirements:
To use AWStats, you need the following requirements:
* Your server must log web access in a log file you can read.
* You must be able to run perl scripts (.pl files) from command line and/or as CGI (Perl 5.007003 or higher required to run AWStats 6.9 or higher).
If not, you can solve this by downloading last Perl version at ActivePerl (Win32) or Perl.com (Unix/Linux/Other).
See AWStats F.A.Q. to have examples of supported OS and Web servers.

Download : Here!

Thanks : awstats.sourceforge.net

What is Jetty ?

What is Jetty ?

Programming Language:
Java

Description:
Jetty is a 100% Java HTTP Server and Servlet Container. This means that you do not need to configure and run a seperate web server (like Apache) in order to use java, servlets and JSPs to generate dynamic content. Jetty is a fully featured web server for static and dynamic content. Unlike separate server/container solutions, this means that your web server and web application run in the same process, without interconnection overheads and complications. Furthermore, as a pure java component, Jetty can be simply included in your application for demonstration, distribution or deployment. Jetty is available on all Java supported platforms.

Author: Greg Wilkins and the Jetty Dev. Team

What do you think are its best features?

It's focused design and evolution. Jetty has always been and will always be an HTTP component that can be reused in an application. It does not try to be an application server itself (although JettyPlus is a distro bundle with application server tendencies).

I like to say "put Jetty in your application rather than put your application in Jetty". Of course some of the "applications" Jetty has been put into have been application servers such as JBoss, JOnAS and Geronimo.

The design of Jetty is very easy to comprehend and we get lots of good feedback about the quality of the code.

Jetty is not currently the fastest servlet server, but it does have a small footprint and very good (and improving) performance.


Homepage: http://jetty.mortbay.org/jetty/index.html


Example : Zimbra server


Thanks : osdir.com

Resolve Problem of Master boot Record with Recovery Console

ซ่อมไฟล์ระบบวินโดวส์


(1.) ซ่อมไฟล์ระบบวินโดวส์ด้วย Recovery Console
Recovery Console เป็นโปรแกรมที่ใช้เข้าไปดึงข้อมูลระบบกรณีที่ Windows เกิดปัญหาให้กลับมาดีอย่างเดิม และยิ่งไปกว่านั้นในกรณีที่ไม่สามารถบู๊ตเข้าวินโดวส ์ได้ โปรแกรมนี้แหละครับที่ช่วยแก้ไขให้เราอีกต่อหนึ่งด้วย
Recovery Console ที่แถมมากับวินโดวส์ ซึ่งจะมีการเรียกใช้งานในลักษณะที่เป็น Text Mode หรือแบบตัวอักษร(ใครเคยเล่น DOS คงพอจะนึกภาพออก) โดยเราจะต้องเป็นผู้พิมพ์ทุกคำสั่งเอง ซึ่งค่อนข้างยากเลยที่เดียว อืม.. หากยากแบบนี้แล้วจะใช้ไปทำไมล่ะ เหตุผลหลักที่ต้องใช้Recovery Console ก็คือ ความสามารถของตัวโปรแกรมที่มากกว่าโปรแกรมทั่วไปนั่น เองครับ ส่วนการติดตั้งและเรียกใช้งานโปรแกรม Recovery Console นั้นทำได้ดังนี้ครับ

1. ใส่แผ่น CD ติดตั้งโปรแกรม WINDOWS XP ลงไป

2. คลิกปุ่ม Start>Run

3.คลิกเลือกไดรว์ CD-ROM แล้วเข้าไปในโฟล์เดอร์
ไดรว์ของ CD-ROM:\i386\winnt32.exe /cmdcoms คลิกปุ่มOK

4. คลิกปุ่ม OK

5. คลิกเลือก Skip this step and continue installing Windows

6. คลิกปุ่ม NExt เพื่อเริ่มติดตั้ง Recovery Console

7. คลิกปุ่ม OK ก็อันเป็นติดตั้งโปรแกรม Recovery Console เสร็จเรียบร้อย

(1.1) เรียกใช้งาน Recovery Console
คราวนี้เรามาลองเรียกใช้ Recovery Console กันบ้างซึ่งวิธีการนั้นสามารถทำได้ง่ายๆดัังนี้

1. หลังจากบู๊ตวินโดวส์ให้เลือกบู๊ตจาก Microsoft Windows Recovery Console เพื่อเข้าสู่ Recovery Console

2. เสร็จแล้วเลือกไดเร็คทอรี่ที่ต้องการ ตัวอย่างผมเลือก 1 แล้วกดปุ่ม Enter

3. ใส่รหัสผ่านขอ Administator แล้วกดปุ่ม Enter เท่านี้ก็สามารถเข้าสู่ระบบได้แล้ว

(1.2) เรียกใช้ตัวช่วยใน Recovery Console
สำหรับ มือใหม่ที่เพิ่งจะหัดโปรแกรม Recovery Console ผมแนะนำว่าควรจะศึกษาเกี่ยวกับคำสั่งต่างๆกันก่อน โดยสามารถดูได้จากการพิมพ์คำสั่ง HELP ลงไป

(1.3) ตรวจเช็คและกู้ไฟล์ของ Windows ให้ดีขึ้น
เมื่อ เครื่องคอมฯ ของเราเกิดบู๊ตเข้า windows ไม่ได้ คำสั่งแรกที่ควรจะรู้จักคือคำสั่ง chkdsk ซึ่งคำสั่งนี้จะเป็นการตรวจเช็คและกู้ไฟล์ Windows ที่เสียหายให้กลับมาดี ด้วยขั้นตอนง่ายๆดังนี้

1. ให้พิมพ์คำสั่ง chkdsk /p แล้วกดปุ่ม Enter เพื่อตรวจแล้วกู้ไฟล์เสีย
2. เท่านี้ก็สามารถซ่อมแซมไฟล์วินโดวส์ได้แล้ว
3. เสร็จแล้วพิมพ์คำสั่ง exit แล้วกดปุ่ม enter

(1.4) กู้ไฟล์ที่ทำใหบู๊ตไม่ขึ้นเนื่องจาก Master boot Record เสีย
Master Boot Record เจอคำนี้เข้ามื่อใหม่คงงงแน่ ไม่ต้องตกใจไป ถ้าจะพูดให้เข้าใจกันง่ายๆคือ ไฟล์ที่ใช้เก็ยตำแหน่งระบบการบู๊ต Windows นั่นแหละครับ ซึ่งส่วนนี้สำคัญมากหากเสียแล้วต้องใช้คำสั่งนี้เท่านั้นทีี่จะแก้ไขได้ นั่นคือ fixmbr ส่วนขั้นตอนมีดังนี้ครับ

1. พิมพ์คำสั่ง fixmbr แล้วกดปุ้ม Enter เพื่อซ่อม MBR(Master Boot Record)
2. พิมพ์ y แล้วกดปุ่ม enter เพื่อเริ่มซ่อม MBR
3. เสร็จแล้วพิมพ์คำสั่ง exit เท่านี้ก็กู้วินโดวส์ที่บู๊ตไม่ขึ้นได้แล้วละครับ


Thanks : comInw

วันอังคารที่ 13 ตุลาคม พ.ศ. 2552

Force iptables to log messages to a different log file

By default, Iptables log message to a /var/log/messages file. However you can change this location. I will show you how to create a new logfile called /var/log/iptables.log. Changing or using a new file allows you to create better statistics and/or allows you to analyze the attacks.

Procedure to log the iptables messages to a different log file

Open your /etc/syslog.conf file:
# vi /etc/syslog.conf
Append following line
kern.warning /var/log/iptables.log

Save and close the file.

Restart the syslogd (Debian / Ubuntu Linux):

# /etc/init.d/sysklogd restart

On the other hand, use following command to restart syslogd under Red Hat/Cent OS/Fedora Core Linux:

# /etc/init.d/syslog restart

Now make sure you pass the log-level 4 option with log-prefix to iptables. For example:
# DROP everything and Log it
iptables -A INPUT -j LOG --log-level 4
iptables -A INPUT -j DROP

For example, drop and log all connections from IP address 1.1.1.1 to your /var/log/iptables.log file:
iptables -A INPUT -s 1.1.1.1 -m limit --limit 5/m --limit-burst 7 -j LOG --log-prefix '** HACKERS **'--log-level 4
iptables -A INPUT -s 1.1.1.1 -j DROP

Where,

  • --log-level 4: Level of logging. The level # 4 is for warning.
  • --log-prefix '*** TEXT ***': Prefix log messages with the specified prefix (TEXT); up to 29 letters long, and useful for distinguishing messages in the logs.

You can now see all iptables message logged to /var/log/iptables.log file:
# tail -f /var/log/iptables.log


Thanks : MG's Note

How To Use iptables for Linux Firewalls

How To Use iptables

You can start, stop, and restart iptables after booting by using the commands:
# service iptables start
# service iptables stop
# service iptables restart


To get iptables configured to start at boot, use the chkconfig command:.
# chkconfig iptables on

You can determine whether iptables is running or not via the service iptables status command. Fedora Core will give a simple status message. For example
# service iptables status

iptables Won't Start
# touch /etc/sysconfig/iptables
# chmod 600 /etc/sysconfig/iptables
# service iptables start

Example : Allowing WWW And SSH Access To Your Firewall
#---------------------------------------------------------------
# Allow previously established connections
# - Interface eth0 is the internet interface
#---------------------------------------------------------------

iptables -A OUTPUT -o eth0 -m state --state ESTABLISHED,RELATED \
-j ACCEPT

#---------------------------------------------------------------
# Allow port 80 (www) and 22 (SSH) connections to the firewall
#---------------------------------------------------------------

iptables -A INPUT -p tcp -i eth0 --dport 22 --sport 1024:65535 \
-m state --state NEW -j ACCEPT
iptables -A INPUT -p tcp -i eth0 --dport 80 --sport 1024:65535 \
-m state --state NEW -j ACCEPT

And More at linuxhomenetworking.com