Sunday, December 20, 2009

Set time zone on Ubuntu

Here the CLI :
as root or sudo

dpkg-reconfigure tzdata

Thursday, December 3, 2009

Upgrade / updating CentOS 5.3

here some step upgrade and update for CentOS 5.3 (Work for Me!!)

# yum clean all
# yum update

# yum upgrade

# reboot

or you can upgrade your kernel using

# yum upgrade kernel

than

# reboot


updating package :
example

yum list updates {package-name}
yum list updates 'package-name*'
yum list updates '*package-name*'


or

# yum list updates 'php*'
or
# yum list updates 'kernel*'

you can currently list your installed package by using

# rpm -q kernel

do multiple

# yum list installed 'kernel*' 'php*'

or update your kernel by using

# yum update kernel.i686

than reboot your box

That All!


To check CentOS Version

run this command :

cat /etc/redhat-release

Upgrade FreeBSD 7.2 to 8.0 using csup

I finally did it upgrade my box from 7.2 to 8.0
here some step for you guys

1 - Edit your supfile file

# cp /usr/share/examples/cvsup/standard-supfile /root/supfile.8
# ee /root/supfile.8



find and change this line

*default host=cvsup2.jp.FreeBSD.org

and

*default release=cvs tag=RELENG_8_0

save n close this file

csup your box using this command
# csup /root/supfile.8

to build freebsd file system enter :

# cd /usr/src
# make cleanworld && make cleandir

if you have problem when you make cleanworld && make cleandir please csup using normal csup and than try back csup /root/supfile.8.

# make buildworld

after that build and install your new / custom kernel :

# make buildkernel
# make installkernel


after finish REBOOT your box and at bootloader section please choose 4 (single mode) to finish the upgrade.


after you login as a single user you will get something like this (/sbin/sh). For me i use this :


csh


than mount

# mount -a -t ufs

and after that run mergemaster

# mergemaster -p


WARNING !!!
Be careful with /etc/passwd, /etc/group and other files in base system. Verify each file before installing new version or merging exiting configuration files.

than you need to install FreeBSD Base System

# cd /usr/src
# make installworld

after finish run :

# mergemaster -i

WARNING !!!
Be careful with /etc/passwd, /etc/group and other files in base system. Verify each file before installing new version or merging exiting configuration files.

after finish reboot your system

after finish start you box as usual. Please check your status :

# uname -a
# tail -f /var/log/messages

than upgrade your ports :

# portsnap fetch update
# vi /usr/ports/UPDATING
# portmaster -Da

than your box is up to date!

Thanks to nixcraft for the great article!

Monday, November 23, 2009

Install heartbeat on Ubuntu Mysql Cluster & HA Proxy

I already done (BUT NOT TESTED YET) my heartbeat installing heartbeat on ubuntu.

$ sudo apt-get install haproxy
$ sudo apt-get install heartbeat


HAproxy

The config file for HAProxy is in "/etc/haproxy.cfg"

here my sample of my haproxy.conf

global
log 127.0.0.1 daemon debug
stats socket /tmp/stats
maxconn 4096
pidfile /var/run/haproxy.pid
daemon

defaults
log global
mode tcp
option dontlognull retries 3 option redispatch
maxconn 2000
contimeout 5000
clitimeout 50000
srvtimeout 50000

listen MySQL 172.16.100.240:3306
mode tcp
option httpchk
stats enable
stats uri /haproxy-stats
balance roundrobin

server mysql_master 172.16.100.241:3306
server mysql_slave 172.16.100.242:3306

Heartbeat

/etc/ha.d/ha.cf #main config file
/etc/ha.d/authkeys #authorization keys file

/etc/ha.d/haresource #share resources on nodes

example on my conf :

You must set on both machines

Primary machine Secondary machine
keepalive 2

warntime 10

deadtime 25

initdead 50

udpport 694

auto_failback on

bcast eth0

node niti.joey.net

node niti.aniket.net

debugfile /var/log/ha-debug

logfile /var/log/ha-log

keepalive 2

warntime 10

deadtime 25

initdead 50

udpport 694

auto_failback on

bcast eth1

node niti.joey.net

node niti.aniket.net

debugfile /var/log/ha-debug

logfile /var/log/ha-log


haresources conf

ubuntu-mysqlclusterA 172.168.1.241/24/eth0 # set in machine B

