30 January 2012

search files in linux server

find /etc -name '*.conf'





/etc is directory or path


*.conf is file name * represents any name.conf files.

install Imagick on CentOS 5.x 32bit

Run the following commands


yum install ImageMagick

yum install ImageMagick-devel

yum install php-pear

pecl install imagick

echo "extension=imagick.so"> /etc/php.d/imagick.ini



service httpd restart

check Imagick is configured corectly by following command.

php -m | grep imagick

this will display output as "Imagick" that means you are Done.

cron job in kloxo/lxAdmin

command php -q /home/username/domain name/path to cron file

know the list of disabled functions on server

<?php
error_reporting(E_ALL);
$disabled_functions = ini_get('disable_functions');
if ($disabled_functions!='')
{
$arr = explode(',', $disabled_functions);
sort($arr);
echo 'Disabled Functions:
';
for ($i=0; $i<count($arr); $i++)
{
echo $i.' - '.$arr[$i].'<br>';
}
}
else
{
echo 'No functions disabled';
}
?>

check/list services running on server

service command - list running services
service --status-all
service --status-all | grep ntpd
service --status-all | less




Print the status of any service
To print the status of apache (httpd) service:
service httpd status


List all known services (configured via SysV)
chkconfig --list

List service and their open ports
netstat -tulpn
Turn on / off service
ntsysv
chkconfig service off
chkconfig service on
chkconfig httpd off
chkconfig ntpd on

change timezone on linux server

1 )
# cd /etc
# ln -sf /usr/share/zoneinfo/Asia/Calcutta localtime

Or

2) cp /usr/share/zoneinfo/Asia/Calcutta /etc/localtime

Or

3) # sudo ln -s /usr/share/zoneinfo/Asia/Calcutta /etc/localtime

wget multiple urls

usualy we do wget http://www.stephin/file/download.zip


but now i am going to show tell you how to download files to server from different different urls..

make a .txt files and put all the links in that loks like

 u may use linux command to make .txt file vi links.txt


finaly run wget -i links.txt


your files will get downloaded one by one...