|
|
CSF (ConfigServer Security & Firewall) is a excellent and easily configurable firewall solution for WHM/Cpanel servers. But I would recomend to use APF is possible but there is no any GUI to manage it.
Here are the quick steps to install it,
# mkdir /home/installation && cd /home/installation
#tar -zxvf csf.tgz
-bash-3.2# cd csf
-bash-3.2# iptables -L
-bash-3.2# service iptables stop
-bash-3.2# sh install.sh
-bash-3.2# csf -s
-bash-3.2# vi /etc/csf/csf.conf
Specify which ports you want to allow. Find the lines as shown below and add the port you want to open.
Here is showing standard Cpanel port list.
# Allow incoming TCP ports
TCP_IN = “20,21,22,25,53,80,110,143,443,465,953,993,995,2077,2078,2082,2083,2087″
# Allow outgoing TCP ports
TCP_OUT = “20,21,22,25,37,43,53,80,110,113,443,587,873,953,2087,2089,2703″
# Allow incoming UDP ports
UDP_IN = “20,21,53,953″
# Allow outgoing UDP ports
# To allow outgoing traceroute add 33434:33523 to this list
UDP_OUT = “20,21,53,113,123,873,953,6277″
Now you need to make the CSF rule to become active rather than testing,
Disable the Testing Mode and Start the Firewall.
a. Edit csf config file /etc/csf/csf.conf and update the following lines.
TESTING = “0″
Now restart the CSF service,
-bash-3.2# csf -r
-bash-3.2# chkconfig iptables off
That’s it.
Now you can see and Option ” ConfigServer Security&Firewall ” enabled on the WHM under ‘plugins” tree at the bottom of the right side panel.
Feel free to make the changes/updates over web interface on whm
-njoy
# yum install python-chm if it is not work download the following rpm from rpmforge respository
# wget ttp://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.i386.rpm
# rpm -ivh rpmforge-release-0.5.1-1.el5.rf.i386.rpm
# yum clean all , Again
# yum install python-chm
Now we need to install gnochmviewer
#wget http://dag.wieers.com/rpm/packages/gnochm/gnochm-0.9.11-1.el5.rf.noarch.rpm
# rpm -ivh gnochm-0.9.11-1.el5.rf.noarch.rpm
My installation files for this package are,
[root@rc-090 chmviewer]# ls -la
-rwxr-xr-x 1 root root 45884 Mar 10 13:26 chmlib-0.40-1.el5.rf.i386.rpm
-rwxr-xr-x 1 root root 173836 Mar 10 13:26 gnochm-0.9.11-1.el5.rf.noarch.rpm
-rw-r–r– 1 root root 239 Mar 10 13:26 install.sh
-rwxr-xr-x 1 root root 66405 Mar 10 13:26 python-chm-0.8.4-1.el5.rf.i386.rpm
How do I install zend optimiser enabled on php ?
Download Zend optimizer from Zend website
#tar -zxvf ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz
# cd ZendOptimizer-3.3.9-linux-glibc23-i386
# cd data/5_2_x_comp/
# cp ZendOptimizer.so /usr/lib/extensions/no-debug-non-zts-20060613/
Where I set extension_dir varible set to “/usr/lib/extensions/no-debug-non-zts-20060613/” on php.ini
Adding entry on php.ini
#cat "zend_extension=/usr/lib/extensions/no-debug-non-zts-20060613/ZendOptimizer.so" >> /etc/php.ini
Restart Apache and verify the installation
[root@rc-033 5_2_x_comp]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
[root@rc-033 5_2_x_comp]# php -r ‘phpinfo();’| grep “zend”
report_zend_debug => Off => Off
zend.ze1_compatibility_mode => Off => Off
PWD => /home/installation/zendoptimiser/ZendOptimizer-3.3.9-linux-glibc23-i386/data/5_2_x_comp
OLDPWD => /home/installation/zendoptimiser/ZendOptimizer-3.3.9-linux-glibc23-i386
_SERVER["PWD"] => /home/installation/zendoptimiser/ZendOptimizer-3.3.9-linux-glibc23-i386/data/5_2_x_comp
_SERVER["OLDPWD"] => /home/installation/zendoptimiser/ZendOptimizer-3.3.9-linux-glibc23-i386
_ENV["PWD"] => /home/installation/zendoptimiser/ZendOptimizer-3.3.9-linux-glibc23-i386/data/5_2_x_comp
_ENV["OLDPWD"] => /home/installation/zendoptimiser/ZendOptimizer-3.3.9-linux-glibc23-i386
[root@rc-033 5_2_x_comp]#
I got this error when I try to exeucute a scheduled job.
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 16 bytes) in /home/login/www/libraries/joomla/database/database/mysql.php on line 462
The solution is,
Increase the memory_limit on php.ini. Since I am using a shared hosting I can’t change the settings globally. So O switched to the webroot and create .htaccess file then add the line
-bash-3.2# vi .htaccess
php_value memory_limit 400M
php_value max_execution_time 18000
Problem Solved !!
I’d worked with one client who is using enterprisedb ( Redwood version).This database claims the stable performance and index searching same like Oracle does. It’s installation is more difficult since it’s using a GUI installer which requires separate “tmp” partition to start the GUI launcher. very sad thing –
Here are the few examples I uses to administrate it.
For Linux Server.
How start and stop Enterprisedb server
Change to EDB binary directory
cd /opt/EnterpriseDB/8.1.3.12/dbserver/bin
a. For Stopping
#pg_ctl -D /opt/EnterpriseDB/8.1.3.12/data stop
b. For Starting
pg_ctl -D start
Eg: #pg_ctl -D /opt/EnterpriseDB/8.1.3.12/data start
c. Restarting
pg_ctl -D restart/reload
Eg: #pg_ctl -D /opt/EnterpriseDB/8.1.3.12/data restart/reload
Note : U may use reload command in order of loading the chagedset without having DB shout down.
1. To dump all databases:
$ pg_dumpall > db.out -Uenterprisedb
2. To restore the database,
edb-psql -d -f
-U enterprisedb
C:\>edb-psql -d symbiosis -f temp.sql -Uenterprisedb
Password for user enterprisedb:
3. Creating a database
C:\>createdb test -Uenterprisedb
Password:
CREATE DATABASE
4. Dumping a single database
C:\>pg_dump -d test -f dump.sql -Uenterprisedb
Password:
C:\>
[root@rc-040 installation]# who -r
run-level 5 2010-02-19 22:12 last=3
I want to backup all the files on the live server to keep on my backup server. How I can do this ?
I prefer lftp to do this. Using lftp we can either synchronize the local files to a remote location or wise versa.
1. How do I syncronise the a folder on a FTP location to my local Linux server.
Suppose these are my remote ftp details:
FTP : 208.74.34.93
User: user
Password : pass
Ftp backup folder: securedata
[root@web-test1 ~]# yum install lftp*
Then
#lftp -u user,pass -e "mirror --delete --only-newer --verbose /securedata /Backup/local/webfiles" 208.74.34.93</code>
I simply create script file and add this to a daily cron job,
[root@rc-040 scripts]# crontab -l
10 12 * * * /bin/sh /home/installation/scripts/marketbkp.sh
Second one is, copying the local files and upload to a remote ftp location. Just append the word "--reverse" to the existing command line path.
#lftp -u user,pass -e "mirror --reverse --delete --only-newer --verbose /securedata /Backup/local/webfiles" 208.74.34.93
Which would upload/synchronize all the files from the locally and upload to the remote location. This would be very helpful in case of disaster management. I do create a script for this.
I’m using PHP 5.2.9 on Centos5.3 server where php is installed from the source compilation.
First I added the diag repository on my yum path,
#rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
#yum clean all
#yum update
#yum install ffmpeg ffmpeg-devel
#yum install mplayer mencoder
How to test ffmpeg is installed
[root@rc-149 ffmpeg-php-0.6.0]# ffmpeg
FFmpeg version 0.5, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: –prefix=/usr –libdir=/usr/lib –shlibdir=/usr/lib –mandir=/usr/share/man –incdir=/usr/include –enable-libamr-nb –enable-libamr-wb –enable-libdirac –enable-libfaac –enable-libfaad –enable-libmp3lame –enable-libtheora –enable-libx264 –enable-gpl –enable-nonfree –enable-postproc –enable-pthreads –enable-shared –enable-swscale –enable-x11grab
libavutil 49.15. 0 / 49.15. 0
libavcodec 52.20. 0 / 52.20. 0
libavformat 52.31. 0 / 52.31. 0
libavdevice 52. 1. 0 / 52. 1. 0
libswscale 0. 7. 1 / 0. 7. 1
libpostproc 51. 2. 0 / 51. 2. 0
built on Nov 6 2009 19:05:03, gcc: 4.1.2 20080704 (Red Hat 4.1.2-46)
At least one output file must be specified
[root@rc-149 ffmpeg-php-0.6.0]#
Then install flvtool2
#yum install flvtool2*
Then I download the latest from php-ffmpeg package from sourceforge.
#wget http://downloads.sourceforge.net/project/ffmpeg-php/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2?use_mirror=nchc
tar -xjf ffmpeg-0.5.2.1.tbz2
#phpize
#./configure
#make
#make install
Now I’m going to edit the php.ini (/etc/php.ini) and add/modify the following lines on it,
extension_dir = “/usr/lib/extensions/no-debug-non-zts-20060613/”
extension=ffmpeg.so
[root@rc-149 ~]# php -r ‘phpinfo();’| grep “ffmpeg”
ffmpeg
ffmpeg-php version => 0.6.0-svn
ffmpeg-php built on => Feb 15 2010 19:11:38
ffmpeg-php gd support => enabled
ffmpeg libavcodec version => Lavc52.20.0
ffmpeg libavformat version => Lavf52.31.0
ffmpeg swscaler version => SwS0.7.1
ffmpeg.allow_persistent => 0 => 0
ffmpeg.show_warnings => 0 => 0