ubuntu-mysqlclusterB 172.168.1.242/24/eth0 # set in machine A

authkeys

Syntax:
auth
[]

example :

auth 1

1 md5 mypassword

Starting Heartbeat’s Services

Once, you are through with the above configurations in both of the machines, use the following to start the Heartbeat daemon.

$ /etc/init.d/heartbeat start

This command has to be run simultaneously on both the machines.

Following commands can also be used as required:

$ /etc/init.d/heartbeat stop

$ /etc/init.d/heartbeat restart


Reference for my project :

Thanks and credits to these blog and people :

http://theitaxis.wordpress.com/2009/11/14/heartbeat-a-step-by-step-configuration-guide-to-high-availability-linux-clusters/

http://raghupathy.wordpress.com/2008/05/01/high-availabilitycluster-with-load-balancing-by-using-heartbeat-and-haproxy/

http://oceanobservatories.org/spaces/display/CIDev/High+availability+Load+Balancer+-+HAProxy+and+heartbeat


Uninstall / Delete / Remove Package on Ubuntu

For example remove package called mplayer, enter:

$ sudo apt-get remove mplayer

Remove package called lighttpd along with all configuration files, enter:

$ sudo apt-get --purge remove lighttpd

To list all installed package, enter:\

dpkg --list
dpkg --list | less
dpkg --list | grep -i 'http'

Sunday, November 22, 2009

Change hostname on CentOS

Change the hostname machine running CentOS.
  • Login with putty.exe / or SSH
  • Goto : cd /etc/sysconfig/
  • Type vi / nano network
  • Press i (for VI) on the keyboard and change the HOSTNAME to your preferred servername
  • Press ESC on the keyboard
  • Save the configuration by :wq! (For VI) or control x and save Y (for nano)
  • Reboot

Thursday, November 19, 2009

Squid Guard

This summary is not available. Please click here to view the post.

Wednesday, November 4, 2009

FreeBSD Check CPU Info

as root run this :

# sysctl -a | egrep -i 'hw.machine|hw.model|hw.ncpu'

Monday, October 19, 2009

Mysql Cluster In Ubuntu

**Thanks to Bieg for this great great article and knowledge.

I spent some time getting MySQL clustering working with Ubuntu after reading a guide on Howto Forge. The guide however went into the details of compiling and installing MySQL from source so I’m creating this to show the steps needed to get it set up on a fresh Ubuntu installation.

For a correct setup you will need 3 machines. The first machine will serve as the management node, and the other two will be storage nodes.

At the time of writing, the current stable version of Ubuntu is 8.04.1 and the MySQL version that is installed is 5.0.51

During the configuration I log onto the machines and use the command

sudo su -

to gain permanent root access and saving myself from having to type sudo in front of every command. Use your own discretion.

Installing MySQL

Using apt this is straight forward. Just type the following command on all three machines to install MySQL server.

apt-get install mysql-server

Once asked to, set the root password to the MySQL database. You’ll need to remember this one. Once MySQL server is installed we’ll proceed to configure the management node.

Configuring the Management Node

Create and edit the file /etc/mysql/ndb_mgmd.cnf. Copy and paste the text bellow changing the ip addresses to match your setup as necessary.

[NDBD DEFAULT]
NoOfReplicas=2
DataMemory=80M # How much memory to allocate for data storage
IndexMemory=18M # How much memory to allocate for index storage
# For DataMemory and IndexMemory, we have used the
# default values. Since the "world" database takes up
# only about 500KB, this should be more than enough for
# this example Cluster setup.
[MYSQLD DEFAULT]
[NDB_MGMD DEFAULT]
[TCP DEFAULT]
# Section for the cluster management node
[NDB_MGMD]
# IP address of the management node (this system)
HostName=192.168.1.5

# Section for the storage nodes
[NDBD]
# IP address of the first storage node
HostName=192.168.1.6
DataDir=/var/lib/mysql-cluster
BackupDataDir=/var/lib/mysql-cluster/backup
DataMemory=512M
[NDBD]
# IP address of the second storage node
HostName=192.168.1.7
DataDir=/var/lib/mysql-cluster
BackupDataDir=/var/lib/mysql-cluster/backup
DataMemory=512M

# one [MYSQLD] per storage node
[MYSQLD]
[MYSQLD]

Configuring the Storage Nodes

