Monday, August 24, 2009

dim_STAT installation on Solaris 10

DOWNLOAD LINK: http://dimitrik.free.fr

As the root user,
bash-3.00# tar xvf dim_STAT.tar

bash-3.00# cd dim_STAT-INSTALL/
bash-3.00# ls
ExpReport_15.tar.Z LICENSE-GPLv2.txt LICENSE.txt README.sol86 UNINSTALL.txt anySTAT soft
INSTALL.sh LICENSE-freeware.txt README STAT-service UserGuide conf x.install
bash-3.00# ./INSTALL.sh


===========================================
** Starting dim_STAT Server INSTALLATION **
===========================================

HOSTNAME: solten
IP: ::1
DOMAINE:

Is it correct? (y/n): n
** Hostname [solten]: solten
** IP addres [::1]: 192.168.2.222
** Domainname []: admincmd.blogspot.com
**
** ATTENTION!
**
** On your host You have to assign a USER/GROUP pair as owner
** of all dim_STAT modules (default: dim/dim)

User: dim
Group: dim
Is it correct? (y/n): y


**
** WARNING!!!
**
** User dim (group dim) is not created on your host...
** You may do it now by yourself or let me do it during
** installation...
**

May I create this USER/GROUP on your host? (y/n): y


======================================
** dim_STAT Directory Configuration **
======================================

** WebX root directory (5MB):
=> /WebX
=> /opt/WebX
=> /etc/WebX

[/opt/WebX]:


** HOME directory for dim_STAT pkgs [/apps]:
** TEMP directory [/tmp]:

** HTTP Server Port [80]: 999 ** DataBase Server Port [3306]: ** Default STAT-service Port [5000]: 1999
================================================== ** Process... ================================================== => Host : solten => IP address : 192.168.2.222 => Domain : admincmd.blogspot.com => User : dim => Group : dim => WebX root directory : /opt/WebX => HOME directory : /apps => TEMP directory : /tmp => HTTP Server Port : 999 => DataBase Server Port : 3306 => Default STAT-service Port : 1999

Is it correct? (y/n): y


