MyTrueHost launched Web Hosting for Indian clients just in Rs 60/Month with various payment options(netbanking, debit card, credit card,cash card or paypal).
Please Visit at https://www.mytruehost.in

How to repair mysql database table manually?

You can repair the database table manually from shell by using following command.

root@admin[~]mysql>mysql –u databaseusername –p databasename

For example if we are using database gunjan_db

root@admin[~]mysql

mysql> use gunjan_db;
Database changed

mysql> show tables;

+———————————————+
| Tables_in_gunjan_db              |
+———————————————+
| additional_images
| address_book
| address_format
| administrators
| banners
| banners_history
| cache
| categories
| categories_description
| configuration
| configuration_group

| counter

| orders_products
| orders_products_attributes
| orders_products_download
| c
| orders_status_history
| orders_total

For example we need to repair table orders_status

mysql> repair table orders_status;
+————————————+——–+———-+———-+
| Table                              | Op     | Msg_type | Msg_text |
+————————————+——–+———-+———-+
| gunjan_db.orders_status | repair | status   | OK       |
+————————————+——–+———-+———-+
1 row in set (0.11 sec)

mysql> q
Bye

 

phpmyadmin error “Cannot start session without errors”

“cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly.”

To resolve above error you need to change the values in/usr/local/cpanel/3rdparty/etc/phpmyadmin/php.ini file.

root@admin[~]#pico /usr/local/cpanel/3rdparty/etc/phpmyadmin/php.ini
And than change the following values in php.ini file

FROM:
—–
session.save_handler = sqlite
session.save_path =/var/cpanel/userhomes/cpanelphpmyadmin/sessions/phpsess.sdb
—–

TO
—–
session.save_handler = files
session.save_path = /tmp
Note : To make change the values in php.ini you need to login into as root user.

Also check permissions of /tmp. It should be 755. Change it to 1777.

 


How to check mysql servers set values?

Most of the time we need to check the mysql value set on server and most of the techs checks /etc/my.cnf file.If you want to check all values set in mysql on server. We can use following simple command.

mysqld –no-defaults –verbose –help

 

Database sizes shows zero in cPanel

Once we upgrade from cPanel 11.24 to 11.25 version. We are receiving lots bug. One of them is database size showing zero in cPanel. To resolve this issue you have to edit following file /var/cpanel/cpanel.config

root@support[~]vi /var/cpanel/cpanel.config

Search line “disk_usage_include_sqldbs” in file “ /var/cpanel/cpanel.config and change it

From

 

disk_usage_include_sqldbs=0

to

disk_usage_include_sqldbs=1

And run script

-/scripts/update_db_cache

 

“unauthenticated user” problem in mysql logs

While running following command.

mysqladmin -i3 pr

We are getting result.

056 | unauthenticated user | localhost |    | Connect |      | Reading from net |

To avoid such problem add following lines in /etc/my.cnf file to avoid access for unauthenticated user.

root@server [~]# pico /etc/my.cnf

skip-networking
skip-name-resolve
skip-host-cache
skip-locking

Now restart the mysql service and check mysql process logs again.

 

How to check SUID/SGID programs on your Server?

You can check SUID/SGID programs on your systemSUID/SGID programs on your Server by using following command from your shell.

admin@root# find / -type f \( -perm -04000 -o -perm -02000 \)

 

How to install zend optimizer?

Install zend optimizer by using following steps.

wget http://downloads.zend.com/optimizer/3.0.1/ZendOptimizer-3.0.1-linux-glibc21-i386.tar.gz   or wget http://66.45.230.130/sources/ZendOptimizer-3.0.1-linux-glibc21-i386.tar.gz

cd ZendOptimizer-3.0.1

./install.sh

Follow the instructions on the screen you will receive after ./install.sh

Restart the Apache service

To check zend optimizer run

php  -v

 

Install mod proxy

First login into your server with the root login details

cd /home/cpapachebuild/buildapache/apache_1.3.31/src/modules/proxy/

or

cd /home/cpeasyapache/src/httpd-2.0.63/modules/proxy

Then run command:

/usr/local/apache/bin/apxs -i -c *.c

Add the following module to the httpd.conf to load proxy module with the httpd configuration file:

LoadModule proxy_module libexec/mod_proxy.so

And then restart the Apache service:
service httpd restart
or
/etc/init.d/httpd restart

You can check proxy installed or not on your server by using following command.

/usr/local/apache/bin/httpd -l | grep proxy

 

How to install shoutcast

Basically most of the people don’t like to run shoutcast as root as that can be really harmful due to that its better if we create shoutcast user and then run shoutcast on server.
Following are the basic steps to install shoutcast on server

1.) Login to root

2.) adduser shoutcast

3.) passwd shoutcast

Once you add user “shoutcast” login as the new user “shoutcast”.

Lets wget shoutcast from the shoutcast.com provider

wget ftp://ftp.skynet.be/mirror1/tucows.skynet.be/linux/files/shoutcast-1-9-2-linux-glibc6.tar.gz

The extract shoutcast:

tar -zxvf shoutcast-1-9-2-linux-glibc6.tar.gz

rm -rf shoutcast-1-9-2-linux-glibc6.tar.gz
mv shoutcast-1-9-2-linux-glibc6 shoutcast
cd shoutcast

Now you can configure shoutcast?

You need to edit the shoutcast configuration.

pico sc_serv.conf
or
nano sc_serv.conf

MaxUser
Password
PortBase

uncomment AdminPassword and set an admin password as per your requirement.

Now you can save and start shoutcast and it will work perfectly for you without any problem.

to save crtl+x

Steps to start shoutcast

./sc_serv sc_serv.conf

 

Step by step instructions to install VNC

Refer following step by step instructions to install VNC
1) As root user fire the commands

yum install vnc-server xorg-x11-xauth xorg-x11 twm xterm

2) if yum is not working, download the rpm using “wget http://mirror.pacific.net.au/linux/CentOS/4.2/os/i386/CentOS/RPMS/vnc-server-4.0-8.1.i386.rpm”
2.1) install vncserver by the command “rpm -Uvh vnc-server-4.0-8.1.i386.rpm”

3) start vncserver by “vncserver :0“. You will be asked for password, set the password you require.

4) try to vnc into your Linux box from Windows to your Linux box using server_ip:5900 eg. 192.168.0.21:5900
4.1) if it doesn’t work, bring down your firewall by doing “service iptables stop” and vnc from your Windows again.

5) you can stop the vncserver by using command “vncserver -kill :0”

6) remember to bring your firewall back up “service iptables start”

7) you might want to have gnome, kde running.. in that case look into your ~/.vnc/xstartup file, uncomment two lines (# unset SESSION_MANAGER and # exec /etc/X11/xinit/xinitrc)

8) If gnome is not install, Install Gnome using “yum install gnome-* ” and set the server to use gnome desktop using “switchdesk gnome” and restart VNC.

9) you might want to start vncserver when the system reboots, use “chkconfig –level 345 vncserver on”

10) You can change the VNC server password using “vncpasswd”

Note : If getting error while starting VNC
——
[root@202 conf]# vncserver :0
vncserver: couldn’t find “xauth” on your PATH.
——
do:
check if xauth is installed

which xauth
yum install xorg-x11-xauth
yum install xorg-x11
yum install twm
yum install xterm