As you can see in the file we created in the previous step, the cluster will be using /var/lib/mysql-cluster on the storage machines. This path is created when you install MySQL server but they are owned by root. We want to create the backup directory and change ownership to mysql.

mkdir /var/lib/mysql-cluster/backup
chown -R mysql:mysql /var/lib/mysql-cluster

Now we’ll need to edit the MySQL configuration so that the storage nodes will communicate with the Management Node.

Edit /etc/mysql/my.cnf

Search for [mysqld] and add the following.

[mysqld]
ndbcluster
# IP address of the cluster management node
ndb-connectstring=192.168.1.5

Then scroll down to the bottom until you see [MYSQL_CLUSTER]. Uncomment the line and edit so it looks like

[MYSQL_CLUSTER]
ndb-connectstring=192.168.1.5

* edit bind-address = IPaddress server

The reason the connect string it found twice in the mysql file is because one is used by mysql server, and the other is used by the ndb data node app. Save the changes to the file.

Make sure you complete the changes on both data nodes.

Start the Management Node

Start the Management Node using

/etc/init.d/mysql-ndb-mgm restart

The process shouldn’t be running but using restart doesnt hurt. Once it is started we can access the management console using the command ndb_mgm. At the prompt type show; and you will see

ndb_mgm> show;
Connected to Management Server at: localhost:1186
Cluster Configuration
---------------------
[ndbd(NDB)] 2 node(s)
id=2 (not connected, accepting connect from 192.168.1.6)
id=3 (not connected, accepting connect from 192.168.1.7)

[ndb_mgmd(MGM)] 1 node(s)
id=1 @192.168.1.5 (Version: 5.0.51)

[mysqld(API)] 2 node(s)
id=4 (not connected, accepting connect from any host)
id=5 (not connected, accepting connect from any host)

As you can see the management node is waiting for connections from the data nodes.

Start the Data Nodes

On the data nodes, issue the commands

/etc/init.d/mysql restart
/etc/init.d/mysql-ndb restart

Go back to the management node, type show; again, and now you should see something similar to

id=2    @192.168.1.6  (Version: 5.0.51, starting, Nodegroup: 0)
id=3 @192.168.1.7 (Version: 5.0.51, starting, Nodegroup: 0)

Once they have started properly, the show command should display

ndb_mgm> show;
Cluster Configuration
---------------------
[ndbd(NDB)] 2 node(s)
id=2 @192.168.1.6 (Version: 5.0.51, Nodegroup: 0, Master)
id=3 @192.168.1.7 (Version: 5.0.51, Nodegroup: 0)
[ndb_mgmd(MGM)] 1 node(s)
id=1 @192.168.1.5 (Version: 5.0.51)
[mysqld(API)] 2 node(s)
id=4 @192.168.1.7 (Version: 5.0.51)
id=5 @192.168.1.6 (Version: 5.0.51)

Congratulations, your cluster is now setup.

Testing the cluster

Issue the following on both data nodes to create the test database. Since clustering is done on a table basis in MySQL we have to create the database manually on both data nodes.

$> mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 5.0.51a-3ubuntu5.1 (Ubuntu)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> create database clustertest;
Query OK, 1 row affected (0.00 sec)

Once this i done, on ONE of the data nodes, create a test table and add an entry.

mysql> use clustertest;
Database changed
mysql> create table test (i int) engine=ndbcluster;
Query OK, 0 rows affected (0.71 sec)

mysql> insert into test values (1);
Query OK, 1 row affected (0.05 sec)

mysql> select * from test;
+------+
| i |
+------+
| 1 |
+------+
1 row in set (0.03 sec)

We’ve just created a table test, added a value to this table and made sure that the table contains one entry. Note that engine=ndbcluster must be used to let MySQL know that this table should be clustered among the data nodes. Let’s make sure that the table is infact created on the other data node, and contains one entry.

mysql> use clustertest;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
+-----------------------+
| Tables_in_clustertest |
+-----------------------+
| test |
+-----------------------+
1 row in set (0.01 sec)

mysql> select * from test;
+------+
| i |
+------+
| 1 |
+------+
1 row in set (0.04 sec)

As you can see, the cluster is working.

Moving an existing database to the cluster

Now that we have the cluster working, we can easily change an existing database to be clustered. All you need to do is run the following command on each of the tables.

alter table my_test_table engine=ndbcluster;

