Tuesday, January 26, 2010

How to change collation for all the tables of mysql database

Use following PHP script to change the collation of all the tables of mysql database

$db = mysql_connect('localhost','Database_sername','Database_password');
if(!$db) echo "Cannot connect to the database - incorrect details";
mysql_select_db('Database_name'); $result=mysql_query('show tables');
while($tables = mysql_fetch_array($result)) {
foreach ($tables as $key => $value) {
mysql_query("ALTER TABLE $value COLLATE utf8_general_ci");
}}
echo "The collation of your database has been successfully changed!";
?>


Please make necessary changes in the script.

Friday, January 22, 2010

Crontab – Quick Reference

Cron is a time-based job scheduler in linux/Unix based system. It is also same as scheduler in windows. Cron enables users to schedule jobs (commands or shell scripts) to run automatically at a certain time or date. It is commonly used to automate system maintenance or administration, though its general purpose nature means that it can be used for other purposes, such as connecting to the Internet and downloading email.

Crontab file
Crontab syntax :
A crontab file has five fields for specifying day , date and time followed by the command to be run at that interval.
*     *     *   *    *        command to be executed
-     -     -   -    -
|     |     |   |    |
|     |     |   |    +----- day of week (0 - 6) (Sunday=0)
|     |     |   +------- month (1 - 12)
|     |     +--------- day of        month (1 - 31)
|     +----------- hour (0 - 23)
+------------- min (0 - 59)

Normally on cPanel server, you can easily set cron. Just login to cpanel and click on cron jobs. You will have graphical interface to set cron job.



Wednesday, January 20, 2010

How to reset Cubecart admin password?

*If your store is 4.3.0 or higher please follow this guide and make sure the 'salt' database column has no value*

If you have forgotten your admin password and for some reason you cannot get the "Reset Password" function to work please follow this process:

IMPORTANT: Our support staff have no record of your admin username or password and it is impossible for them to retrieve it for you. The following steps are the only way this can be achieved.

1. Access your CubeCart database using a tool such as phpMyAdmin. phpMyAdmin can normally be found within your web hosting control panel or you can download it from http://www.phpmyadmin.net to setup.

2. Browse to the table CubeCart_admin_users. It should contain the list of administrator accounts to access the admin interface of your store.

3. Click the pen icon to edit the admin account that you wish to change the password for.

4. There should be a current value that looks like random numbers and letters about 32 characters in length. Enter your new password here and using the drop down menu under function select the value "MD5". That will convert your password into a safe one way encoded "hash".





Click "Go" to save changes.

5. Logout of phpMyAdmin and you should now be able to login with the new password.

 

Tuesday, January 12, 2010

VirtueMart is loading site slow after changing domain name

It’s easy for Joomla itself (at its global config within online admin interface) but tricky for embedded virtuemart. Annoying thing is, after the domain name change you can not access config page online via admin interface.
Here is the file you have to make the changes to make virtuemart work after domain name change: (Remember you have to know what your folder your Joomla points to)

/administrator/components/com_virtuemart/virtuemart.cfg.php:
// these path and url definitions here are based on the Joomla! Configuration
define( ‘URL’, ‘http://newdomain.com/’ );
define( ‘SECUREURL’, ‘http://newdomain.com/’ );

After that all is set with your embedded virtuemart.

Thursday, January 7, 2010

Fantastico is not installed at the default location

When you are getting following error while trying to access fantastico.

Fantastico is not installed at the default location
/usr/local/cpanel/3rdparty/fantastico. Either move the Fantastico directory
from it's current location to /usr/local/cpanel/3rdparty/fantastico OR
enable ioncube loaders in WHM -> Tweak settings.
Try following solutions:

cp /usr/local/cpanel/3rdparty/etc/php.ini /var/cpanel/3rdparty/etc

Other Possible Fixes

You may want to first try enabling ioncube in WHM->Tweak Settings

Second you may want to try to update fantastico with  
cd /usr/local/cpanel/whostmgr/docroot/cgi/fantastico/scripts/ ; /usr/local/cpanel/3rdparty/bin/php cron.php

Third you may want to rebuild cpanel's php with /scripts/makecpphp

Fourth you may want to try a cpanel update with /scripts/upcp --force

Monday, January 4, 2010

How to remove Reported Attack Site!

Go to this page http://sb.google.com/safebrowsing/report_error/

Submit the details to google then check back your website in one hour.


I would advice to download all the files of your website then remove phishing code from the website pages then reupload them again. After uploading clean files, go to above URL and submit it.

Old email accounts can not deleted after changing domain name in cpanel

Sometimes it happens that you change the main domain name i.e olddomain.com to newdomain.com but after changing domain name, it does not delete email accounts from cpanel >> email acocunts.

It happens when you restore account from the cpanel backup file then you change domain name.

Use following tricks to resolve this issue.

1- check if the email account folder exists as /home/user/mail/olddomain.com/xxx. If so then just remove the fodler olddomain.com
2- check if there is folder /home/etc/olddomain.com and if so remove it.
3- Logout of cPanel, backup the files 'email_accounts.yaml' and empty 'email_accounts.cache' in /home/user/.cpanel/ and try to log in to cPanel again.