Even though mantis installation is very easy, But I fed up with the option for getting initial administrator password for the login.
Mantis default password for ‘Administrator’ is “root”
How to remove the old back up files,
I found following command is very useful for removing old backup file which causing Disk free space alert mails. I used to create the backup file named based on the created dated like , backupname-day-month-year Eg. securesvn-12-02-2010.zip
# Re: # rm -rf svn-backup-*-12* which will be deleted the all backup file created on December. I uses a script to do this job which will help to save a great sys-admin’s time.
our requirement is, I have a pdf file which is created using doc conversion ( have a look at my previous post). While I converting it to jpg it’s showing the errors as follows,
xecution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push
Dictionary stack:
--dict:1147/1684(ro)(G)-- --dict:0/20(G)-- --dict:71/200(L)--
Current allocation mode is local
Last OS error: 2
GPL Ghostscript 8.63: Unrecoverable error, exit code 1
After googling, I found upgrading of ghostscripts will solve my problem. And I had success on upgrading ghostscripts on local desktop but not on server
I found the same technique will not work for me since imagemagic is bind with ghoscripts. Suppose whenever I try to install imagemagic it will either install ghostscripts along with it or terminate with the error with lasted ghostscripts package conficts that were installed manually before.
My solution is,
1. First remove the Imagemagic and ghostscripts from the server.
2. Then I did jasper installation and then installed the ghostscript latest rpm.
3. After I installed Imagemagick separately from the Centos latest package repository.
rpm -Uvh http://chrisschuld.com/centos52/jasper-libs-1.900.1-8.i386.rpm
rpm -Uvh http://chrisschuld.com/centos52/jasper-1.900.1-8.i386.rpm
rpm -Uvh http://chrisschuld.com/centos52/jasper-utils-1.900.1-8.i386.rpm
rpm -Uvh http://chrisschuld.com/centos52/jasper-devel-1.900.1-8.i386.rpm
rpm -Uvh http://chrisschuld.com/centos52/ghostscript-8.63-1.i386.rpm
rpm -Uvh http://chrisschuld.com/centos52/ghostscript-devel-8.63-1.i386.rpm
rpm -Uvh http://chrisschuld.com/centos52/ghostscript-gtk-8.63-1.i386.rpm
Then download the imagemagic rpm from here,
http://mirror.vpshosting.com.hk/pub/linux/centos/5.4/os/i386/CentOS/ You may found various youm repository list from Centos download urls. Just go through the parent url to reach rpm distribution.
After that I can convert .pdf to image easily.
# convert test.pdf test.jpg
|
|