The table, and all it’s data will be copied to the datanodes and you can now access/change then through any nodes in the cluster. Very simple.

Thursday, October 15, 2009

Format / Create partition on CentOS (LINUX perhaps)

Today i manage to remove and create the partition on CentOS 5.2 (i386).
BTW this server contain VMFS patition inside the server, so i need to remove this partition first.

as root, i run fdisk -l and you will get

Disk /dev/cciss/c0d0: 146.7 GB, 146778685440 bytes
255 heads, 32 sectors/track, 35132 cylinders
Units = cylinders of 8160 * 512 = 4177920 bytes

Device Boot Start End Blocks Id System
/dev/cciss/c0d0p1 * 1 25 101984 83 Linux
/dev/cciss/c0d0p2 26 1279 5116320 8e Linux LVM
/dev/cciss/c0d0p3 1280 35132 138120240 fb VMFS

So I decide to remove the partition first and i will use this partition as a ext3 partition. You can delete this VMFS partition by run

fdisk /dev/cciss/c0d0 or fdisk /dev/cciss/c0d0p3
then type p


the partition containing the VMFS is the one with type FB

to delete the partition type d
you will be asked for the number
enter it and the partition is gone
then type w to write out the partition table to the disk, then type q to exit

than reboot

the VMFS will be deleted after the reboot finish. Now let start to install / create a new partition using fdisk
as root run

fdisk /dev/cciss/c0d0
help
choose n
you will be ask some question to answer to suit your needs
after finish
w

reboot

after finish rebooting now we can start to create a new partition.
using

parted /dev/cciss/c0d0
p
mkfs 3
Yes
partition number (depend on your partition to create) : 3
wait for a sec

or you can use this to create a partition

Create the partition using parted or fdisk.

Format the partition with the ext3 file system using mkfs.

Label the partition using e2label.

Create the mount point.

Add the partition to the /etc/fstab file.


after finish please reboot your machine

Now you can use your new partition.
Thanks all.








Tuesday, October 6, 2009

Missing VMDK

On VMWare ESX3 (I tried already on ESX4 and it works!) , your VM has one or more VMDK files (extension .vmdk) and one or more flat vmdk files (last characters flat.vmdk )

In some cases, you may corrupt, lose or accidentally delete your VMDK files. Your VMDK’s contain metadata for your flat.vmdk files. Without your VMDK’s, you cannot load your flat.vmdk-files. Consequence: you cannot load the VM in your VirtualCenter and you cannot start the VM.
The following steps will guide you to recreate your vmdk files (.vmdk):

  1. Determine the hard disk sizes of your original VM (I call this VM from now on: VM A)
  2. Create a new VM (I call this VM from now on: VM B) with VirtualCenter with the same number of hard disks as your old VM, and the exact same sizes. So: if your original VM contained 2 harddisks from 8,00GB and 12,00GB, recreate these harddisks exactly the same in your new VM.
  3. After your VM B has been created, use Putty (or a similar tool) to navigate to your ESX server. Then navigate to the location / directory where your VM B is stored.
  4. Copy all VMDK’s (not the flat ones, but only the metadata files) to your VM A directory. The filesize of your META-data files should be a few KB.
  5. Navigate to your VM A directory. You just copied the *.VMDK files to this directory. Edit the VMDK’s with a text editor: (For my case i using nano inside the ESX server)You should replace the old filenames with the correct file names -> They refer to the new VM B, but they should refer to your old (original) VM A **
  6. Save the files.
  7. Load the VM in your VirtualCenter. You should now be able to add th flat.vmdk to your VM.

** # Extent description RW 62914560 VMFS "your_new_VM-flat.vmdk" to RW 62914560 VMFS "your_old_VM_name-flat.vmdk" and save

Monday, September 14, 2009

Tar on Ubuntu

Command line using tar command on ubuntu

tar -xf namefile.tar.gz or tar -xf namefile.tar.bz2

Thanks

Sunday, September 13, 2009

Adding HDD using VMware On FreeBSD

Let me show you how :

- Open your esx server console and choose server that you need to add another HDD.
- Edit server than choose HDD tab than click add
- follow the instruction to suit your need.
- after add click finish.

Now you need to format the HDD. Below will show you how.

- ssh or open console to the server you add the HDD
- as root run sysinstall
- than choose label (label disk editor)
- now you need to create slice for you disk.Currently I choose auto to create the disk
- after you name the disk than choose "w"
- that all mate.

