Jul 18, 2007

Directory Server

What is a Directory Server?

A directory server provides a centralized directory service for your intranet, network, and extranet information. Directory Server integrates with existing systems and acts as a centralized repository for the consolidation of employee, customer, supplier, and partner information. You can extend Directory Server to manage user profiles and preferences, as well as extranet user authentication.

How is a Directory Server different from a Relational Database?

An LDAP directory server stores information in a tree-like heirarchical structure.

The characteristics of an LDAP server are:

  • very fast read operations

  • fairly static data

  • hierarchical

  • clients use standard LDAP protocol

  • loosely coupled replication

The characteristics of an RDMBS are:

  • very fast write operations (think TPS)

  • dynamic data

  • tables with rows and columns, with key relations between tables

  • no standard on the wire protocol - vendors must provide ODBC or JDBC drivers

  • tightly coupled replication - Two Phase Commit

What is LDAP?

LDAP provides a common language that client applications and servers use to communicate with one another.

What is Fedora Directory Server?

A secure, highly scalable, robust LDAP server.

Install Fedora-ds

$ wget http://directory.fedoraproject.org/download/fedora-ds-1.0.4-1.FC6.i386.opt.rpm

$ rpm -ihv *.rpm

$ cd /opt/fedora-fs

$ ./setup/setup

Installation guide in

(http://directory.fedoraproject.org/wiki/Install_Guide)

Run

$ ./startconsole -u admin -a http://domain.com:28365/

Jul 17, 2007

netstat command

netstat -anp | grep 60000
Answer for question: Have any program run on port 60000

Jul 8, 2007

VirtualHost in Apache Sample

Create two virtual host anh.biz.tm and mangmaytinh.biz.tm
Append to the end of file /etc/httpd/conf/httpd.conf

NameVirtualHost *:80
<
VirtualHost *:80>
ServerAdmin onlyyoumakemesmile@gmail.com
DocumentRoot /var/www/html/anh.biz.tm/simpleviewer
ServerName anh.biz.tm
ErrorLog logs/anh.biz.tm-error_log
CustomLog logs/anh.biz.tm-access_log common
</
VirtualHost>

<VirtualHost *:80>
ServerAdmin onlyyoumakemesmile@gmail.com
DocumentRoot /var/www/html/mangmaytinh.biz.tm/wordpress
ServerName mangmaytinh.biz.tm
ErrorLog logs/mangmaytinh.biz.tm-error_log
CustomLog logs/mangmaytinh.biz.tm-access_log common
</VirtualHost >


Test syntax using
$ httpd -S

Install VNCserver in Fedora Core 7

- Installation
$ yum -y install vnc*
- Starting with no configuration file
$ vncserver :1
Only xterm interface
$ vncserver -kill :1
to kill display 1
- Configuration
$ vi ~/.vnc/xstartup
Comment
twm &
And append
init 5
startkde &

Note: init 5 is necessary only when your server start with runlevel other than 5

Install and config MySQL

Installation
yum install mysql
yum install mysql-server
yum install mysql-administrator
Configuration
chkconfig --levels 235 mysqld on
Starting
/etc/init.d/mysqld start
Changing the root password
mysqladmin -u root password your_root_sql_password
Backup
One database
mysqldump --single-transaction nhungnguoibantot_db > backup_nhungnguoibantot_db.sql -p
All databases
mysqldump --single-transaction --all-databases > backup_all_databases.sql -p
Restore
One databases
mysql > create database nhungnguoibantot_db;
mysql -u root -p < backup_nhungnguoibantot_db.sql
All databases
mysql -u root -p <
backup_all_databases.sql
Show all databases
mysql>show databases;
Connect to database
connect database_name;
Show all tables of a database
mysql>show tables;
Create a new user to manage database
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP
ON database_name
TO 'username'@'localhost'
IDENTIFIED BY 'password';

Configure PostgreSQL

To connect from other host than locahost
- In file postgresql.conf (/var/lib/pgsql/data/postgresql.conf)
Change or add
listen_addresses = "*"
- In file pg_hba.conf
Allow connect from localhost
host all all 192.168.1.0/24 trust
Allow connect from internet
host all all 0.0.0.0/0 trust

note
0.0.0.0/a mean that IP in a range of 0.0.0.0 with a bits is fixed

Installing inadyn as afraid.org Dynamic DNS client

Install by yum
# yum -y install inadyn.i386
Configure
# vi /etc/inadyn.conf

dyndns_system default@freedns.afraid.org
username userpublic
password passpublic
alias mangmaytinh.biz.tm,Um9ALVNVTVRTTUlBQUNzb21ZMDoyMTcwNTE0
update_period 60000
log_file /var/log/inadyn.log
background

with "Um9ALVNVTVRTTUlBQUNzb21ZMDoyMTcwNTE0" is hash(Direct URL http://freedns.afraid.org/dynamic/update.php?Um9ALVNVTVRTTUlBQUNzb21ZMDoyMTcwNTE0) that you can get it from http://freedns.afraid.org/dynamic/ after you regist a subdomain
Configure start up daemon
# chkconfig --level 345 inadyn on
Start service
# service inadyn start
Check daemon run
# vi /var/log/inadyn.log
Debug
# inadyn --dyndns_system default@freedns.afraid.org -a mangmaytinh.biz.tm,Um9ALVNVTVRTTUlBQUNzb21ZMDoyMTcwNTE0 -u userpublic -p passpublic --verbose 5
add --verbose 5 to see detail error

Jul 7, 2007

Find computer in LAN

Find computer in LAN
Using the PCFinder

Switching from GDM to KDM

Check for GDM and KDE available
# kde-menu --version
# gdm --version
Run KDE
# startkde --replace
Run GDM
# gdm start
in /etc/sysconfig/desktop append
DISPLAYMANAGER="KDE"

Jul 4, 2007

rpm

Check what postgres packages are installed:
rpm -qa | grep -i postgres
Uninstall postgres:
rpm -e --nodeps `rpm -qa| grep -i postgres`