Tricks and Tips about Systems/Network

August 10, 2010

pdo_mysql.so: undefined symbol: php_pdo_declare_long_constant

Filed under: Uncategorized — Liju Mathew @ 6:02 pm
Tags:

After the mysql_pdo installation on new Centos 5.5 server, I got the error
pdo_mysql.so: undefined symbol: php_pdo_declare_long_constant” I have done the installation and uninstall pdo_mysql using pecl package but still the error is live.

After googling I found that, PDO library is already installed which bind with php binary. But “pecl” installed uses it’s own pdo build which can able to work with “pdo_mysql” pecl installer. So I need to unbind the pdo from the php binary. I have recompiled the php using “–disable-pdo” and installed the pdo_mysql using pecl.

a quick rebuild of PHP with –disable-pdo and then enabling pdo from PECL instead

That’s all make sense to me.
1. #pecl uninstall PDO
2. #pecl uninstall PDO_MYSQL
3. Recompile php using “–disable-pdo”
4. #pecl install PDO
5. #PHP_PDO_SHARED=1 pecl install PDO_MYSQL
6. [root@rc-021 php-5.2.14]# php -r 'phpinfo();' |grep "pdo"
pdo_mysql

June 21, 2010

Installing FFMPEG on WHM/Cpanel server

Filed under: Uncategorized — Liju Mathew @ 7:01 am

Today, I’ve got a task to install ffmpeg and enable it on php in whm/Cpanel live server. I’m planning to use rpmforge repository to get all ffmpeg packages for yum install.


[root@host.domain.com] installation >> uname -i
x86_64

My OS architecture using 64 bit OS. So I need to use 64bit binary from rpmforge.

#rpm -Uhv http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.x86_64.rpm
#yum clean all
#yum update
#yum install ffmpeg ffmpeg-devel
#yum install mplayer mencoder

while installing flvtool2 which throws me an error,
no ruby package installed on the server and yum will not help to install from Red/centos repository. What I’m doing is I have uploaded the ruby binary from my Centos5.4 repository which kept on locally.

[root@host.domain.com] installation >> ls
./ phpMyAdmin-3.3.2-english.zip* ruby-devel-1.8.5-5.el5_3.7.i386.rpm*
../ ruby-1.8.5-5.el5_3.7.i386.rpm* ruby-libs-1.8.5-5.el5_3.7.i386.rpm*
[root@host.domain.com] installation >> rpm -ivh ruby-libs-1.8.5-5.el5_3.7.i386.rpm
Preparing… ########################################### [100%]
1:ruby-libs ########################################### [100%]
[root@host.domain.com] installation >> rpm -ivh ruby-1.8.5-5.el5_3.7.i386.rpm
Preparing… ########################################### [100%]
1:ruby ########################################### [100%]
[root@host.domain.com] installation >> rpm -ivh ruby-devel-1.8.5-5.el5_3.7.i386.rpm
Preparing… ########################################### [100%]
1:ruby-devel ########################################### [100%]
#yum install flvtool2*
#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 can see that ffmpeg is installed on php cli mode
[root@host.domain.com] ~ >> php -r 'phpinfo();' | grep "ffmpeg"
ffmpeg
ffmpeg-php version => 0.6.0-svn
ffmpeg-php built on => Jun 19 2010 14:41:11
ffmpeg-php gd support => enabled
ffmpeg libavcodec version => Lavc52.20.1
ffmpeg libavformat version => Lavf52.31.0
ffmpeg swscaler version => SwS0.7.1
ffmpeg.allow_persistent => 0 => 0
ffmpeg.show_warnings => 0 => 0
[root@host.sportu.com] ~ >>

The second issue I’m facing is, I can’t find any “php.ini” which is using on server level. Lastly I found there is any php.ini placed under ‘/etc’ directory and I found one php.ini file is placed under ‘/usr/lib/php.ini“. I just add the ffmpeg extension information on that file and linked it to “/etc/php.ini”. After restarting the Webserver it’s showing the extension correctly on the browser.

[root@host.domain.com] ffmpeg-php-0.6.0 >> ln -s /usr/local/lib/php.ini /etc/php .ini
root@host.domain.com] ffmpeg-php-0.6.0 >> /usr/local/apache/bin/apachectl restart

-Njoy

February 20, 2010

Check the run level currently running on Linux

Filed under: Uncategorized — Liju Mathew @ 9:38 am

[root@rc-040 installation]# who -r
run-level 5 2010-02-19 22:12 last=3

May 25, 2008

RHCE Notes

Filed under: Uncategorized — Liju Mathew @ 2:59 pm

###########   Yum    ####################

