Showing posts with label cPanel Hosting. Show all posts
Showing posts with label cPanel Hosting. Show all posts

Setting or Changing MYSQL Root Password

2 comments

Setting/changing MYSQL root Password
Setting up mysql database password is one of the important tasks which a webmaster should take care of. If you have never set a root password for MySQL, then
server does not require a password at all for connecting as root and if you have already set password for your database and for some reason if you want to change it then you can do so using following commands.
To setup root password for
MySQL databases for first time you need to login to your server as root and will have to use mysqladmin command at shell prompt as follows:

$ mysqladmin -u root password “mysql_password“


However, if you want to change/update your root password, then you will have to use following command



$ mysqladmin -u root -p oldpassword newpassword


after you fire above command you will have to provide password for your MySQL database.

How to add a range of IPs on a BSD box.

1 comments

FreeBSD is a popular free Unix like open source operating system that is based on the Berkeley Software Distribution (BSD) version of the Unix operating system. FreeBSD runs only on the Intel PC platform (i386 and higher) having atleast Pentium processor and also on amd64, Alpha/AXP, IA-64, PC-98 and UltraSPARC processors. You can consider FreeBSD as an alternative to Linux which will run Linux applications. Its said that its fast, stable, and is appropriate for Internet server or as a file server. FreeBSD supports all major X Window desktops, such as KDE and GNOME.



If you want to add Dedicated IPs on server having FreeBSD you need to follow following instructions.
First login to your FreeBSD server as a ‘non-root’ user. You should have an account in the ‘
wheel’ group. Once you logged in your server just run the following commands to switch users to ‘root’

su -
Password:
server#


you will get command prompt as ‘#’ which indicates that you are operating server as ‘root’ user. Now run following commands as root :
ee /etc/rc.conf

now for example, if we want to add 4 IPs for your server [ 192.168.1.3 - 192.168.1.6 ] you need to implement following :
Code:
ifconfig_fxp0=”inet 192.168.1.2 netmask 255.255.255.248?
ifconfig_fxp0_alias0=”inet 192.168.1.3 netmask 255.255.255.255?
ifconfig_fxp0_alias1=”inet 192.168.1.4 netmask 255.255.255.255?
ifconfig_fxp0_alias2=”inet 192.168.1.5 netmask 255.255.255.255?
ifconfig_fxp0_alias3=”inet 192.168.1.6 netmask 255.255.255.255?

Note that changes to the _aliasNN and also the netmask changes to 255.255.255.255 from 255.255.255.248. The IP’s will not work unless you use a 255.255.255.255 netmask for the alias IP’s.



Once you added the entries to your file you need to press ‘ESC’ and have to save this file. You need to reboot the server so that all new IP’s would get bounded with your server and you can use them.
You have other option too, you can also use
ifconfig command for adding IP’s on your server, in this case you don’t have to reboot your server. You can also add extra Dedicated IPs if you have WHM/cPanel control panel with your server. just login to your WHM account and add new Dedicated IP using WHM >> Add a new IP.

Installing SSL on server using WHM

0 comments
Almost all webmaster try to have SSL certificate on their ecommerce sites so that all transactions can be done securely. Domain which need to have SSL certificate should be hosted on dedicated IP where you can install SSL certificate for it. You can order SSL certificate from any provider and can install it for your domain. Once you have generated or received an SSL certificate, you can install the certificate using WebHost Manager. You need to have both the certificate and key files to install the certificate. Following steps would be helpful for you to install SSL certificate.
*) Login to WHM.
*) Click on Install an SSL Certificate and Setup the Domain under the SSL/TLS menu.
*) Enter the domain, user name, and IP address for the certificate in the Domain, User, and IP Address fields.
*) Click on the Fetch button to paste the .key and .crt files for the domain into the fields, if they are currently on your server. Otherwise, copy and paste the .key and .crt files into the available display areas.
*) Paste the ca bundle for the certificate in the bottom display area
*)Click on the Submit button.
that’s all you have successfully installed an SSL certificate for req

How to trap cPanel ( WHM ) Password Modification

0 comments

If your account is hosted on Linux hosting server then most webhosting service provider will offer you WHM/cPanel as hosting control panel depending on hosting package you choose. WHM/cpanel offer you large number of features using which you can manage your hosting account or website very easily. you can set/reset password of cpanel, can manage email accounts, hosting accounts, can easily disk quota, create FTP accounts, setup CMS etc….. Most important feature you have with these control panels is that you can change password of cpanel using cpanel aswell as WHM. You may have to change reset your control panel password for some security reason, thus this feature is very important for all webmasters.


If you want to know the password which have changed password of cpanel then you need to create a module in /usr/local/Cpanel/ChangePassword/. This will run as root when password is changed in WHM or cPanel.



Module features :
You can access following variables using above module :
- user (string) - Account Username
- newpass (string) - Account Password
- message (string)*** - Password Change Status Message
- rawout (string)*** - Password Change output
- service_ref (string)*** - Password Change Service

Thus in order to access above module you will have to do the following :



#!/usr/bin/perl
package Cpanel::ChangePassword::Sendtobilling;
use strict;



my %OPTS = @_;
my $user = $OPTS{’user’};
my $newpass = $OPTS{’newpass’};
#Add function to create object and password send

Username / Password can then be send to remote location thus you can retrieve password which have tried to change password of cpanel.

Secure backup server

0 comments
Backups plays an important role when your server crash and you lost all your data, you can restore all your webfiles and can get your site up and running through your offsite backupaccount. Usually all webhosting service provider will offer you backup space on their remote server where you can upload backup copies of your webfiles, databases. If  you are connecting your server backup using some custom software or script then there can be a risk for using such custom applications as if your local machine gets compromised then hacker can easily login to your remote backup space and can delete all your data through this custom software. Thus its always recommended to go with a host who don’t use any such custom application for allowing users to login to your backup space rather go with a webhost who would initiates data transfer from their remote backup servers (using scp scripts or RSYNC over SSH) – thus your server doesn’t have a direct access to backup data directory. This will avoid any backup data loss as if you are using any custom application software for connecting to your backup server and your local machine gets hacked then hacker can easily login to your remote backup server and can delete all data from your server. Its better to check with your webhost about what kind of connection do they offer you for connecting with your remote server. Don’t go with any host who is offering you some script or software for getting