Google Search

Google

What is the most suitable distro to use as a server?

Visit Us!

Google Groups
Kuantan Linux User Group
Visit this group

Threat Resource Center | Trend Micro

Wednesday, May 13, 2009

How to create a website statistic using AWSTATS

This post is based on my experience on setup and configuring the Awstats. configuration. I'm installing it on my Ubuntu server 8.10.


Step 1

Access to AWSTATS server by using SSH protocol.

IP address: 192.168.19.50

loginname: awstats

password: ********

awstats@ubuntu:~$ type cd /var/www/awstats/tools/


Step 2

awstats@ubuntu:/var/www/awstats/tools$ type ls

awstats_buildstaticpages.pl awstats_updateall.pl maillogconvert.pl xslt

awstats_configure.pl httpd_conf urlaliasbuilder.pl

awstats_exportlib.pl logresolvemerge.pl webmin


Step 3

awstats@ubuntu:/var/www/awstats/tools$ sudo ./awstats_configure.pl

[sudo] password for awstats:

----- 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/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] ? press 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):

> type /etc/apache2/apache2.conf

-----> Check and complete web server config file '/etc/apache2/apache2.conf'

All AWStats directives are already present.

-----> 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] ? press 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:

> type the name of website or profile eg; lbjt,insken,bankrakyat etc..

-----> 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):

> Just press Enter here

-----> Create config file '/etc/awstats/awstats.lbjt.conf'

Config file /etc/awstats/awstats.lbjt.conf created.

-----> 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=lbjt

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... Just press Enter here

A SIMPLE config file has been created: /etc/awstats/awstats.lbjt.conf

You should have a look inside to check and change manually main parameters.

You can then manually update your statistics for 'lbjt' with command:

> perl awstats.pl -update -config=lbjt

You can also read your statistics for 'lbjt' with URL:

> http://localhost/awstats/awstats.pl?config=lbjt

Press ENTER to finish... Just press Enter here


Step 4

awstats@ubuntu:/var/www/awstats/tools$ type sudo pico /etc/awstats/awstats.lbjt.conf

** To find the value that need to be edited as represent by the red colour below, simply press the “Page Down” button on the keyboard **

# If there are several log files from load balancing servers :

# Example: "/pathtotools/logresolvemerge.pl *.log |"

#

LogFile="/var/log/apache2/lbjt.skali.my-access_log" change to this from default “/var/log/httpd/mylog.log”

# LogFormat = 1

# LogFormat = "%host %other %logname %time1 %methodurl %code %bytesd %refererqu$

#

# Example for IIS:

# LogFormat = 2

#

LogFormat=4 change to this value from default “ 1 ”

# If analyzing mail log, enter here the domain name of mail server.

# Example: "myintranetserver"

# Example: "www.domain.com"

# Example: "ftp.domain.com"

# Example: "domain.com"

#

SiteDomain="lbjt" make sure this is value is entered

# Example: "/var/lib/awstats"

# Example: "../data"

# Example: "C:/awstats_data_dir"

# Default: "." (means same directory as awstats.pl)

#

DirData="/var/www/awstats" change to this from the default “/var/lib/awstats”


Step 4

awstats@ubuntu:/var/www/awstats/tools$ type sudo /var/www/awstats/wwwroot/cgi-bin/awstats.pl config=lbjt -update

Create/Update database for config "/etc/awstats/awstats.lbjt.conf" by AWStats version 6.9 (build 1.925)

From data in log file "/var/log/apache2/lbjt.skali.my-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: 1788

Found 0 dropped records,

Found 0 corrupted records,

Found 0 old records,

Found 1788 new qualified records.

awstats@ubuntu:/var/www/awstats/tools$

Step 5

Open browser using Internet Explorer or Mozilla FireFox. At the URL address type the below address;

http://192.168.19.50/awstats/awstats.pl?config=lbjt and the web page as below will be displayed and your awstats configuration is successful. Replace the lbjt name with other website profile. Let say if you are creating a profile for Bank Rakyat, then type, bankrakyat after config= (eg; config=bankrakyat) and so on for other profile.

Wednesday, April 15, 2009

PFSense: Basic Installation Tutorial for Dummies Like Me :-)

Taken from PFSense website :-)

Welcome to the home page of the pfSense project!

pfSense is a free, open source customized distribution of FreeBSD tailored for use as a firewall and router. In addition to being a powerful, flexible firewalling and routing platform, it includes a long list of related features and a package system allowing further expandability without adding bloat and potential security vulnerabilities to the base distribution. pfSense is a popular project with more than 1 million downloads since its inception, and proven in countless installations ranging from small home networks protecting a PC and an Xbox to large corporations, universities and other organizations protecting thousands of network devices.

This project started in 2004 as a fork of the m0n0wall project, but focused towards full PC installations rather than the embedded hardware focus of m0n0wall. pfSense also offers an embedded image for Compact Flash based installations, however it is not our primary focus.

Click here for details


This simple tutorial is based on my experience. This software is awesome with a lot of features in it. The main reason I'm installing this software is for creating a Squid proxy server. Since this software have a lot of add-on so why not I'm trying to install it. Actually, I had installed this PFSense in my SUN VirtualBox. On the moment I'm posting this post, I'm using the latest PFSense version 1.2.2. To download the software click here


Configure Console > Choose "Change Video Font (Default)"


Select Task > Choose "Install pfSense"


Select Disk > Select your desired disk, default is "ad0"


Select Geometry > I didn't change anything here, just proceed with the default, "choose Use this Geometry"


ABOUT TO FORMAT! Proceed? > Verified it first and then "choose Format ad0"


Partition Disk? > Read this first and choose Partition Disk if you satisfied :)


