Tuesday 30 June 2009

How to install Flash Player 10 Under Ubuntu Linux 32 bit Edition

Adobe flash player version 10 (code-named "Astro") has been released and available for download. It has many new features such as:
+ Visual performance improvements
+ 3D effects
+ Custom Filters and Effects
+ Advanced Text Layout
+ Enhanced Drawing API
+ Performance improvements and much more.


You must uninstall any currently installed Flash Player before installing the beta under Linux or Mac / Windows computer. Open Firefox and type following at url box:


about:plugins


( Flash Player 9 installed)




Install Ubuntu flash 10 Player


Visit this url and grab .deb file. Uninstall old flashplayer 9 ( if installed ):
$ sudo apt-get remove flashplugin-nonfreeNow, install Flash 10 (make sure Firefox is not running):
$ sudo dpkg -i install_flash_player_10_linux.deb


Start firefox and type about:plugins. You should see list of plugins including Flash 10.


T2 :  Install Flash Player 10 Final in your home directory


If you need to install flash plugin in your home directory, type the following commands. To uninstall type the command:
$ cd ~/.mozilla
$ rm flashplayer.xpt libflashplayer.so


Visit adobe website to grab flash player 10 tar.gz (tar ball). Download and install flash player 10 (please exit any browsers you may have running):
$ cd /tmp
$ wget http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_10_linux.tar.gz
$ tar -zxvf install_flash_player_10_linux.tar.gz
$ cd install_flash_player_10_linux
$ ./flashplayer-installer


Sample output:



Copyright(C) 2002-2006 Adobe Macromedia Software LLC.  All rights reserved.

Adobe Flash Player 10 for Linux

Adobe Flash Player 10 will be installed on this machine.

You are running the Adobe Flash Player installer as a non-root user.
Adobe Flash Player 10 will be installed in your home directory.

Support is available at http://www.adobe.com/support/flashplayer/

To install Adobe Flash Player 10 now, press ENTER.

To cancel the installation at any time, press Control-C.

NOTE: Please exit any browsers you may have running.

Press ENTER to continue...

----------- Install Action Summary -----------

Adobe Flash Player 10 will be installed in the following directory:

Mozilla installation directory = /home/vivek/.mozilla

Proceed with the installation? (y/n/q): y

NOTE: Please ask your administrator to remove the xpti.dat from the
components directory of the Mozilla or Netscape browser.

Installation complete.

Perform another installation? (y/n): n

Please log out of this session and log in for the changes to take effect.

The Adobe Flash Player installation is complete.

Now open Firefox and type about:plugins:




You can now view any flash based site.

How to install Flash Player 10 Under Ubuntu Linux 32 bit Edition

Adobe flash player version 10 (code-named "Astro") has been released and available for download. It has many new features such as:
+ Visual performance improvements
+ 3D effects
+ Custom Filters and Effects
+ Advanced Text Layout
+ Enhanced Drawing API
+ Performance improvements and much more.


You must uninstall any currently installed Flash Player before installing the beta under Linux or Mac / Windows computer. Open Firefox and type following at url box:


about:plugins


( Flash Player 9 installed)




Install Ubuntu flash 10 Player


Visit this url and grab .deb file. Uninstall old flashplayer 9 ( if installed ):
$ sudo apt-get remove flashplugin-nonfreeNow, install Flash 10 (make sure Firefox is not running):
$ sudo dpkg -i install_flash_player_10_linux.deb


Start firefox and type about:plugins. You should see list of plugins including Flash 10.


T2 :  Install Flash Player 10 Final in your home directory


If you need to install flash plugin in your home directory, type the following commands. To uninstall type the command:
$ cd ~/.mozilla
$ rm flashplayer.xpt libflashplayer.so


Visit adobe website to grab flash player 10 tar.gz (tar ball). Download and install flash player 10 (please exit any browsers you may have running):
$ cd /tmp
$ wget http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_10_linux.tar.gz
$ tar -zxvf install_flash_player_10_linux.tar.gz
$ cd install_flash_player_10_linux
$ ./flashplayer-installer


Sample output:



Copyright(C) 2002-2006 Adobe Macromedia Software LLC.  All rights reserved.

Adobe Flash Player 10 for Linux

Adobe Flash Player 10 will be installed on this machine.

You are running the Adobe Flash Player installer as a non-root user.
Adobe Flash Player 10 will be installed in your home directory.

Support is available at http://www.adobe.com/support/flashplayer/

To install Adobe Flash Player 10 now, press ENTER.

To cancel the installation at any time, press Control-C.