Red Hat Package Manager(RPM):
—————————–
To install an rpm package, issue
#rpm -i <package.rpm>

To erase an rpm, issue
#rpm -e <package_name>

#rpm -i ypserv-2.19-3.i386.rpm
This will install the ypserv utility on to your machine!

If we want to delete the ypserv package, we need to issue only the package name.
#rpm -e ypserv

To query all the installed packages on our system, issue
#rpm -qa

#rpm -q ypserv
This will query for the package ypserv. If its not installed, then “package ypserv not installed”
message will be shown.

#rpm -qa | grep yp
This would list all those packages in our system which has the string “yp” in their package name.

To know the files inside a package and the installation paths of those files prior to installation of that package, issue
#rpm -qpl <package.rpm>

To know the locations of files of a currently installed package, issue
#rpm -ql <package.rpm>

To know the package of a file
#rpm -qf /etc/passwd
This will show us the package from which /etc/passwd has come!

Dependancy Resolution with YUM:
——————————-
YellowDog Updater, Modified!

Make a file with .repo extenstion inside /etc/yum.repos.d/

#vim /etc/yum.repos.d/myyum.repo
[RHEL5]
name=RHEL 5.0 Yum FTP Repo!
baseurl=ftp://172.24.254.254/pub/Server
gpgcheck=0

[RHEL5-DVD]
name=RHEL 5.0 Yum Local Repo on DVD
baseurl=file:///mnt/Server
gpgcheck=0
enabled=0
Note: The RHEL 5.0 DVD should be mounted under /mnt!
################### LVM  Notes ##################

RHCE Classess  On 18-03-2007

1, Making the partion effectivelt

#parprob

1 LVM ( Logical Volu manager)

a, Create a Physical  volume
b, Creating a Volume Group
c, Creating a Logical Volume

A,

1,Creating a Physical Volume
#pvcreate /dev/hda6
2, Displying the Physical Volume
#pvdisplay
3, Showing status
#pvs
P.E physical extened

B, Createing a Volume Group

1, vgcreate <VolumeGroup>  <Physical volume>
Eg:vgcreate LIJU /dev/hda6
2, Listing Volumegroup
eg: vgdisplay
3, Listing status
#vgs

C, Creating Logical Volume

1. #lvcreate  -L <size>  -n <lvmname> <volume group>
Eg: lvcreate -L 1000M  -n lvm1  LIJU
2, Listing LV
#lvdisplay
3,Displaying status
#lvs

4, Increasing /Extending  Logical Volume
#lvextend  -L +500M  <dev/VG> <lvname>
5, Make effect changes  after the lv extendension
#resize2fs /dev/Liju
#resize2fs </device/VG>

########### Labeling  a partion #######################

#e2label <partion name>  <label name>
eg: #e2label  /dev/hda6  data

# Formating a filesystem
Eg: mkfs.ext3 /dev/hada6

Mounting a partion using a fstab

<label name>     <mount point>   <file system>     defaults  <disdump enable/0/1>   <Fsck priority>

backups         /backups           ext3            defaults   0            0

############################# 18-03-2007 #####################

Sample procedure for creae a LVM

#pvcreate /dev/hda6
#vgcreate Databases /dev/hda6
#lvcreate -L 1000M -name mysql Databases
#mkfs.ext3 /dev/Databases/mysql
#mkdir /mnt/mysql
#mount /dev/Databases/mysql /mnt/mysql
#lvextend -L +200M /dev/Databases/mysql
#resize2fs  /dev/Databases/mysql

##################

Creating Volume Gruop entendnce during pv creation
#vgcreate -s 32M /dev/hda5

Lvm createion = pv ->vg->lv->mkfs->mount

############# Removing LVM #############################

Disabling/hiding lv
#lvchage -an /dev/Databases/mysql
active no -an

ebabling lv
#lvchage -ay /dev/Databases/mysql

Removing lv
#lvremove /Dev/Databass/mysql

######  Disabling VG  #######

Deactivating Vlulume group
#vgchange  -an  /dev/Databases

Activating a vlume group
#vgchnage -ay /dev/Databases

Removing vg
#vgremove /Dev/Databases

##### PV #########
Removing  PV
#pvremove /devhada5
#

######## Etending a volume group  ########
vgextend  /dev/hda7 Databases

Questions
1, Create a VG group name nascent
2, PE size =32MB
3, Lv name = rhce (320MB)
4, Mount point = /LVM
5, Resize LVM by 100MB without dataloss .A value in beteeen 415 amd 425 is accepted

Create partion
pvcreate /dev/hda1
vgcreate -s 32 nascent /dev/hada5
lvcreate -L 320M  -n rhce nascent
mkdir /LVM
mkfs.ext3 /dev/nascent/rhce
mount /dev/nascent /LVM
Df- h /LVM