Edit Partitions > I'm using this default and choose Accept and Create


Partitions Anyway? > "Choose Yes, partition ad0"


Information > The disk was successfully partitioned, ahaaaa OK


Select Partition > Select the primary partition, I choose 1:blablabla ;)


Are you SURE? Choose OK if you dare to format your disk


Information > Primary partition #1 was formatted.


Select Subpartitions > I'm just selecting the default as below. Choose Accept and Create


Executing Commands


Install Kernel > Choose Uniprocessor kernel (one processor) if your system has only one processor. But, if you installed it on server maybe you should choose Symmetric multi processing blablabla


Cancelled? What the heck? I dont know why this happen but I Retry it and it works!!! Yeaa!


Install Bootblocks > I don't want headache so, I just keep the default and choose Accept and Install Bootblocks


Information > Bootblocks were successfully installed


Reboot > Choose Reboot


Reboot, bip! bip! will hear the bip bip sound


Open up the web browser FireFox or IE. Enter the default PFSense IP Address, 192.168.1.1, Username: admin and Password: pfsense to get to the page as below


General Information


Time Server Information


Time Server Information, choose Timezone


Configure WAN interface, I'm using DHCP at first.


Contd..


Configure LAN Interface


Set Admin WebGUI Password


Reload, click Reload button


A reload is now in progress. Please wait but if unpatient click on PFSense icon :-P


System Overview page

Thursday, August 21, 2008

Installing Firewall on Ubuntu using Lokkit

I have searching on the Internet how to setup a my Ubuntu (8.04) machine as a firewall and I finally found a step that I need to do. Lokkit, yeah this is the firewall that I think suitable. What I need to do is to download it first to my Ubuntu machine, install and configure it as I need.

rootubuntu@myubuntu-vbox:~$ sudo apt-get install lokkit <---- type this command
[sudo] password for rootubuntu: type the root password, after that the below details will be displayed during the installation. (see below)
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
ipmasq
Recommended packages:
gnome-lokkit
The following NEW packages will be installed:
lokkit
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 128kB of archives.
After this operation, 811kB of additional disk space will be used.
Get:1 http://my.archive.ubuntu.com hardy/universe lokkit 0.50.22-7.1ubuntu2 [128kB]
Fetched 128kB in 6s (20.6kB/s)
Selecting previously deselected package lokkit.
(Reading database ... 138076 files and directories currently installed.)
Unpacking lokkit (from .../lokkit_0.50.22-7.1ubuntu2_i386.deb) ...
Setting up lokkit (0.50.22-7.1ubuntu2) ...
You must use lokkit or gnome-lokkit to configure the firewall. -end of installation-

After installation of Lokkit is finished enter below command to run Lokkit
rootubuntu@myubuntu-vbox:~$ lokkit <---- type this command

ERROR - You must be root to run lokkit. why I got this message? because I'm not run it as a root. use sudo

rootubuntu@myubuntu-vbox:~$ whoami
rootubuntu
rootubuntu@myubuntu-vbox:~$ sudo lokkit
[sudo] password for rootubuntu: type the root password, then the Lokkit window will be pop-up as below.


Tuesday, July 8, 2008

Managing Veritas Cluster Server using command line

Instead of using GUI (graphical user interface) to managing the VCS, user can also use command line too. As I am new to VCS, there is a few command that I know to monitor the status of VCS and switching the server services to another server.


To run the VCS
[root@MY-BEDB01]#hagui


To check the status of VCS
[root@MY-BEDB01]#hastatus -sum


To check GAB (Global Atomic Broadcast) status
[root@MY-BEDB01]# gabconfig -a
GAB Port Memberships
===============================================================
Port a gen 625e07 membership 012
Port d gen 625e08 membership 01
Port d gen 625e08 visible ; 2
Port h gen 625e0a membership 012


To check LLT (Low Latency Transport) connection
[root@MY-BEDB01]# lltstat -vvn

Managing Veritas Cluster Server in Unix

I was be given a task and responsibility to handling a Veritas Cluster Server (VCS) at my site office. Honestly, I didn't know what is VCS. I have heard it name before and I really don't care what it is. After this time come, I'm doing a reseacrh to know what is VCS. It is about High-Availability clustering and (also known as HA). From my simple understand, VCS providing the availability of application to run without any problem as it is mirroring or duplicating what server A has to server B and this help a lot to reduce and avoid downtime. If I'm wrong, please guide me. :-) This is what i have done to managing the VCS.


1) Login to my Solaris 9 server using X-Manager Software



2) To run the VCS, type #hagui



3) Veritas Cluster Server windows will be displayed



4) Enter the username and password for VCS.



5) VCS is in progress to be shown



6) Successfully login into the VCS interface.



7) Displaying the AppService that is listed in Application Server



8) Displaying the OracleService that is listed in Application Server



9) Switching the AppService from Application server to Fail Over server. To do this, right click on the AppService > click Switch To menu > click on the desired Fail Over server.



10) User will be prompted to proceed switch the AppServer to the Fail Over server.



11) After AppServer is switching to the Fail Over server, VCS will show that the Application Server state is Partial Online. It is normal when the switching process is in progress.


12) To check the status of the switching process by using a command line, type #hastatus -sum in the console and the below result will be displayed. It will show that AppService at befo01 (stands for Fail Over server) is in STARTING|PARTIAL state. It means that the AppService is in process to start running in Fail Over server.



13) Finally, the AppService is running at the Fail Over server. See at the Group Status On Member System. befo01 is in Online state. Now, AppService is running at the Fail Over server.

14) To check the status of the switching process by using a command line, type #hastatus -sum in the console and the below result will be displayed.

Linux News Of The Day!

Powered By
widgetmate.com
Sponsored By
Credit Card Forum