NOTE: Please exit any browsers you may have running.

Press ENTER to continue...

----------- Install Action Summary -----------

Adobe Flash Player 10 will be installed in the following directory:

Mozilla installation directory = /home/vivek/.mozilla

Proceed with the installation? (y/n/q): y

NOTE: Please ask your administrator to remove the xpti.dat from the
components directory of the Mozilla or Netscape browser.

Installation complete.

Perform another installation? (y/n): n

Please log out of this session and log in for the changes to take effect.

The Adobe Flash Player installation is complete.

Now open Firefox and type about:plugins:




You can now view any flash based site.

Saturday 20 June 2009

How to backup Xen with Logical Volume Mounts ; Works with HyperVM, SolusVM, FluidVM and More

Through our research and implementation of many Xen environments, it has become necessary to develop a reliable and secure method for backing up our Xen instances that are mounted on Logical Volumes (LVM).

The underlying problem is that the logical volume is usually a live file system that cannot be directly mounted / backed up or imaged safely.

We have written a script that processes all running Xen logical volumes, creates a snapshot of the volume and through that snapshot , uses dd to image the snapshot to another server over ssh.

You would be surprised at how well these dd images compress. Piping dd to bzip2 then to ssh to receive the image produces a very substantial compression ratio.

The initial trouble was writing the logic in the script to properly go through each Xen LV , create the snapshot, image and then remove the snapshot. Obviously extensive testing had to be completed to ensure reliability and proper error reporting.

This script should work with any 3rd party Xen control panel implementation (HyperVM, FluidVM, SolusVM to name a few). They all use the same underlying technology / framework. Since our script is a simple bash / shell script, it will run on any linux based system with little modification.

If you are using a LV for another purpose on the same box, it is probably a good idea to modify the script to ignore that so it doesn’t inadvertently get backed up.

Before implementing the script, it is probably a good idea to go through the motions manually just to see how it performs :
lvcreate -s -L 5G -n vm101_img_snapshot /dev/vps/vm101_img
dd if=/dev/vps/vm101_img_snapshot | bzip2 | ssh xenbackup@x.x.x.x "dd of=vm101_img.bz2"

One thing that you cant get around is space — you need to leave as much room as the largest Xen image on your logical volume — otherwise the script will fail at the snapshot creation process.

Find the script below. Hopefully it will help make your life easier (as well as being able to sleep at night) :
#!/bin/bash
# XEN Backup script
# Written by Star Dot Hosting

todaysdate=`date "+%Y-%m-%d"`

echo "XEN Backup Log: " $currentmonth > /var/log/backup.log
echo -e "------------------------------------" >> /var/log/backup.log
echo -e "" >> /var/log/backup.log

for obj0 in $(lvs --noheadings --separator ',' -o lv_name,lv_size | grep -v "swap" | awk -F "," '{printf "%sn", $1}');
do

#grab the snapshot size
snapsize=`lvs --noheadings --separator ',' -o lv_name,lv_size | grep -v "swap" | grep $obj0 | awk -F "," '{printf "%s", $2}'`

#create the snapshot
lvcreate -s -L $snapsize -n $obj0_snapshot /dev/xenlvm/$obj0 >> /var/log/backup.log 2>&1

#dd piped to bzip2 to compress the stream before piping it over the network via ssh to the destination box
dd if=/dev/xenlvm/$obj0_snapshot | bzip2 | ssh xenbackup@0.0.0.0 "dd of=/home/xenbackup/xen-backups/$obj0.$todaysdate.bz" >> /var/log/backup.log 2>&1

if [ "$?" -eq 1 ]
then
echo -e "***SCRIPT FAILED, THERE WERE ERRORS***" >> /var/log/backup.log 2>&1
cat /var/log/backup.log | mail -s "XEN Backup Job failed" admin@yourdomain.com
lvremove -f /dev/xenlvm/$obj0_snapshot
exit 1
else
echo -e "Backup of $obj0 Completed Successfully!" >> /var/log/backup.log 2>&1
fi

# remove the snapshot
lvremove -f /dev/xenlvm/$obj0_snapshot

done

cat /var/log/backup.log | mail -s "XEN Backup Job Completed" admin@yourdomain.com

Horde broken or not working correctly on cPanel

Simple, short & sweet post, this should easily fix any problems you’re having

/usr/local/cpanel/bin/update-horde --force

Also, this might be useful to run hourly, I leave this on our servers “just in case”.

(mysqlcheck --auto-repair eximstats ; mysqlcheck --auto-repair horde) >/dev/null 2>/dev/null