Have a good day ahead.

Tuesday, September 1, 2009

Xcache on Lighty

Now I already UP my new webserver running on FreeBSD 7.2 PHP5 Mysql 5.1 And Lighttpd plus Xcache for boost my PHP opcode

ok here my c0nfiguration based on Nicraft website :

Install xcache, enter:
# cd /usr/ports/www/xcache
# make install clean

To enable xcahce copy the /usr/local/share/examples/xcache/xcache.ini config file into /usr/local/etc/php/ and modify it to suit your needs, enter:

# cp /usr/local/share/examples/xcache/xcache.ini /usr/local/etc/php/
# cd /usr/local/etc/php/
# vi xcache.iniSet xcache.size and other parameters as per your requirements.

sample xcache :

[xcache-common]
extension = xcache.so

[xcache.admin]
xcache.admin.enable_auth = On
xcache.admin.user = "admin"
; xcache.admin.pass = md5($your_password)
xcache.admin.pass = ""

[xcache]
; ini only settings, all the values here is default unless explained

; select low level shm/allocator scheme implemenation
xcache.shm_scheme = "mmap"
; to disable: xcache.size=0
; to enable : xcache.size=64M etc (any size > 0) and your system mmap allows
xcache.size = 512M
; set to cpu count (cat /proc/cpuinfo grep -c processor)
xcache.count = 4
; just a hash hints, you can always store count(items) > slots
xcache.slots = 8K
; ttl of the cache item, 0=forever
xcache.ttl = 0
; interval of gc scanning expired items, 0=no scan, other values is in seconds
xcache.gc_interval = 0

; same as aboves but for variable cache
xcache.var_size = 128M
xcache.var_count = 1
xcache.var_slots = 8K
; default ttl
xcache.var_ttl = 0
xcache.var_maxttl = 0
xcache.var_gc_interval = 300

xcache.test = Off
; N/A for /dev/zero
xcache.readonly_protection = Off
; for *nix, xcache.mmap_path is a file path, not directory.
; Use something like "/tmp/xcache" if you want to turn on ReadonlyProtection
; 2 group of php won't share the same /tmp/xcache
; for win32, xcache.mmap_path=anonymous map name, not file path
xcache.mmap_path = "/dev/zero"

; leave it blank(disabled) or "/tmp/phpcore/"
; make sure it's writable by php (without checking open_basedir)
xcache.coredump_directory = ""

; per request settings
xcache.cacher = On
xcache.stat = On
xcache.optimizer = Off

[xcache.coverager]
; per request settings
; enable coverage data collecting for xcache.coveragedump_directory and xcache_coverager_start/stop/get/clean() functions (will hurt executing performance)
xcache.coverager = Off

; ini only settings
; make sure it's readable (care open_basedir) by coverage viewer script
; requires xcache.coverager=On
xcache.coveragedump_directory = ""

Than restart your Lighttpd

Monday, August 24, 2009

Mysql Tips

If you want to see mysql job status run this command

log in mysql
run this status

mysql > show processlist;

you can got the output.

FreeBSD CPU Information

run this command

# sysctl -a | egrep -i 'hw.machine|hw.model|hw.ncpu'

enter

you can get the output.

Monday, July 27, 2009

List Installing Perl Modules on your box

Login as root and run

perl -MCPAN -e 'print CPAN::Shell->r'

Sunday, July 26, 2009

PHP problem

Just to remind me and for all,
After installing PHP5, we need to add this line to apache.conf in httpd.conf

AddType application/x-httpd-php .php
AddType application/x -httpd-php-source .phps

Tuesday, July 7, 2009

Install Jails In FreeBSD

I finally done to do jails in virtual freebsd in the bsd box.

here the step

ail is an virtual BSD in your current BSD Box… It uses the same kernel with ur BSD Box…

you can read the complete reference here or use man jail in the shell/ terminal window

I’ll only give a little explanation about this, this documentation will guide you so you’ll get a full new jailed system

OK this is the first step you must do…

Create a directory in a partition/slice which has largest freespace .. in this example i use /usr partition

# mkdir /usr/vbsd

# sysinstall

in sysinstall menu go to Custom > Options … in this section change the ‘Install Root‘ to /usr/vbsd

then exit by pressing Q.

