How to Reset MySQL root Password
To provide multi user access to number of databases a relation database management system is been developed that runs on a server and called as MySQL. MySQL is developed under GNU General Public License and its source code is available under its defined terms. MySQL is a popular choice of database for use in web applications and it performs really well with cPanel hosting accounts to store data of any websites. And suppose if you have forget the MySQL root password and you are not able to access your mysql service then you need to reset the password of MySQL root user by using following steps which are as follows,
Steps to Reset MySQL root Password :
1)root@server [~]/etc/init.d/mysqld stop
2)Start to MySQL server without password:
root@server [~]mysqld_safe –skip-grant-tables &
3) root@server [~] mysql
After that you can get the mysql prompt then run the following command
4)mysql >use mysql;
5)mysql >update user set password=PASSWORD(“NEWPASSWORD”) where User=’root’;
6)mysql > quit
7)root@server [~]/etc/init.d/mysqld stoproot@server [~]/etc/init.d/mysqld start
Now you can access your mysql service by using
[root@server ~]#mysql -u root -p
How to find out Reseller name with domains
Reseller is a good way to earn unlimited benefits online and if you want to list all cPanel hosting accounts under a specific reseller, then you can use the below simple shell script.
1) Crete the file reseller.sh and add the following code.
vi /home/reseller.sh
#!/bin/bash
usage()
{
echo “Example : $0 domain.com or username”
exit 1
}
test $1 || usage
USERN=$(grep $1 “/etc/userdomains” | awk ‘{print $NF}’ | awk ‘NR==1′)
if [[ -z $USERN ]]
then
echo -e “\e[1;33m $1 is not a reseller \e[0m"
exit 1
fi
OWNER=`cut -d: -f1 /var/cpanel/resellers | grep -o $USERN`
exitstatus=$?
if [ "$exitstatus" == 0 ] ; then
echo “”
echo -e “\e[1;31m Below are the accounts associated with the reseller $name \e[0m"
echo ""
output=$(for i in `grep $OWNER /var/cpanel/users/* -l` ; do grep USER= $i ; done | awk -F"=" '{ print $2 }')
echo -e "\e[1;33m $output \e[0m"
else
echo -e "\e[1;35m $1 is not a Reseller \e[0m"
exit
2) chmod 755 /home/reseller.sh
3) cd /home/
4)root@server[#] ./reseller resellerusername
or
root@server[#] ./reseller resellerdomain.com
After executing the script you will get the below output as ::
root@server[#] ./reseller yourdomainname.com
Below are the accounts associated with the reseller
Jason
Billy
Mike
or
root@server[#] ./reseller newtest
newtest is not a reseller.
How to change mail server ip address in PLESK
Windows hosting servers are best to host website and it supports different Microsoft technologies and due to different activities on hosting resources in server if primary mail server ip address is blocked in any spam checker sites ( eg BARRACUDA,SORBS-SPAM etc) then there is only one solution, that is change the mail server ip address on the server.
You can easily change the mail server ip address in cpanel by using /etc/mailips file. The same as in PLESK you can also change the outgoing mail server ip address by using “/var/qmail/control/smtproutes”file.
Steps to change the mail server ip address in PLESK :
1) First check the domain name which is hosted on the Windows hosting server by using following file
cat/var/qmail/control/rcpthosts
domain1.com
domain2.com
domain3.com
domain4.com
domain5.com
2) By default the “/var/qmail/control/smtproutes” file is not present on PLESK server, you need to create it.
vi /var/qmail/control/smtproutes
3) Then add the new ip address in the following format.
domain1.com:192.168.x.2
domain2.com:192.168.x.2
4) Save the file and restart qmail
/etc/init.d/qmail restart
Note: Please replace the “192.168.x.2” to original ip address and the “yourdomain.com” equal the original domain name.
PHP code to set expiration for index page
PHP language is an open source web scripting language which is included within HTML tags to implement any logic. And Due to popularity of PHP language many web hosting providers have started deploying PHP hosting servers which are actually called cPanel hosting servers to host a PHP website with MySQL to support database of a website. But because of some reason if you want to make any changes in your site so you can set the expiration to your site means after some date or year your site shows custom error on the page then you can add following code in index page below the “<?php” code and set the date as per your request.
$exp_date = “2012-04-31″;
$todays_date = date(“Y-m-d”);
$today = strtotime($todays_date);
$expiration_date = strtotime($exp_date);
if ($expiration_date <= $today)
{
echo ‘<!DOCTYPE HTML PUBLIC “-//IETF//DTD HTML 2.0//EN”>
<html>
<head>
<title>Expired…</title>
</head>
<body>
<h1>What you search</h1>
<p>Now Site is Expired </p>
<hr>
<address>I have set the expiration to my site ,we need to increase expiration date in index page</address>
</body>
</html>
exit;
}
This is really simple which yu have to include in your index page to get the thing done at correct date but you need a quality web host to host your mission critical web site and Bodhost UK web hosting service provider is best from last decade for deploying quality server with up time guarantee and online security.
How to set custom 404 page in joomla
Joomla is a CMS which is an easy to use content management system that is developed in PHP to keeps track of every piece of content on your Web site. It Also supports features which enables you to build Web sites and powerful online applications. Joomla is an open source solution that is freely available to everyone and developed in PHP scripting language with MySQL database support. A major advantage of using Joomla as a CMS is that it requires almost no technical skill or knowledge to manage. Joomla is a free and open source content management system (CMS) for publishing content on the World Wide Web and intranets and a model–view–controller (MVC) Web application framework that can also be used independently. It is a platform which uses cPanel hosting server to host sites developed in Joomla.
Now lets see how to create 404.shtml file under the document root then open the error.php file
vi /home/username/public_html/templates/system/error.php
then add the following code below the line “defined( ‘_JEXEC’ ) or die( ‘Restricted access’ );”
if (($this->error->code) == ’404′) {
echo file_get_contents(‘http://www.domain.com/404.shtml’);
}
else
{
And then add the following code at the end of error.php file
<?php
}
?>
Joomla is really a good platform that many small and large online businesses are using Joomla to create thier website. Bodhost UK web hosting providers are deploying reliable and affordable Joomla servers from last decade with quality hardware and tech support.
Script to create hosting packages on cPanel hosting server
Web hosting has different platforms and from these platforms one can host his business online or can earn through it. Reseller hosting is a kind of hosting type which allows an individual to resell hosting packages under his own price tag and brand name to run a web hosting company under his own name. But sometimes if you want to migrate more accounts from one server to another server then you need to create packages for each accounts and you can easily create packages by using this script.
1) First you need to create one Migarting-Accounts.txt file and add the the user name , which you want to create packages.
2) Create Migration directory for to move all the cPmove files from /home directory to Migration directory.
then use following command to create cpmove packages and moved to “Migration” directory.
for i in `cat /home/Migarting-Accounts.txt`;do /scripts/pkgacct $i; mv /home/cpmove-$i.tar.gz /home/Migration/;done
or Use this script for migrating Reseller and/or Bulk accounts between cPanel hosting servers::
For Reseller::
cat /etc/trueuserowners | grep username | awk ‘{print “/scripts/pkgacct “$1}’
OR
1. cat /etc/trueuserowners | awk ‘{print $1}’ > 1.txt
then remove the sign “:” from 1.txt
for i in `cat 1.txt`;do /scripts/pkgacct $i; mv /home/cpmove-$i.tar.gz /home/Migration/;done
Then move the “Migration” folder and 1.txt file to remote server and by using following command restore all the accounts.
for i in `cat 1.txt`;do /scripts/restorepkg $i;done
To migrate you server you need a quality technical support from your hosting provider and Bodhost UK web hosting provider is deploying quality hosting services from last decade with reliability, quality hardware and tech savvy support people to solve any problem.
WordPress ask for ftp login details when upgrade
WordPress is counted as the best blogging platform and it is an open source technology developed in PHP with MySQL database support to store the databases in form of tables. A community of programmers are work together to develop WordPress with some new updates making it so unique among all other available CMS. To host a WordPress blog you need a realizable and secure cPanel hosting package to host and run secure blog or website online. WordPress allows you to make changes in code to develop website or blog. But sometimes WordPress ask ftp login details when upgrade ?
The problem is when you have try to upgrade your wordpress blog or plugins then wordpress ask the ftp login details, you enter the correct ftp login details but it still not updated. The Solution over this thing is, you are facing this problem because your domain is hosted on non-suexec server. There are 2 solution for this issue
First You need to migrate your account to suexec enable server
or
Set the ownership nobody.nobody to all wordpress related files. But is unsecured for your account. Your account is easily hacked due the nobody.nobody ownership.
How to Copy outgoing emails from server to another email
How to copy the outgoing messages from the server to another email address ?
If you want copy all the emails sent to anything@yourdomain.com to your testing@gmail.com email address then you can do so by using the following steps
1) Enable the System Filter File in exim configuration by using cPanel hosting account.
Main >> Service Configuration >> Exim Configuration Editor
System Filter File = /etc/cpanel_exim_system_filter
OR You can also use:
vi /etc/exim.conf
system_filter=/etc/cpanel_exim_system_filter
2) vi/etc/cpanel_exim_system_filter
Then add the following code at the bottom of the file
if $ header_from:contains “@yourdomain.com”
then
unseen deliver”testing@gmail.com”
endif
Save the file
3) Then restart the exim service
/etc/init.d/exim restart
How to remove Strange characters ’ and  in WordPress posts
WordPress is an open source web software also called as CMS which is developed and designed in PHP with MySQL database support which can be used to create a beautiful website or blog. The core of WordPress is built by hundreds of community volunteers. It supports thousands of plugins and themes available to transform your site into almost anything you can imagine. WordPress is easy to customize and you can design a blog according to your need. Due to community of different members upgrade is a common thing in WordPress and sometimes after a WordPress upgrade we started (start) to get all kinds of weird symbols in our posts, including  and ’. It is not a big problem just a character encoding mismatch problem.
The Solution over this is as follows:
You just have to comment out two lines in your wp-config.php file which is found in your main blog directory.
These lines areas follows:
define(‘DB_CHARSET’, ‘utf8?);
define(‘DB_COLLATE’, ”);
Comment them out like this:
//define(‘DB_CHARSET’, ‘utf8?);
//define(‘DB_COLLATE’, ”);
Character encoding mismatch problem is fixed now. WordPress can be used by many online organizations and bloggers to create interactive website or blog. cPanel hosting works best to host a WordPress site with all user requirements according to his business (by a user according to his business requirements). Bodhost UK web hosting service provider has affordable and reliable hosting packages to host any website to deploy secure services online.
How To Enable Mod_rewrite Module ?
Based on a regular-expression of a parser the mod-Rewrite module uses a rule-based rewriting engine which is used to rewrite the requested URLs at server level. A rewrite engine is a software that modifies a web URL’s appearance (URL rewriting). Rewritten URLs (sometimes known as short, fancy URLs, or search engine friendly – SEF) are used to provide shorter and more relevant looking links to web pages. It is also designed to support unlimited number of protocols (rules) and an unlimited number of attached rule conditions for each rule, to provide a really flexible and powerful URL manipulation mechanism. In order to enable Mod_Rewrite for your site you should create a text file called .htacccess in root directory where you wish the rewrite rules to apply.
Lets see How to enable Mod-Rewrite Module and The first line of this text file should be:
RewriteEngine On
After that you can place your rewrite rules. Here are some examples for Joomla’s SEF option:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$ [NC]
RewriteRule ^(content/|component/) index.php
Some applications already have ready to use rewrite rules that can be found in a file called htaccess.txt. But if you have problems with mod_rewrite, you may ask your web host for assistance or raise a ticket. Tech people working at Bodhost UK web hosting service provider have enough knowledge to solve any query in a short time and with expected results.






















