ABHIONLINUX
Site useful for linux administration and web hosting

2011/04/19

How to install yasm

You can follow the steps given below to install yasm from source.


# wget http://www.tortall.net/projects/yasm/releases/yasm-0.7.0.tar.gz
# tar zfvx yasm-0.7.0.tar.gz
# cd yasm-0.7.0
#  ./configure
# make 
# make install
You can check the yasm binary using the command
# which yasm
/usr/local/bin/yasm

How to install Yamdi

You can follow the steps given below to install Yamdi

cd /usr/local/src/
wget http://downloads.sourceforge.net/project/yamdi/yamdi/1.4/yamdi-1.4.tar.gz?use_mirror=ufpr
tar zxf yamdi-1.4.tar.gz
cd yamdi-1.4
gcc yamdi.c -o yamdi -O2 -Wall
mv yamdi /usr/bin/
yamdi -h



You can check the yamdi binary using "which yamdi'

2011/04/09

How to install qt-faststart with ffmpeg


You can follow the steps given below to install qt-ffmpeg with ffmpeg. For this steps to work out, you should have a working ffmpeg installation in your server.

# svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
# cd ffmpeg
# ./configure
# make
#make tools/qt-faststart
#cp -a tools/qt-faststart /usr/bin/




2011/04/04

Spool file is locked (another process is handling this message) : Unable to send emails ,exim




There are many resons for this error. They may be due to dns, firewall.

Please try the fix given below.

#cd /var/spool/exim4/db
# mv * /backup
move all the files to a backup folder

#/etc/init.d/exim restart

This should fix the issue. If this doesnt fix the issue, please try by restarting the firewall. Firewall may be blocking your emails.

How to enable IP rotation in exim.


If your server are having multiple IP and you want to send each emails in different IP address. You can follow the steps given below. This is used to maintain the ip reputation. While doing this, please make sure that this is not used for spamming.

Open you exim config,

vi  /etc/exim.conf

search for the line : interface =

replace this line with
interface = 192.168.0.1${eval:${substr{-2}{1}{$tod_zulu}}%7+1}

If your server is having ip's from 192.168.0.11 to 192.168.0.20 , you can use above line.
+1 is  is the starting ip ie  192.168.0.1'1'
%9 is the incriment value ie 11(192.168.0.11) to how much. here it is 20 (192.168.0.20)



2011/03/28

Unable to load dynamic library ‘/usr/lib64/php/modules/ffmpeg.so


if you are getting the error message “Unable to load dynamic library ‘/usr/lib64/php/modules/ffmpeg.so” when you add the ffmpeg.so extension to the PHP configuration file i.e. php.ini file and tries to run PHP.

PHP Warning:  PHP Startup: Unable to load dynamic library ‘/usr/lib64/php/modules/ffmpeg.so’ – /usr/lib64/php/modules/ffmpeg.so: undefined symbol: _php_create_ffmpeg_frame in Unknown on line 0

Please try the fix given below.

Goto the the ffmpeg-php-0.x.0 directory and edit the ffmpeg_frame.c file

vi  /usr/src/ffmpeg-php-0.6.0/ffmpeg_frame.c

Now replace every instance of ‘PIX_FMT_RGBA32′ with ‘PIX_FMT_RGB32′ in the file by executing

Save the file and recompile ffmpeg-php

#ldconfig
#phpize
#./configure --enable-shared --with-ffmpeg=/usr/local/cpffmpeg
#make -j$cpu
#make install

phpize : command not found

#-bash: phpize: command not found


This error is due to "phpize" command not available on your server. To fix, install php-devel package.


yum  install php-devel

How to install GIT

Git is distributed version control system focused on speed, effectivity and real-world usability on large projects. Following are the steps to intsall Git

wget http://kernel.org/pub/software/scm/git/git-1.7.3.tar.bz2
tar jxvf git-1.7.3.tar.bz2
cd git-1.7.3
./configure
make && make install
git

2011/03/23

Yum update failed.


Yum update failed.
===================================
"-bash-3.1# yum update
Loading “installonlyn” plugin
error: no dbpath has been set
error: cannot open Packages database in /%{_dbpath}
Traceback (most recent call last):
File “/usr/bin/yum”, line 29, in ?
yummain.main(sys.argv[1:])
File “/usr/share/yum-cli/yummain.py”, line 82, in main
base.getOptionsConfig(args)
File “/usr/share/yum-cli/cli.py”, line 206, in getOptionsConfig
errorlevel=opts.errorlevel)
File “/usr/lib/python2.4/site-packages/yum/__init__.py”, line 132, in
doConfigSetup
self.conf = config.readMainConfig(startupconf)
File “/usr/lib/python2.4/site-packages/yum/config.py”, line 598, in
readMainConfig
yumvars['releasever'] = _getsysver(startupconf.installroot,
startupconf.distroverpkg)
File “/usr/lib/python2.4/site-packages/yum/config.py”, line 661, in
_getsysver
idx = ts.dbMatch(‘provides’, distroverpkg)
TypeError: rpmdb open failed"
==========================


