Archive for December 21st, 2011

Simple php script to check database connection

To check the database connection script you can use following code under your domain <?php mysql_connect(“localhost”, “admin”, “1admin”) or die(mysql_error()); echo “Connected to MySQL<br />”; mysql_select_db(“test”) or die(mysql_error()); echo “Connected to Database”; ?> After browsing the database connection script you will see following content if database connect to your server. Connected to MySQL Connected to […]

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 […]

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 —– […]

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 […]

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 […]

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 […]