Friday 19 June 2009

How To Transfer CPanel Accounts

To transfer account you should have root access on both servers. Because to transfer account you need every thing to backup for transfer including Cpanel User / Pass (Same), Website, Database, Emails, Users, Stats etc. . The thing i like about CPanel is it will transfer accounts 100%, you will not miss any single think related to your accounts. This method implies on VPS’s and Dedicated Server where you can access WHM (Web Host Manager) or root shell.

Lets consider we have two servers A and B. Server A is the old server with two accounts and Server B is new server to which we will transfer accounts.

Server A = 192.168.0.1
Server B = 172.20.0.1

1 Transfer using WHM
Login to Server B WHM using following url

http://172.20.0.1:2086

where 2086 is the port on which WHM is running.

In the middle page select Transfer and then on Transfer page select Copy multiple accounts/packages from another server.

It will open new page to put info of the Server through which you are going to transfer i.e Server A.

Remote server type is (WHM version will be auto detected on multi account copies): leave as it is
Remote server address (ip address or FQDN): put server hostname or IP
Remote SSH port: 22 is the default, if you have changed ssh port on old server use that one here.
Do not compress transfers (cPanel 10.8.3+ required on both ends): leave at it is
Turn off SSL (cPanel 11.23.6+ required on both ends): leave at it is
Allow override*: leave at it is
Login as : Choose USER if you have sudo or direct root login are not allowed. Else select ROOT (recommended)
Select authentication method: Choose Password here, if you are using Public Key then you have to upload Key using Security -> Manage SSH Keys to use here.
Root Password: put root password here

After putting all information above click on Fetch Account List. In few second you will see list of accounts from Server A to transfer. Select the account using check boxes to copy, if need to copy all select Select All to check all accounts. When done with select click on Copy. (Beware once you click on Copy dont close browser or click on Back button).

You will see account transfer log on your browser and when finished it will show nice summary about transfer.

2 Transfer using Shell (Command Line)
SSH your Server A using putty from windows and command line from linux.

ssh 192.168.0.1

Now first of all we will create full backup to transfer and all the backups created are placed under /home directory.

2.1 Create One Account Backup
If you wish to backup single account, then execute following command

/scripts/pkgacct cpaneluser

you will find corresponding backup in /home directory named cpmove-cpaneluser*.tar.gz

2.2 Create all Accounts Backup
To create all accounts backup on your server, execute following command

cat /var/cpanel/users | while read a; do
/scripts/pkgacct $a
done

again you will find all accounts backup under /home named cpmove-cpaneluser*.tar.gz

2.3 SCP Backups to New Server
After creating backup you have to transfer all accounts backup to your new server i.e Server B using SCP.

scp cpmove-* root@172.120.0.1:/home

Besure all backups should move to /home directory of new server.

If you have done all accounts backup then you should have to move /var/cpanel/users file for restore on new server i.e Server B in /home directory with name user.txt

scp /var/cpanel/users root@172.120.0.1:/home/user.txt

2.4 Restore Backup
To restore single account backup execute following command.

/scripts/restorepkg cpaneluser

where cpaneluser is of old server and can be found on backup filename after cpmove. i.e

cpmove-cpaneluser*.tar.gz

To restore all accounts

cat /home/user.txt | while read a; do
/scripts/restorepkg $a
done

Now you can List Account in WHM to see all accounts are transferred successfully to your new server and you can login to cpanel accounts of user using same Cpanel user / pass as old server.

Sunday 14 June 2009

How To Install FFmpeg, Mplayer, Mencoder, FFmpeg-PHP on CentOS 5.x

In this how to we'll describe how to install ffmpeg, mplayer, mencoder, flvtool2, ffmpeg-php with all supported codecs to convert / manipulate videos easily on CentOS 5.x. If you want to run sites like youtube e.g www.indianpad.in, www.danceindiadance.in this howto will help you to install the base for your software. There are many other way to perform this but this works for me, so i want to share. --SR

1 Setting Up RPMForge Respository.