If you are getting this error, you need to clear the database.

Yum clean all
rm -f /var/lib/rpm/_db*
rpm -rebuilddb
yum update

If this doesnt fix your issue, try the following steps also.

rm /dev/urandom
mknod -m 644 /dev/urandom c 1 9
yum clean all.


This should fix your issue.

2011/03/21

Command to check the performance of the hard disk.


Command to check the performance of the hard disk.

You can use the command given below to check the hard disk performance.

hdparm /dev/sda

/dev/sda:
 multcount     = 16 (on)
 IO_support    =  1 (32-bit)
 readonly      =  0 (off)
 readahead     = 256 (on)
 geometry      = 19457/255/63, sectors = 312581808, start = 0


You can replace /dev/sda with the name of your disk device.

2011/03/20

Request exceeded the limit of 10 internal redirects due to probable configuration error. Use ‘LimitInternalRecursion’ to increase the limit ifnecessary. Use ‘LogLevel debug’ to get a backtrace

Request exceeded the limit of 10 internal redirects due to probable configuration error. Use ‘LimitInternalRecursion’ to increase the limit ifnecessary. Use ‘LogLevel debug’ to get a backtrace


When you try to browse your website, if you are getting this error. This means that you have exceeded the limit of intername redictions used in your website.


To avoid  this error message simply use following code in .htaccess file.


RewriteRule .* - [L]

2011/01/22

Linux Plesk Back end files.

Plesk root directory :  /usr/local/psa
Plesk version          :  /usr/local/psa/version
Plesk Admin pass    :  /etc/psa/.psa.shadow
Plesk conf file         : /etc/psa/psa.conf
Apache conf           : /etc/httpd/conf/httpd.conf
Plesk apache startup script  : /usr/local/psa/admin/bin/httpsdctl start
Apache log files      : /var/log/http/
Php conf                :  /etc/php.ini
Named conf           : /var/named/run-root/etc/named.conf
Named db              : /var/named/run-root/var/domainname
Log                       : /var/log/messages
Names restart         : /etc/init.d/named restart
Mysql Db location  : /var/lib/mysql
Mysql conf            : /etc/my.cnf
Mysql log              : /var/log/mysql.log
Plesk qmail            : /var/qmail
Mail Dir for domain: /var/qmail/mailnames/domainname
Maillog                  : /var/log/maillog
Plesk home dir       : /var/www/vhosts/domain.com
Plesk Doc root       :  /var/www/vhost/domainname/httpdocs
Subdomain Docroot:  /var/www/vhost/domainname/subdomain
Domain specific log: /var/www/vhosts/domainname/statistics/logs


Plesk Db:
Plesk database is called psa. Admin logins are used to access psa db.

Following are the tables in psa db
1. Domains

2. Clients
3. db_users
4. db_bases
5. disk_spaces
6. mail
7. lockout
8. web_users

2011/01/14

Move worpress site from subfolder to root

Assume that wordpress is installed in /blog folder and root domain is abhionlinux.co.cc
You can follow the steps below to move the blog to root dir.

1. Backup the folder /blog , this is done as  a precaution.
2. Copy all the files in blog to root dir, make sure .htaccess file is also copied. There shouldnt be any index files such as index.php or index.html.
3. Add the following line in wp-config.php under root dir.


define('RELOCATE',true);

4. Open the URL abhionlinux.co.cc/wp-login.php and enter the admin login details.
5. Go to general settings, Make sure  in wordpress address field  you have abhionlinux.co.cc(root dir) and make blog address URL as abhionlinux.co.cc(root dir). Most likely it will be having
http://abhionlinux.co.cc/blog, dont leave '/' in domain name.
6. Check htaccess in root dir and make sure it is similar to the one given below.
====================
IfModule mod_rewrite.c
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
IfModule
===================

Now your wordpress site is move from subfolder to root dir. 
7. You can remove the line below from the file wp-config.php

define('RELOCATE',true);

Try it out !!!



2011/01/13

Moodle : ERROR: Could not find or create a directory (/home/username/public_html/uploaddata/16)

After creating the course, when you try to add files/folders in the course you will get an error "ERROR: Could not find or create a directory (/home/username/public_html/uploaddata/16"

This is due permission/ownership issue/.
Make sure that all your files and folders are having correct  ownership (username.username)
Check the permission for /uploaddata/, this should be set to 777.

Unable to login to Moodle site "Your session has timed out. Please login again"

When you try to login to your Moodle admin section,  you will get an error showing "Your session has timed out. Please login again"

Fix:
Check whether the folder /uploaddata/sessions/ is having 777 permission.
Clear all the session files in this folder.

Then you will be able to login to your website.