Archive for September, 2010

AWstat

September 27, 2010

I”m attempting to install a fresh version of awstats

1) Downloaded version 6.95 from the site.

2) Unzip anywhere you want – awstats

Directory structure is

docs/

tools/

wwwroot/

  • cgi-bin/
  • classes/
  • css/
  • icon/
  • js/

3) File permissions appear to be correct

-rwxr-xr-x 1 root staff 7126 2010-06-06 17:10 awredir.pl

-rw-r–r– 1 root staff 60959 2010-06-06 17:10 awstats.model.conf

-rwxr-xr-x 1 root staff 624764 2010-06-06 17:10 awstats.pl

drwxr-sr-x 5 root staff 4096 2010-06-06 17:10 lang

drwxr-sr-x 2 root staff 4096 2010-06-06 17:10 lib

drwxr-sr-x 3 root staff 4096 2010-06-06 17:10 plugins

4) I have a site config file in /etc/awstats/awstats.www.domain.com.conf

5) My important settings in it are:

LogFile=”apache/logs/access_log”

LogFormat = 4

DirData=”awstats/data/”

DirCgi=”awstats/wwwroot/cgi-bin”

DirIcons=”awstats/wwwroot/icon”

AllowToUpdateStatsFromBrowser=0

CreateDirDataIfNotExists=1

6) Add the following with httpd.conf file ( or simply run awstats_configure.pl ) and restarted apache –

# Directives to allow use of AWStats as a CGI
#
Alias /awstatsclasses “awstats/wwwroot/classes/”
Alias /awstatscss “awstats/wwwroot/css/”
Alias /awstatsicons “awstats/wwwroot/icon/”
ScriptAlias /awstats/ “awstats/wwwroot/cgi-bin/”

[ Here I just use dummy path, replace your awstats location correctly ]
#
# This is to permit URL access to scripts/files in AWStats directory.
#
<Directory “awstats/wwwroot”>
Options None
AllowOverride None
Order allow,deny
Allow from all
AuthName “Apache AWstat Access”
AuthType Basic
AuthUserFile awstats/awstats.users
Require valid-user
</Directory>

7) Then successfully run awstats/wwwroot/cgi-bin/awstats.pl -update -config=www.domain.com

8) Run awstats/tools/awstats_buildstaticpages.pl -config=www.domain.com -update -awstatsprog=awstats/wwwroot/cgi-bin/awstats.pl -dir=awstats/data(Optional)

9) Now hit http://www.domain.com/awstats/awstats.pl?config=www.domain.com

Advertisements

Rebuilding solaris corrupted boot archive

September 27, 2010

The problem was due to the corrupted boot-archive as a result of hard reboot or power failure. which I rebuilt through failsafe mode. Here is what I did

1. Boot into failsafe through console.
2. Let system to probe / and mount it to /a
3. cd  /a/platform/i86pc
4. mv  boot_archive boot_archive.crash
5. cd
6. bootadm update-archive -f -R  /a               ; this takes few minutes and recreates the boot_archive

7. reboot

These are the actual steps that helped to bring back the box.

Allowing traffic on a paricular host for a differnet network.

September 10, 2010

Consider you have two networks – 192.168.1.0/24 and 192.168.2.0/24. Both reside behind firewall ( a gateway machine actually ).Now you want to allow everyone of 192.168.2.0/24 to listen on only 192.168.1.100. The steps are –

Basically you have to apply both way traffic with iptables on the gateway machine of 192.168.1.0/24 network.

iptables -R FORWARD 1 -i eth0 -s 192.168.2.2  -d 192.168.1.100 -j ACCEPT

iptables -R FORWARD 2 -i eth1 -s 192.168.1.100 -d 192.168.2.2 -j ACCEPT

Here,

192.168.2.2 is the ip of gateway machine of 192.168 2.0/24 network.
Please make sure the correct interface ( ethN ) for in and out traffic of every host.

You can use the tcpdump command to verify the traffic flow working or not or where packets reject.

tcpdump -ni eth1 icmp