Wednesday, 30 May 2012

custom commands linux centos

Find How Much Disk Space Is Being Used Show Display

#cd /var/
#du -hc --max-depth=1
#du -sh

how to show all repos
yum repolist all

how to clear cache of the server::
yum clean all

shwo installed version of the.

yum list installed | grep gd


how to install ftp server vsftpd and configure on centos


 yum list installed | grep ftp
 1083  yum install vsftpd
 1084  chkconfig vsftpd on
 1085  service vsftpd start

creat group
   groupadd ftp-users
   chown root:ftp-users /var/www/html/

adduser to ftp group 
  useradd -g ftp-users -d /var/www/html/ imran
create password for user.

 passwd imran

how to change password of ftp user.
  passwd imran
 enter new password;
 retype password: 

how to restrict and lock ftp user when not needed

passwd -l username{ftp user}

how to unlock the ftp user when needed

passwd +l username {ftp user}

Tuesday, 24 April 2012

how to install php53-mcrypt on centos

To install manually php53-mcrypt on your server follow the steps below,

when you are facing the issue of conflict then these steps will help you to resolve the issue.


First install some required packages:
yum install php53-devel libmcrypt-devel gcc gcc-c++
Then download the php 5.3.6 source code from php.net and unpack it:
wget http://mx2.php.net/get/php-5.3.6.tar.bz2/from/us3.php.net/mirror
tar xvjf php-5.3.6.tar.bz2
(Please note that the download link will change with every subsequent PHP release.)
Go to the directory with the mcrypt extension source code and compile:
cd php-5.3.6/ext/mcrypt/
phpize
aclocal
./configure
make
Then install:
make install
Create the configuration file for PHP /etc/php.d/mcrypt.ini containing:
extension=mcrypt.so
Restart apache:
/etc/init.d/httpd restart
Create a file with phpinfo just to check if the extension was loaded:
<?php
phpinfo();
?>
postgresql: Error connections  limit exceeded for nonsuper users.
to check how much connections are there.

try netstat -an|grep 5432

Wednesday, 4 April 2012

installing Mysql-server mysql Table 'mysql.servers' doesn't exist

This should solve the problem. Not sure how this problem started for me but I have used the below query and its eliminated the error.

CREATE TABLE `servers` (
`Server_name` char(64) NOT NULL,
`Host` char(64) NOT NULL,
`Db` char(64) NOT NULL,
`Username` char(64) NOT NULL,
`Password` char(64) NOT NULL,
`Port` int(4) DEFAULT NULL,
`Socket` char(64) DEFAULT NULL,
`Wrapper` char(64) NOT NULL,
`Owner` char(64) NOT NULL,
PRIMARY KEY (`Server_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='MySQL Foreign Servers table';

Regards:
Imran