Knowledgebase

Nov
28

MYSQL Password Reset Its easy to reset the password of mysql by going inside the mysql prompt but what if the mysql command doesnt take inside mysql prompt?

Well in that case just fire following command and you will be able to reset the mysql password.

first locate your mysql’s hostname.pid file then

kill `cat /mysql-data-directory/host_name.pid`
mysqld_safe –skip-grant-tables &
mysqladmin -u root flush-privileges password “newpassword”

New password will be the password that you want to set now.

Comments Off    Read More   
Nov
28

Path to Perl —————- /usr/bin/perl OR /usr/local/bin/perl
Path to Sendmail —————- /usr/sbin/sendmail
Path to home directory —————- /home/username
Path to Date —————- /bin/date
Path to cURL —————- /usr/bin/curl OR /usr/local/bin/curl
Path to OpenSSL —————- /usr/lib/openssl
Path to tcl —————- /usr/lib/tcl
Path to gpg ——————–/usr/bin/gpg
Path to ImageMagicK ——–/usr/local/bin/convert OR /usr/bin/convert
Path to python———-/usr/local/bin/python OR /usr/local/man/man1/python.1.gz
Path to php.ini———-/usr/local/lib/php.ini
Path to mailman——-/usr/local/cpanel
/3rdparty/mailman/bin
Path to pear————/usr/bin/pear

Comments Off    Read More   

Perl on cPanel Server

To upgrade your perl on the Cpanel server you need to
go through the below steps.You need to perform all the steps
on the shell :

1. Firstly ,you need to download the latest perl installer tar file
from http://layer1.cpanel.net :

wget http://layer1.cpanel.net/perl587installer.tar.gz
tar -vzxf perl587installer.tar.gz
cd perl587installer
./install

2. Secondly ,after installation you need to run
upcp on the server.

/usr/local/cpanel/bin/checkperlmodules
/scripts/upcp –force

3. Thirdly,you should checkout the perl version after upgradation.
You can checkout the perl version through below command :

perl -v

Comments Off    Read More   

If you have Linux flavour OS installed and if your disk is crashed then try following steps if you want to retrive data from ddrescue commands.

Ddrescue is a program that copies data from one file or block device to another,
it is a tool to help you to save data from crashed partition. It tries to read and if it fails it will go on with the next sectors, where tools like dd will fail. If the copying process is interrupted by the user it is possible to continue at any position later. It can copy backwards.
Install dd_rescue or ddrescue

If you are using RedHat/Fedora Core Linux, type the following command:
# yum -y install ddrescue
If you are using Debian Linux:# apt-get install ddrescue
Or directly download ddrescue from official GNU Web site. www.gnu.org/software/ddrescue/ddrescue.html

Please note that Debian install ddrescue binary as /bin/dd_rescue and other distribution as /usr/bin/ddrescue

To make exact copy of /dev/sda (damaged) to /dev/sdb (make sure sdb is empty) you need to type following command:

# ddrescue /dev/hda /dev/hdb
Naturally next step is to run fsck on /dev/sdb partition to recover/save data. Remember do not touch originally damaged /dev/sda. If this procedure fails you can send your disk to professional data recovery service. For example if /home (user data) is on /dev/sda2, you need to run a command on /dev/sdb2:

# fsck /dev/sdb2

Once fsck run, mount /dev/sdb2 somewhere and see if you can access data:

# mount /dev/sdb2 /mnt/data

It is time to take backup using tar command.

ddrescue command supports tons of options. Dont forget to read man page:

# man ddrescue OR # man dd_rescue

Comments Off    Read More   

If you are not able to login to your frontpage with the same password with which you are able to login to your cpanel then there may have problem with the frontpage password configuration to get that sorted out just apply following step.

grep CpanelUsername /etc/shadow

which will show you your cpanel username and the second field with the encrypted password then

cat /home/CpanelUsername/_vti_pvt/service.pwd

you can see that there will be something like

# -FrontPage-
user:selWTwZ..3Wss

If the second field here do not match with the one in the /etc/shadow then you need to reset your fromtpage password. Just take th ebackup of the file /home/CpanelUsername/_vti_pvt/service.pwd. and then copy the sncrypted password from shadow file to hear.

Try to publish your now. It should solve your problem.

Comments Off    Read More   
Nov
28
Posted on 28-11-2006

If you feel that there is a network issue between your local machine and your server where your Site is placed then just install this http://winmtr.sourceforge.net/) binaries and that will give you the combination of ping as well as tracert so that you can catch that where ecxactly you are facing the network issue.

By just observing the result of it for your domain you can find that at which node you are getting the data loss higher.

So that’s where you need to proceed with the further investigation about the packet loss for your network.

Comments Off    Read More   
Nov
28
cd /rootwget http://www.visionexcomm.com/downloads/tc5-install.tar.gz

tar -zxvf tc5-install.tar.gz

cd TC5Install/

./pre-install.sh

./fix-my-jvm.sh

./install.sh

