this is to add function to rotate specific log
create a new file at /etc/logroate.d/
and write this into it for rotate log function
/var/log/SAT-backup/*.log {
monthly
rotate 4
missingok
compress
}
this blog was created for my own personal notes. If any of the post is useful for you, i happy to hear that but if there is any mistake make on my notes, please correct me
Wednesday, July 27, 2011
Wednesday, July 20, 2011
Centos change resolution
you can change the console resolution at
/boot/grub/grub.conf
add vga=775 at the end of kernal line
/boot/grub/grub.conf
add vga=775 at the end of kernal line
Thursday, June 30, 2011
Centos - basic knowledge
change DNS setting
/etc/resolve.conf
change host IP
/etc/sysconfig/network-script/ifcfg-eth0
change hostname
/etc/sysconfig/network
The easiest way to do it is
# system-config-network
/etc/resolve.conf
change host IP
/etc/sysconfig/network-script/ifcfg-eth0
change hostname
/etc/sysconfig/network
The easiest way to do it is
# system-config-network
Monday, June 6, 2011
Adding Swap Space
To add a swap file:
- Determine the size of the new swap file in megabytes and multiply by 1024 to determine the number of blocks. For example, the block size of a 64 MB swap file is 65536.
- At a shell prompt as root, type the following command with count being equal to the desired block size:
dd if=/dev/zero of=/swapfile bs=1024 count=65536 - Setup the swap file with the command:
mkswap /swapfile - To enable the swap file immediately but not automatically at boot time:
swapon /swapfile - To enable it at boot time, edit /etc/fstab to include the following entry:
/swapfile swap swap defaults 0 0The next time the system boots, it enables the new swap file.
- After adding the new swap file and enabling it, verify it is enabled by viewing the output of the command cat /proc/swaps or free.
- First must stop the swap file created by:
swapoff /swapfile - Then delete the:
rm -rf /swapfile
Monday, April 18, 2011
Zend Optimizer
Zend Optimizer
- To install Zend Optimizer, it's best is to download from http://www.zend.com/en/products/guard/downloads . Be aware you will need to register an account to be able to download it. After a few browsing and searching, get this
ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gzORZendOptimizer-3.3.9-linux-glibc23-x86_64.tar.gz - Extract it :
tar -zxvf ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz
- Then copy it to php modules folder:
cp ZendOptimizer-3.3.9-linux-glibc23-i386/data/5_2_x_comp/ZendOptimizer.so /usr/lib/php/modules/
(if that is 32bit machine)
- Create a file
/etc/php.d/zend.ini, put this in:
zend_extension=/usr/lib/php/modules/ZendOptimizer.so
- Restart apache
/etc/init.d/httpd restart
- Now it should work. Try doing a
php -i |grep -i zendto get the following result. This mean Zend is running
/etc/php.d/zend.ini, Zend Extension => 220060519 Zend Memory Manager => enabled This program makes use of the Zend Scripting Language Engine: Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies with Zend Optimizer v3.3.9, Copyright (c) 1998-2009, by Zend Technologies report_zend_debug => Off => Off zend.ze1_compatibility_mode => Off => Off Zend Optimizer Zend Loader => enabled
- To test a encoded file, download ZendGuard from http://www.zend.com/en/products/guard/downloads , the latest is ZendGuard 5.5 which support php5.3, but it still could be used to encode php5.2. Just remember while encoded, choose php 5.2, since the ZendOptimzer we just installed only support until php5.2 (as at 2011-01-18)
- Create a simple php script by putting
<?php echo 'this is encoded file' ?>and encode it. It should be a binary if success encoded. Upload that file into the webserver and test whether you can get the exact output.
Monday, April 11, 2011
transfer log from remote machine
vi /etc/sysconfig/syslog
change SYSLOGD_OPTION="-m 0"
to
SYSLOGD_OPTION="-m 0 -r"
then restart the syslog services
vi /etc/syslog.conf
instead of write the folder location
change it to @172.30.10.10
change SYSLOGD_OPTION="-m 0"
to
SYSLOGD_OPTION="-m 0 -r"
then restart the syslog services
vi /etc/syslog.conf
instead of write the folder location
change it to @172.30.10.10
Wednesday, April 6, 2011
Smokeping setup
Go to this Url for guide on how to install smokeping to Centos 5.5
The pages was for centos 5.5 i386
If you are installing it to centos 5.5 x86_64
just change the
rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
to
rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
http://www.how2centos.com/installing-smokeping-on-centos-5-5/
This is the official pages for the smokeping
http://oss.oetiker.ch/smokeping/
and here is the official simple guide
http://oss.oetiker.ch/smokeping/doc/index.en.html
The pages was for centos 5.5 i386
If you are installing it to centos 5.5 x86_64
just change the
rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
to
rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
http://www.how2centos.com/installing-smokeping-on-centos-5-5/
This is the official pages for the smokeping
http://oss.oetiker.ch/smokeping/
and here is the official simple guide
http://oss.oetiker.ch/smokeping/doc/index.en.html
Subscribe to:
Posts (Atom)