Extemded the lv bye 415MB

lvmextend -L 415M /dev/nascent/rhce
resizetofs  /dev/nascent/rhce

Resize /?LVM by 100Mb with out data loss.A value betteen 310 and 330 is acepted

umount /LVM
e2fsck -f /dev/nacesnt/rhce
resize2fs /dev/nasent/rhce 130M
lvreduce -L 312MB  /dev/nacent/rhce

mount /dev/nasent/rhce /LVM
df- h

################################### GRUB 24/03/2008 ###########################

Find the label
#findfs LABEL =Linux
#E2labl /dev/hda1

#grub

1, root (hd0,1)  — user tab control after the hd will list the avail disj in the sytem
root (hd0,0)
kernel  /vmlinyx ro root=/dev/hda2
initrd /initrd.img
boot
### Coomad for copy and paster using editot
For copy use ‘yy”
For paste use “d’
###################  NFS  ################

Related services
nfs 2049
portmap 111
1, vi /etc/exports
/backups  172.24.254.5(rw,sync) 17.168.0.2(sync)
/backups  172.24.254.5(rw,sync) 17.168.0.2(sync,no_root_squash)  # no_root_squash keeps the ownership of the files
2, mkdir /backups $$chmod 775
3, /etc/init.d/nfs restart
/etc/init.d/nfs restart
4,verifying it is properly configured
#showmount -e localhost

on client system

#showmount -e  server1
# mount 72.24.254.5:/backups /mnt
How to set this mount permanently on each system boot up
vi /etc.fsttab
172.24.254.5://backup  /mnt/new  nfs  defaults 0   0 0

################    NTP Server:  #################
———–
In the production environment, its very necessary to have a unified time for all the machines for effective logging and monitoring. As hardware time is not reliable, we could make use of a network time source with which all the client machines synchronizes their time on a scheduled basis.

NTP server configuration:
————————-
NTP Server listens on UDP port 123
configuration file: /etc/ntp.conf
Note: By default, ntp server doesnt allow anyone to fetch time from it.
So if we want to make some machines to fetch time from our NTP server we need to expicitly allow them in the main ntp configuration file.

#vim /etc/ntp.conf
restrict 172.24.25.25 mask 255.255.255.255 nomodify notrap
–OR–
restrict 172.24.25.25 nomodify notrap

To service time requests from 172.24. network with default subnet mask,
restrict 172.24.0.0 mask 255.255.0.0 nomodify notrap

#/etc/init.d/ntpd start
#chkconfig ntpd on

NTP Client Configuration:
————————-
We are told that we have an NTP server located at the ip 172.24.254.254. We want to synchronize our local time with that available in the NTP server on every boots.

#vim /etc/ntp.conf
At the bottom of the file enter,
server 172.24.254.254

#vim /etc/ntp/step-tickers
172.24.254.254
Note: Only enter the NTP server’s address.

Now we need to stop the NTP daemon if it is running,
#/etc/init.d/ntpd stop

#ntpdate -u 172.24.254.254
#ntpdate -u 172.24.254.254
#ntpdate -u 172.24.254.254
Note: Issue the ntpdate command thrice for accurate synchronization

#chkconfig ntpd on
###################### FTP server ############

FTP:
conf file: /etc/vsftpd/vsftpd.conf
Unlike SSH we are having two files to allow/deny users via FTP ( in SSH we did it in the main configuration file itself by AllowUsers/DenyUsers)
The main file for denial is /etc/vsftpd/ftpusers
The other file is /etc/vsftpd/user_list
But if we need to make our FTP check user_list file we need to say it in the main configuration file, like
userlist_enable=YES

If, userlist_enable=NO, ftp doesnt check user_list file

The behaviour of user_list depends upon the declaration inside the vsftpd.conf file

if its declared like,
userlist_deny=YES , those usernames inside user_list is denied even without prompting for a password
if its declared like,
userlist_deny=NO, those in user_list are ONLY allowed to login.

Whatever the behaviour of user_list, FTP searches for ftpusers file for users that are DENIED!

############## File Access Control List #################

File Access Control Lists:
————————–

#setfacl -m u:rajesh:— /myfile.txt
This would deny all permissions on /myfile.txt to user rajesh!

#setfacl -x u:rajesh /myfile.txt
This would remove user rajesh from the access control list of file /myfile.txt

#getfacl /myfile.txt
This would display the access control list information of the file /myfile.txt

#setfacl -m g:mygrp:rw /myfile.txt
This would give all the members of the group mygrp; read and write access to the file /myfile.txt

Blog at WordPress.com.