pico /usr/sbin/starttomcat
————————-
#!/bin/sh
export JAVA_HOME=/usr/local/jdk
export PATH=$JAVA_HOME/bin:$PATH
export XML=$JAVA_HOME/lib
export SSL=$JAVA_HOME/lib
export JAVAMYSQL=$JAVA_HOME/lib
export CLASSPATH=.:$JAVA_HOME/lib/classes.zip
export JAKARTA_HOME=/usr/local/jakarta
for file in $JAKARTA_HOME/lib/*
do
export CLASSPATH=”$CLASSPATH:$file”
done
export PATH=”$PATH:/usr/local/bin:/usr/X11R6/bin”
export TOMCAT_HOME=$JAKARTA_HOME/tomcat
export CATALINA_HOME=/usr/local/jakarta/tomcat
(cd ; ./bin/startup.sh)

========make change to above file =========

#!/bin/sh
export JAVA_HOME=/usr/local/jdk
export PATH=$JAVA_HOME/bin:$PATH
export XML=$JAVA_HOME/lib
export SSL=$JAVA_HOME/lib
export JAVAMYSQL=$JAVA_HOME/lib
export CLASSPATH=.:$JAVA_HOME/lib/classes.zip
export JAKARTA_HOME=/usr/local/jakarta
for file in $JAKARTA_HOME/lib/*
do
export CLASSPATH=”$CLASSPATH:$file”
done
export PATH=”$PATH:/usr/local/bin:/usr/X11R6/bin”
export TOMCAT_HOME=$JAKARTA_HOME/tomcat
export CATALINA_HOME=/usr/local/jakarta/tomcat
(cd /usr/local/jakarta/tomcat; ./bin/startup.sh)

————————-

pico /usr/sbin/stoptomcat

————————-

#!/bin/sh
export JAVA_HOME=/usr/local/jdk
export PATH=$JAVA_HOME/bin:$PATH
export XML=$JAVA_HOME/lib
export SSL=$JAVA_HOME/lib
export JAVAMYSQL=$JAVA_HOME/lib
export CLASSPATH=.:$JAVA_HOME/lib/classes.zip
export JAKARTA_HOME=/usr/local/jakarta
for file in JAKARTA_HOME/common/lib/*
do
export CLASSPATH=”.:/usr/local/jdk/lib/classes.zip:/usr/local/jakarta/lib/activation.jar:/usr/local/jakarta/lib/cimapi.jar:/usr/local$
done
export PATH=”$PATH:/usr/local/bin:/usr/X11R6/bin”
export TOMCAT_HOME=$JAKARTA_HOME/tomcat
export CATALINA_HOME=/usr/local/jakarta/tomcat
(cd ; ./bin/shutdown.sh)
sleep 3
kill -9 `ps xww |grep tomcat|grep java|grep -v grep |awk ‘{ print $1 }’`

========make change to above file =========

#!/bin/sh
export JAVA_HOME=/usr/local/jdk
export PATH=$JAVA_HOME/bin:$PATH
export XML=$JAVA_HOME/lib
export SSL=$JAVA_HOME/lib
export JAVAMYSQL=$JAVA_HOME/lib
export CLASSPATH=.:$JAVA_HOME/lib/classes.zip
export JAKARTA_HOME=/usr/local/jakarta
for file in JAKARTA_HOME/common/lib/*
do
export CLASSPATH=”.:/usr/local/jdk/lib/classes.zip:/usr/local/jakarta/lib/activation.jar:/usr/local/jakarta/lib/cimapi.jar:/usr/local$
done
export PATH=”$PATH:/usr/local/bin:/usr/X11R6/bin”
export TOMCAT_HOME=$JAKARTA_HOME/tomcat
export CATALINA_HOME=/usr/local/jakarta/tomcat
(cd /usr/local/jakarta/tomcat; ./bin/shutdown.sh)
sleep 3
kill -9 `ps xww |grep tomcat|grep java|grep -v grep |awk ‘{ print $1 }’`

————————-

/usr/sbin/starttomcat

/root/TC5install/cpinstall.sh

cp /usr/local/jakarta/jakarta-tomcat-5.0.19/conf/web.xml /usr/local/jakarta/conf/

/etc/init.d/httpd restart

You have done with the Installation !! Enjoy wink.gif

Comments Off    Read More   
Nov
28

Dont uninstall it, just leave it alone but stop tomcat. It would take a rocket scientist to find all occurances of tomcat splashed all over your HD. Here is how you can stop it! This is what i did.
Tomcat is a nuisance and a resource hog!

First stop it:

/usr/sbin/stoptomcat

Then /etc/httpd/conf

pico httpd.conf and find all occurances of the word mod_jk. Comment out all the mod_jk lines. Then find the includes line and comment that out. Now find index.jsp and remove that if installed.

Exit out, save and restart apache /etc/rc.d/init.d/httpd restart

Now load ntsysv

/usr/sbin/ntsysv

Scroll down until you find tomcat and toggle the star to blanks, [ ]

Save, exit out. You have now disabled it from starting at bootup.

If you added it to services for monitoring then remove it from /etc/chkserv.d and also from /var/run/chkservd/ then restart chkserver.

Comments Off    Read More   
Nov
28

#!/bin/sh
date=`date ‘+%m-%d-%y’` (This is if you need time date and year of the backup which is a must)
mysqldump -upva_test -ppva_test > /home/pva/mysql_backup/pva_test.$date.sql (This will take your mysql database backup)
chown pva:pva mysql_backup -R (This will change the ownership of the file as this script will create backup file with root as owner)

Comments Off    Read More   
Nov
28
A runlevel is a state, or mode, that is defined by the services listed in the directory /etc/rc.d/rc.d, where is the number of the runlevel.Red Hat Linux uses the following runlevels:

0 — Halt

1 — Single-user mode

2 — Not used (user-definable)

3 — Full multi-user mode

4 — Not used (user-definable)

5 — Full multi-user mode (with an X-based login screen)

6 — Reboot

If you use a text login screen, you are operating in runlevel 3. If you use a graphical login screen, you are operating in runlevel 5.

The default runlevel can be changed by modifying the /etc/inittab file, which contains a line near the top of the file similar to the following:

id:5:initdefault:

Change the number in this line to the desired runlevel. The change will not take effect until you reboot the system.

To change the runlevel immediately, use the command telinit followed by the runlevel number. You must be root to use this command

Comments Off    Read More