then choose Distributions and select custom :

check list base, and others ( depend on your needs, i usually add man, ports, and local only :D ), in this case don’t choose kernel, because this jail system will use the same kernel as your host system.

After all’ve done, go to Media section and choose the proper media, you can use CD, FTP, etc. I prefer to use FTP because my campus network have a mirror of FreeBSD FTP, and it’s faster than read from CD.

after that… choose the last options ‘commit’ to install freebsd in that directory..

after finished….

you can enter to your jail system by type this to your shell window :

# jail /usr/vbsd/ 5.arc.itb.ac.id 167.205.3.47 /bin/tcsh

you’ll get yourself in new freebsd shell config your basic configuration like /etc/rc.conf, /etc/resolv.conf

(Check my other tutorial about this, note that jail system use the same interface as host system)

this is my /etc/rc.conf configuration for this new box :

defaultrouter=”167.205.3.1″
hostname=”5.arc.itb.ac.id”
ifconfig_rl0=”inet 167.205.3.37 netmask 255.255.255.192″
ipv6_enable=”YES”
nfs_client_enable=”YES”
ntpdate_enable=”YES”
ntpdate_flags=”ntp.kim.lipi.go.id”

#Daemon
sshd_enable=”YES”

and this is my /etc/resolv.conf

domain arc.itb.ac.id

nameserver 167.205.3.1

nameserver 167.205.22.123

I reccomend you to add user and change the root password.

I assume you have configured your Jail Box (added user, enable ssh, configure network, etc)

now switch to your host by pressing ctrl+D so you disconnect the jail server.

now we will start config jail daemon to be ran when system boot in /etc/rc.conf :

##Jail-Virtual##
jail_enable=”YES”
jail_list=”vmachine”
jail_vmachine_rootdir=”/usr/vbsd/”
jail_vmachine_hostname=”5.arc.itb.ac.id”
jail_vmachine_ip=”167.205.3.47″
jail_vmachine_devfs_enable=”YES”

#Network Alias

ifconfig_rl0_alias0=”inet 167.205.3.47 netmask 255.255.255.192″

add some config in /etc/sysctl.conf :

security.jail.allow_raw_sockets=1

restart your computer or just execute /etc/rc script :

# sh /etc/rc

now you can access your jail box via ssh….

Enjoy…

Tuesday, June 30, 2009

Malaysian CVSup Mirror for FreeBSD and OpenBSD

mirror cvsup for malaysian people.

1. cvsup.free.MyBSD.org.my (untuk cvsup FreeBSD)
2. cvsup.open.MyBSD.org.my (untuk cvsup OpenBSD)

Monday, June 29, 2009

Change Hostname and network in Linux

In Linux, you can use command simply like this to change your hostname

shell#hostname nameyourhost

or directory store your hostname

in RHEL
shell#nano /etc/hosts
in Ubuntu
shell# nano /etc/hostname

in case to edit to static IP


in RHEL Interface for network locate at

nano /etc/sysconfig/network-scripts/interface

in ubuntu

nano /etc/network/interface

add DNS in ubuntu / RHEL

nano /etc/resolv.conf

finally restart your network in linux

/etc/init.d/network restart

Sunday, June 28, 2009

Apache22 LDAP integration on FreeBSD

Finally I make it doing apache22 auth using LDAP

the solution

open your apache configuration httpd.conf and add this lines

Directory /path/directory/toauth>
Order deny,allow
Deny from All
AuthName "Please Login Using password"
AuthType Basic
AuthBasicProvider ldap
AuthzLDAPAuthoritative on
AuthLDAPURL ldap://xxx.xx.xxx.xx:389/
Require valid-user
Satisfy any
/Directory>


restart your apache

Community FreeBSD in Malaysia

For community FreeBSD in Malaysia.

Register!

http://forum.mybsd.org.my

Wednesday, June 24, 2009

To remove Parent Directory

Ok I already remove "Parent Directory" from Apache22 on BSD platform

- open your httpd.conf
- add this

Directory /data/yogya/>
IndexIgnore ..
/Directory>

- save and restart
- done

ps: please add < into the script directory.

Monday, June 22, 2009

Apache Aut

Apache authorised for single mode.

now I already done doing apache auth in single mod

here the step

edit http.conf
add the following line in http.conf

#
#apache permission testing
#
Directory /directory/to/auth/>
AllowOverride AuthConfig
/Directory>
#