RPMForge repository (http://dag.wieers.com) is the biggest rpm respository for RHEL, CentOS for all versions. To enable RPMForge respository run following command to install all necessary files for getting RPMForge repository. The following command directly install rpm from http://da.wieers.com site.
rpm -Uhvhttp://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm

This rpm will add necessary files in our repository configuration and can be viewed at /etc/yum.repos.d/rpmforge.repo

2 Install ffmpeg, mplayer, mencoder with all supported modules.


Now we have rpmforge repository, so we will use yum to install ffmpeg, mplayer, mencoder as well as all dependent software.
yum -y install ffmpeg ffmpeg-devel mplayer mencoder flvtool2

This command will some time to download and install all packages depends on your internet speed.

3 Install FFMPEG-PHP


ffmpeg-php is an extension for PHP that adds an easy to use, object-oriented API for accessing and retrieving information from video and audio files. ffmpeg-devel and php-devel is needed to compile ffmpeg-php from source code. Use following steps to install ffmpeg-php
cd /usr/src
wget http://garr.dl.sourceforge.net/sourceforge/ffmpeg-php/ffmpeg-php-0.6.0.tbz2
tar jxvf ffmpeg-php-0.6.0.tbz2
cd ffmpeg-php-0.6.0
phpize
./configure
make
make install

It will copy the ffmpeg.so module in php default module location. Now you have to edit php.ini file to enable ffmpeg-php support in it by using ffmpeg.so module.
vi /etc/php.ini

and append following line
extension=ffmpeg.so

Restart apache service to take effect of php.ini
/etc/init.d/httpd restart

Run following command to ffmpeg module listing in php.
php -m | grep ffmpeg

Have a nice streaming. :)

Saturday 13 June 2009

Simple steps of changing your exim IP

Hey Remeber : You need to set RDNS for the IP then and then Only you can proceed further.

If you are in the danger of getting your main server IP block by SpamCop because you had a few anoying spamers abusing your server then you could simply change your exim mailserver IP to avoid the effect of your main IP beeing blacklisted…………

Below are some simple steps of changing your exim IP

Inside both incoming and outgoing exim mail server you will need to add an interface :
so just edit

pico /etc/exim_outgoing.conf

and

pico /etc/exim.conf

find
remote_smtp:
driver = smtp

and add interface = ip.you.want.to.use

example as shown below:

________________________
remote_smtp:
driver = smtp
interface = 22.22.22.22
_________________________

IP needs to be on server in order for this to work, hopefully this will help :)
BTW: Just a reminder – If there is an exim update when you upgrade your cpanel server you will need to re-enter the interface again

Important Directories In Linux

* /bin - essential UNIX commands such as ls, etc. Should contain all binaries needed to boot the system or run it in single-user mode…………… * /boot - files used during booting and possibly the kernel itself are stored here

* /dev - contains device files for various devices on system

* /etc - files used by subsystems such as networking, NFS, and mail. Includes tables of disks to mount, processes to run on startup, etc.

* /etc/profile.d - contains scripts that are run by /etc/profile upon login.

* /etc/rc.d - contains a number of shell scripts that are run on bootup at different run levels. There is also typically an rc.inet1 script to set up networking (in Slackwar), an rc.modules script to load modular device drivers, and an rc.local script that can be edited to run commands desired by the administrator, along the lines of autoexec.bat in DOS.

* /etc/rc.d/init.d - contains most of the initialization scripts themselves on an rpm-based system.

* /etc/rc.d/rc*.d - where “*” is a number corresponding to the default run level. Contains files for services to be started and stopped at that run level. On rpm-based systems, these files are symbolic links to the initialization scripts themselves, which are in /etc/rc.d/init.d.

* /etc/skel - directory containing several example or skeleton initialization shells. Often contains subdirectories and files used to populate a new user’s home directory.

* /etc/X11 - configuration files for the X Window system

* /home - home directories of individual users

* /lib - standard shared library files

* /lib/modules - modular device driver files, most with .o extensions

* /mnt - typical mount point for many user-mountable devices such as floppy drives, cd-rom readers, etc. Each device is mounted on a subdirectory of /mnt.

* /proc - virtual file system that provides a number of system statistics

* /root - home directory for root

* /sbin - location of binaries used for system administration, configuration, and monitoring

* /tmp - directory specifically designed for programs and users to store temporary files.

* /usr - directory containing a number of subdirectory with programs, libraries, documentation, etc.

* /usr/bin - contains most user commands. Should not contain binaries necessary for booting the system, which go in /bin. The /bin directory is generally located on the same disk partition as /, which is mounted in read-only mode during the boot process. Other filesystems are only mounted at a later stage during startup, so putting binaries essential for boot here is not a good idea.

* /usr/bin/X11 - most often a symbolic link to /usr/X11R6/bin, which contains executable binaries related to the X Window system

* /usr/doc - location of miscellaneous documentation, and the main location of program documentation files under Slackware

* /usr/include - standard location of include files used in C programs such as stdio.h

* /usr/info - primary location of the GNU info system files

* /usr/lib - standard library files such as libc.a. Searched by the linker when programs are compiled.