** !!
** !! !!! WARNING !!!
** !! ---------------
** !!
** !! ALL DATA will be DELETED!!! in: /apps/* !!!
** !! as well /WebX, /etc/WebX, /opt/WebX !!!
** !!
Delete all data? (y/n): y




** Cleanup /apps
** Add User...
** WebX Setup...
** dim_STAT Server extract...
** HTTP Server Setup...
** Database Server Setup...
** ADMIN/Tools Setup...
** TEMP directory...
** Permissions...
** Crontab Setup...
Sun Microsystems Inc. SunOS 5.10 Generic January 2005


**
** INSTALLATION is finished!!!
**
May I create now a dim_STAT-Server start/stop script in /etc/rc*.d? (y/n): y
============================================================================
NOTE:
=>
=> Please, set a password to the user dim
=> to enable clean up procedure via cron!..
=>


** =========================================================================
**
** You can start dim_STAT-Server now from /apps/ADMIN:
**
** # cd /apps/ADMIN
** # ./dim_STAT-Server start
**
** and access homepage via Web browser - http://solten:999
**
** To collect stats from any Solaris-SPARC/x86 or Linux-x86 machines
** just install & start on them [STAT-service] package...
**
** Enjoy! ;-)
**
** -Dimitri
** =========================================================================


bash-3.00# cd /apps/ADMIN/ bash-3.00# ./dim_STAT-Server start
================[ dim_STAT-Server: start ]================

*
* MySQL Database Server
*
=> Log output : /apps/mysql/data/mysqld.log.3306
=> Local socket: /apps/mysql/data/mysql.sock.3306
=> Admin Access: root# /apps/mysql/bin/mysql -S /apps/mysql/data/mysql.sock.3306

Starting...
Starting mysqld daemon with databases from /apps/mysql/data
Done.
Starting HTTP server from: /apps/httpd
Done.
================[ dim_STAT-Server: start -- done. ]================



TEST
Config First level security
1) via /apps/httpd/bin/htaccess create /apps/httpd/etc/.htpasswd file and add any pairs of user/password you need
2) create ".htaccess" file with context:

AuthName "Welcome to dim_STAT Host"
AuthType Basic
AuthUserFile /apps/httpd/etc/.htpasswd

require valid-user

3) copy ".htaccess" file into /apps/httpd/home/docs and /apps/httpd/home/cgi-bin
4) try to connect to your web server now and check the access user/password - that's all!

For example:
1) add user/password
bash-3.00# /apps/httpd/bin/htpasswd -c /apps/httpd/etc/.htpasswd dimuser
Adding password for dimuser.
New password:
Re-type new password:

2)create ".htaccess"
bash-3.00# vi .htaccess
Adding....

AuthName "Welcome to dim_STAT Host"
AuthType Basic
AuthUserFile /apps/httpd/etc/.htpasswd

require valid-user

bash-3.00# cat .htaccess

3) copy ".htaccess" to destination
bash-3.00# cp /tmp/.htaccess /apps/httpd/home/cgi-bin
bash-3.00# cp /tmp/.htaccess /apps/httpd/home/docs
bash-3.00# cd /apps/ADMIN
bash-3.00# ./dim_STAT-Server stop
bash-3.00# ./dim_STAT-Server start
4)Login again



Wednesday, August 19, 2009

Change default gateway in Sun Solaris 10

Default Gateway or the Default Router is the IP address (IPv4)

Default Gateway is maintained in the file /etc/defaultrouter
This file should contain an entry for each router directly connected to the network. The entry should be the name for the network interface that functions as a router between networks.

How to add or Edit

- If you wish to add or edit the default gateway ,edit /etc/defaultrouter file and update the IP Address.
- Use the command to manually configure the routes in the routing table.
# route delete default 192.1.1.1 <--remove the dexisting default gateway
# route add default 192.1.1.1 <--Add new default gateway


View the existing Kernel IP Routing table;
# netstat -nr
Routing Table: IPv4
Destination Gateway Flags Ref Use Interface
——————– ——————– —– —– ———- ———
192.168.0.0 192.1.1.1 U 1 115 eth0
default 192.1.1.1 UG 1 25
127.0.0.1 127.0.0.1 UH 5 2 lo0



After changing default router restart network service;
#svcadm restart network/physical


For a detailed Man Page for /etc/defaultrouter click here

Friday, August 7, 2009

Invalid default value for 'logTime'

Process of database restoration using the following SQL query :

CREATE TABLE `smf_log_online` (
SESSION varchar( 32 ) NOT NULL default '',
logTime timestamp default 'CURRENT_TIMESTAMP' ,
ID_MEMBER mediumint( 8 ) unsigned NOT NULL default 0,
ip int( 10 ) unsigned NOT NULL default 0,
url text NOT NULL default '',
PRIMARY KEY ( SESSION ) ,
KEY logTime( logTime ) ,
KEY ID_MEMBER( ID_MEMBER )
) TYPE = MYISAM


There is a massive problem occur, The following message:

" #1067 - Invalid default value for 'logTime' "


For this problem you need to change SQL statement to get it to work following:

remove '' from '
CURRENT_TIMESTAMP' ..

CREATE TABLE `smf_log_online` (
SESSION varchar( 32 ) NOT NULL default '',
logTime timestamp default CURRENT_TIMESTAMP ,
ID_MEMBER mediumint( 8 ) unsigned NOT NULL default 0,
ip int( 10 ) unsigned NOT NULL default 0,
url text NOT NULL default '',
PRIMARY KEY ( SESSION ) ,
KEY logTime( logTime ) ,
KEY ID_MEMBER( ID_MEMBER )
) TYPE = MYISAM