ps: please put < at the begining of file Directory /directory/to/auth and /Directory because i cannot put right now because it will hidden that conf if i put < now.

Create a file /directory/to/auth/.htaccess in that director that looks something like this:

AuthName "Add your login message here."
AuthType Basic
AuthUserFile /directory/to/auth/.htpasswd
AuthGroupFile /dev/null
require user name-of-user

after that create the file .htpasswd to /directory/to/auth/ (to store password for user)
after that run this htpasswd -c .htpasswd name-of-user
and
restart apache

done for single user

now I try to auth with LDAP and stil searching the conf. I will let share with you guys if my work done.

taken at : http://www.yolinux.com/TUTORIALS/LinuxTutorialApacheAddingLoginSiteProtection.html

Thanks

Thursday, June 18, 2009

Mergemaster Problem (FreeBsd 7.0 to 7.2)

after i doing mergemaster i can't login as user to root privileges.
mergemaster have change all my /etc/group

if this happen to you run this as root

pw usermod username -Gwheel

Copy a file

simple command cp

cp namefile newnamefile

here the command i use for copy a file

go to /usr/local/etc/folder
maybe inside the folder have 3 files.

you just run this command will cp all files to the point folder and no need to tar.

cp -rp * /path/directory/to/copy
or
cp -rp feedback /usr/local/www/apache22/data/

Wednesday, June 17, 2009

Nginx Logrotated

ok here i wanted to share nginx logrotated run in RHEL. I run this script because iam using Dimdim with nginx engine and it store a huge log file.

Script for nginx logrotate.

Logs is located at /usr/local/dimdim/nginx/logs
Add nginx file and edit or add at /etc/logrotate.d

copy & paste this script

/usr/local/dimdim/nginx/logs/*.log {

daily
missingok
rotate 9
compress
delaycompress
notifempty
postrotate
kill -USR1 `cat /usr/local/dimdim/nginx/logs/nginx.pid`
endscript

}

restart

add rules at crontab so it can be run in time you set for the log

add
# rotating logrotate
59 23 * * * root /usr/sbin/logrotate -f /etc/logrotate.conf

done!

Installing OCS agent in Windows N Unix and FreeBSD

Ok here what i do when i installing OCS agent for OCS inventory server

Installing Ocsinventory agent in unix / linux

in linux we need to use / and download source at http://www.ocsinventory-ng.org/index.php?page=1-02

and installing using tar methods using tar -xzvf

and than running

perl Makefile.pl

make

make install

if have problem when installing ocs and need perl module try to install CPAN

installing CPAN

just type cpan on your shell

after you installing CPAN try to installing perl modules using this CPAN

example

cpan> install LWM::UserAgent



Installing Ocsinventory agent in FreeBSD.


Install agent using /usr/ports/net_mngmt

make && make install

running ocsinventory -d -l or ocsinventory -d -l

Also you can use tar.gz running on linux installer too the step of installing just follow the linux step.


after done the OCS will prompt some question regarding your system / server.

Small Linux in town!

The are too many Linux Distro out there so when i googling some open source forum i found this and i like to share with you guys some info of this linux

It is "SLAX 6"

It's 32 bit X86 based Linux platform.
It's ultra portable , it has only 190MB,
included all basic tools and ultilities.
Lots of softwares support too.

The awesome features are:

1. It can be boot from USB thumbdrive, CD, and Harddisk.

2. Install softwares by "Copy And Paste". No headache on installing softwares, drivers, etc...
Because you just need to find and download softwares (known as Modules) in Slax.org website, and paste it in the folder "Module".

3. Support many softwares, eg: Avast Antivirus, FireFox, VLC player, Messenger, Open Office, Flash Player, J2RE, media codec...

4. Multi Language supported. Can switch OS language. Chinese display/input available.

5. Read and Write NTFS, FAT, FAT32, formatted Harddisk/Flash Disk.

6. Easy to use, fast, compact, reliable, compatible, stable, secure, portable...



It's best to use as alternative OS, and back up agent when you can't load Windows at all.

more more info logon "http://www.slax.org/"

Is up!!!

Finally i already up my tech blog for me to store all script and job what have i done before. This blog will be my reference or for you if have any problem and still search the solution.

And maybe my blog will help you a lot.

OPEN SOURCE for ALL!!

Thanks!