* /usr/lib/X11 - X Window system distribution

* /usr/local/bin - yet another place to look for comon executables

* /usr/man - location of manual page files

* /usr/sbin - other commands used by superuser for system administration

* /usr/share - contains subdirectories where many installed programs have configuration, setup and auxiliary files

* /usr/share/doc - location of program documentation files under Mandrake and Red Hat

* /usr/src - location of source programs used to build system. Source code for programs of all types are often unpacked in this directory.

* /usr/src/linux - often a symbolic link to a subdirectory whose name corresponds to the exact version of the Linux kernel that is running. Contains the kernel sources.

* /var - administrative files such as log files, used by various utilities

* /var/log/packages - contains files, each of which has detailed information on an installed package in Slackware. The same file can also be found at /var/adm/packages, since the adm subdirectory is a symbolic link to log. Each package file contains a short description plus a list of all installed files.

* /var/log/scripts - package installation scripts in Slackware are stored here. You can inspect these scripts to see what special features are included in individual packages.

* /var/spool - temporary storage for files being printed, mail that has not yet been picked up, etc.

Not able to access VZPP (Virtuozzo Power Panel) for a VE.

Resolution

Make sure that “offline management” for the VE is enabled:

# grep OFFLINE_MANAGEMENT /etc/sysconfig/vz-scripts/VE_ID.conf
OFFLINE_MANAGEMENT="yes"


If “offline management”  is disabled (set to “no”), you have to enable it:

# vzctl set VE_ID --offline_management yes --save

Wednesday 10 June 2009

Unable login into the domain stats - Plesk

Search for the following entry in the /var/www/vhosts/domainName/conf/httpd.include: (/var/www/vhosts/domainName/conf/httpd.include is actually HTTPD_VHOSTS_D/domainName/conf/httpd.include):

AuthType Basic

AuthName "Domain statistics"

AuthUserFile /var/www/vhosts/domainName/pd/d..httpdocs@plesk-stat

require valid-user

Create the encrypted password using the (htpasswd generator):

http://home.flash.net/cgi-bin/pw.pl

(ex. testUser:sad#^hu78is45tsgf)

OR You can Also generate the encrypted password using the "htpasswd" command:

htpasswd -bdc

(eg. htpasswd -bdc testfile testUser testPass

Adding password for user testabc

# cat testfile

testUser:sad#^hu78is45tsgf

)

Append the obtained entry to the AuthUserFile (Here it is /var/www/vhosts/domainName/pd/d..httpdocs@plesk-stat).

cat >> /var/www/vhosts/domainName/pd/d..httpdocs@plesk-stat

testUser:sad#^hu78is45tsgf

Search for the following entry in the /var/www/vhosts/domainName/conf/httpd.include: (/var/www/vhosts/domainName/conf/httpd.include is actually HTTPD_VHOSTS_D/domainName/conf/httpd.include):
AuthType BasicAuthName "Domain statistics"AuthUserFile /var/www/vhosts/domainName/pd/d..httpdocs@plesk-statrequire valid-user

Create the encrypted password using the (htpasswd generator):http://home.flash.net/cgi-bin/pw.pl(ex. testUser:sad#^hu78is45tsgf)
OR You can Also generate the encrypted password using the "htpasswd" command:htpasswd -bdc(eg. htpasswd -bdc testfile testUser testPassAdding password for user testabc# cat testfiletestUser:sad#^hu78is45tsgf)
Append the obtained entry to the AuthUserFile (Here it is /var/www/vhosts/domainName/pd/d..httpdocs@plesk-stat).cat >> /var/www/vhosts/domainName/pd/d..httpdocs@plesk-stattestUser:sad#^hu78is45tsgf

Changing multiple account ownerships via SSH

How to change the ownership of multiple accounts under /home via SSH? The option in WHM is a bit tedious.

Solution :

To change the ownership of all accounts to the respective user.user :

cd /home
ls -al | grep root

for i in `ls /var/cpanel/users/`; do chown $i:$i /home/$i ; done
for i in `ls /var/cpanel/users/`; do chown -R $i:$i /home/$i/* ; done

Then change the ownership of the individual public_htmls to their respective user.nobody:

for i in `ls /var/cpanel/users/`; do chown $i:nobody /home/$i/public_html ; done

Change the permissions for public_htmls to 750:

for i in `ls /var/cpanel/users/`; do chmod 750 /home/$i/public_html ; done

Fix the permissions for mail to work fine:

/scripts/mailperm

Fix the ownership of /home:

chown root.root /home