LOW COST JAVA PHP MYSQL CGI PERL
HOSTING SERVICE
LINUX WINDOWS CPANEL WHM PLESK
HOSTING PACKAGES
ECOMMERCE HOSTING ASP JSP MSSQL
FRONTPAGE HOSTING
CPANEL WHM RESELLER DEDICATED
SERVER WEB HOSTING

Archive for July, 2007

Restoring a cPanel Server From a Crashed Hard Disk or Migrating a cPanel Server

Recovering a cPanel Server From a Crashed Hard Disk With rSync

Rsync is another very powerful command that is used to synchronise 2 directories between servers and only transfer the new files to the server. This is a great method for backing up data as it is low on bandwidth and it is also commonly used to keep clustered servers working together. The ending slashes are very important when using rsync. If you are not familiar with how it works, always make sure to have an ending slash on both the source and the destination and it should be fine.

In case we fail or accidentally destroy our HDD then we can get a new HDD and operating system from the datacentre and restore the data on a new drive. This concept can be used to migrate cPanel Servers from one server to another without loosing any data or creating any sort of downtime for websites hosted on the server.

This is how it will work:

1) Get the partitions from both the drives with:

# fdisk -l

2) Check to see if there are any drives mounted with:

# df -h

3) Let us assume that /dev/hdb3 is our CRASHED old drive and it is mounted as /mnt/old (yours can be different), but keep in mind that you need to know the mount point of the backup drive before we proceed further with the steps below.

Let us mount the CRASHED HDD if not already mounted with:

# mount /dev/hdb3 /oldHD

4) Now that the drive is mounted you can browse any files with:

# ls /oldHD/home

5) We are all set to move our data over to the new drive:

Run these rSync commands to move everything over:

rsync -vrplogDtH /oldHD/usr/local/apache/conf /usr/local/apache
rsync -vrplogDtH /oldHD/var/named /var
rsync -vrplogDtH /oldHD/home/* /home
rsync -vrplogDtH /oldHD/usr/local/cpanel /usr/local
rsync -vrplogDtH /oldHD/var/lib/mysql /var/lib
rsync -vrplogDtH /oldHD/var/cpanel /var
rsync -vrplogDtH /oldHD/usr/share/ssl /usr/share
rsync -vrplogDtH /oldHD/var/ssl /var
rsync -vrplogDtH /oldHD/usr/local/cpanel/3rdparty/mailman /usr/local/cpanel/3rdparty
rsync -vrplogDtH /oldHD/var/log/bandwidth /var/log
rsync -vrplogDtH /oldHD/usr/local/frontpage /usr/local
rsync -vrplogDtH /oldHD/var/spool/cron /var/spool
rsync -vrplogDtH /oldHD/root/.my.cnf /root
rsync -vrplogDtH /oldHD/etc/httpd/conf/httpd.conf /etc/httpd/conf

cd to the old etc directory:

#cd /oldHD/etc

And copy some files from here:

#rsync -vrplogDtH secondarymx domainalias valiases vfilters exim* proftpd* pure-ftpd* passwd* group* *domain* *named* wwwacct.conf cpupdate.conf quota.conf shadow* *rndc* ips* ipaddrpool* ssl hosts /etc

6) We are done with the copying of all the files and cPanel should start recognizing all the old users and their files, but after we do all this it is highly suggest that you run all updates, and run the cPanel fix scripts i.e:

Updating software and restarting services:

#/scripts/upcp
#/scripts/updatenow
#/scripts/sysup
#/scripts/exim4
#/scripts/easyapache
#/scripts/securetmp
# /scripts/fixeverything

7)This is needed to update cpanel information. Please note, sshd might fail and not start after running fixeverything. You have to login to whm, and go to the rpm installer and “FORCE” install opensshd-server, opensshd, opensshd-client and then restart sshd from whm.

Restarting services as:

#/scripts/restartsrv httpd
#/scripts/restartsrv cpanel
#/scripts/restartsrv mysql
#/scripts/restartsrv named
#/scripts/restartsrv exim

That is all we need to recover data from a CRASHED HDD.

The same procedure can be used to migrate one server to another without any data loss or downtime. The following steps will be different in this case and for this particular requirement you will need to go through the following configurations :-

1) Share SSH keys between both servers (only if you have full control of both servers). To share SSH keys you will first need to generate keys on both servers with following command :-

#ssh-keygen -t rsa -b 1024

Run above command only if you dont have any information in ‘/root/.ssh/ directory’. Once the keys are generated you will see the following files in the directory :-
id_rsa id_rsa.pub known_hosts

Now to share the keys you need to copy the contents of id_rsa.pub file and create a new file called authorized_keys in the same directory on the other server. Paste the contents of id_rsa.pub of server1 in server2 and server2 in server1 authorized_keys. Sharing SSH keys in this way will allow you to sync data between both servers without any sort of password authentication. You will need to create this file (authorized_keys) as it won’t be there by default.

Browse to the ‘/etc’ directory on the source server and run following command from that directory :-

#rsync -vrplogDtH secondarymx domainalias valiases vfilters exim* proftpd* pure-ftpd* passwd* group* *domain* *named* wwwacct.conf cpupdate.conf quota.conf shadow* *rndc* ips* ipaddrpool* ssl hosts root@10.10.10.2:/etc

(10.10.10.2 is assumed as the IP of the new server to which we are moving the data.)

Now we need to transfer everything else.

rsync -vrplogDtH /usr/local/apache/conf root@10.10.10.2:/usr/local/apache
rsync -vrplogDtH /var/named root@10.10.10.2:/var
rsync -vrplogDtH /home/* root@10.10.10.2:/home
rsync -vrplogDtH /usr/local/cpanel root@10.10.10.2:/usr/local
rsync -vrplogDtH /var/lib/mysql root@10.10.10.2:/var/lib
rsync -vrplogDtH /var/cpanel root@10.10.10.2:/var
rsync -vrplogDtH /usr/share/ssl root@10.10.10.2:/usr/share
rsync -vrplogDtH /var/ssl root@10.10.10.2:/var
rsync -vrplogDtH /usr/local/cpanel/3rdparty/mailman root@10.10.10.2:/usr/local/cpanel/3rdparty
rsync -vrplogDtH /var/log/bandwidth root@10.10.10.2:/var/log
rsync -vrplogDtH /usr/local/frontpage root@10.10.10.2:/usr/local
rsync -vrplogDtH /var/spool/cron root@10.10.10.2:/var/spool
rsync -vrplogDtH /root/.my.cnf root@10.10.10.2:/root
rsync -vrplogDtH /etc/httpd/conf/httpd.conf root@10.10.10.2:/etc/httpd/conf

One more thing which needs to be done in this case is a mass replace command for changing the IP address in the zone files and httpd.conf. Here’s a command to help you do it in a few seconds :-

replace 10.10.10.1 10.10.10.2 — /var/named/*.db
replace 10.10.10.1 10.10.10.2 — /usr/local/apache/conf/httpd.conf

10.10.10.1 is assumed as the IP of source server.
10.10.10.2 is assumed as the IP of the new destination server which will now run your websites.

If you run this mass replace command on the source server as well then all the websites will start pointing to the new server immediately which will ensure no downtime for your websites. This concept can be used for a VPS as well.

Comments (1) Bookmark on del.icio.us

Windows Vista And System Restore

In Vista, System Restore is set to delete restore points after roughly 136 years … yeah, let that sink…

Normally Windows uses up to 15 percent of a drive’s available space to save restore points. In XP, the option to change this figure was configurable from the ‘System Restore’ tab of the ‘System Properties’ dialog box. But sadly, this option is no longer offered in Vista.

But you can do so as follows :

Open regedit and go to
HKLM\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\
SystemRestore\Cfg Double-click the DiskPercent.
The default is f (in hexadecimal) which is 15 in decimal. For making it say 10% type ‘a’
Now again, how frequently you’d like to have your SystemRestore points auto-created can also b configured as follows :
Open regedit and go to
HKLM\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\SystemRestore
You can change the value RPGlobalInterval from its default setting of 86,400 seconds (24 hours) to, say, 43200 (a8c0) if u want it created every 12 hrs.

As and how your new restore points get created, the older ones get deleted due to the available space constraint.
Otherwise by default, in Vista, System Restore is set to delete restore points after roughly 4,294,967,295 seconds or 136 years, which was a mere 90 days in XP! The idea apparently, is to delete them only when absolutely necessary due to space constraint!!! But err…136 years !!!
But if you’d like to, you can also change this interval too. Change the value of RPLifeInterval in the same key; a setting of 7,776,000 seconds (or 76a700 in hexadecimal) is equivalent to 90 days.
To create System Restore Points on the fly, try System Restore Point Creator. Using this utility, you can create System Restore Points in one click. Works on Vista! To change the frequency of the System Restore Points formation, without using the Registry Editor, you can download CSRF Utility.

Inspired from :- http://www.winvistaclub.com/t2.html

Comments (1) Bookmark on del.icio.us

Error 691: Invalid Username and Password (For Broadband Users)

You are bound to get these error once in a while, major reasons for this error:

Your account is suspended.

You have the wrong username and password.

Your dialer has gone corrupt.

How to get this error to go away:

1) Check the username and password you are typing in the dialer.

2) Check which number the dialer is dialing, it should be ‘0,38′.

3) Recreate the dialer. Steps to recreate dialer:

a) Go to ‘Start’ >> ‘Control Panel’ >> ‘Network Connections’ >> on the left hand side you have the option ‘Create a New Connection’.

b) Follow the steps as: click on ‘Next’ >> ‘Connect to Internet’ >> ‘Setup Connection Manually’ >> ‘Connect Using Dialup Modem’ >> ‘ISDN Channel’ >> type: Tiscali as ISP provider >> dialup number as ‘0,38′ >> then enter your username and password >> click ‘Finish’.

4) Try to connect. Ths should work If your acount is not suspended. If no, call the tech Support or better, billing to confrim whether your account is suspended or not.

Comments Bookmark on del.icio.us

Error 680 (For Broadband Users)

You are bound to get this error if you are using a ADSL modem and your BB (BroadBand Signal) does not reach your premises. To confirm this, the ADSL light on the modem will be flashing or completely off.

The necessary steps that you need to perform before you call the Tech Support:

1) Reinstall the Modem.

2) Swap the filters.

3) Check that you are not using a extension cable. It’s advisable to use a RJ11 Cable, however it should not be more than 10m long.

4) Also try and remove the ADSL cable from the modem and then plug it back in again.

5) Also try and connect to the main BT socket, as the connection is the strongest there.

6) If nothing works, call tech support and ask them to perfom a woosh test or line test, and let the tech support agent know all the troubleshooting that you have performed.plugin mp3 acid4 0abraham martin mp3 dion johnod mp3 acko kamena srceheadset 700wx mp3 bluetoothmp3 adrianne curry interview howard sternacker bilk mp3acherontia mp3 atropsbuner acustica mp3 cd Map

Comments Bookmark on del.icio.us

INSTALLATION OF SAGEM ON WINDOWS VISTA

1) First run the installation CD as normal.
2) Then the CD will get stuck after reaching the stage:
“Plug the USB Modem into the PC or Laptop”
3) Press the “Esc” key on your keyboard.
4) The installation will close.
5) Then go to ‘Start’ >> ‘Connect To’ >> and create a dialer.
6) After the dialer is created, you will be connected.
7) This will work for most of the cases (60% to 70%).
8) If not, you have to just use the Speedtouch modem.

Comments Bookmark on del.icio.us

Install Plesk 8.1 Without SiteBuilder But With MSDE From The Command Line

How to install Plesk 8.1 without SiteBuilder, but with MSDE from command line:

1. Make sure that you have extracted the required .msi installer file, if you are using the network installer (see the Installing Plesk 8.1 for Windows Using Command Line Interface section for more details).
2. Create a new file called “install-plesk-with-msde.cmd” (without the quotes) in your system. Copy the following information into it:

@echo off

if “%3″ == “” (

echo ” USAGE: install-plesk-with-msde.cmd []”

echo ” where can be:

echo ” complete - Complete Plesk installation

echo ” typical - Typical Plesk installation

echo ” {comp_list} - Complete Plesk installation without specified components (use a comma to separate the components)

exit /b 1

)

set plesk_distrib_dir=%~dp1

set plesk_msi_name=%~nx1

set plesk_dir=%~2

set plesk_non_typical=CommunitySK,Mambo,bbClone,gtChat,phpBB,phpBook,postNuke,Uebimiau,TimeTrackerSK,ReportsSK,KasperskyAV,SiteBuilder,PDFDoc,Python,JDK,Tomcat

if “%3″ == “complete” set plesk_exclude=MSDE

if “%3″ == “typical” set plesk_exclude=MSDE,%plesk_non_typical%

if “%plesk_exclude%” == “” set plesk_exclude=MSDE,%~3

set msde_pwd=1q2w3e

if “%~4″ NEQ “” set msde_pwd=%4

@echo on

extrac32.exe /Y /E /L “%windir%\Installer\MSDE” “%plesk_distrib_dir%\MSDE.cab”

If “%ERRORLEVEL%” NEQ “0″ exit /b %ERRORLEVEL%

“%windir%\Installer\MSDE\setup.exe” /qn DISABLENETWORKPROTOCOLS=0 SEQURITYMODE=SQL REBOOT=ReallySuppress SAPWD=”%msde_pwd%” TARGETDIR=”%plesk_dir%\Databases\MSDE” DATADIR=”%plesk_dir%\Databases\MSDE” REBOOT=R /l*v “%windir%\Installer\MSDE\msde-install.log” DISABLEROLLBACK=1

If “%ERRORLEVEL%” NEQ “0″ exit /b %ERRORLEVEL%

reg ADD “HKLM\SOFTWARE\Microsoft\MSSQLServer\MSSQLServer” /v LoginMode /d 2 /t REG_DWORD /f

net stop MSSQLSERVER /Y

net start MSSQLSERVER /Y

“%plesk_distrib_dir%\%plesk_msi_name%” /qn MSSQL_HOST=localhost MSSQL_ADMIN_NAME=sa MSSQL_ADMIN_PASSWD=”%msde_pwd%” INSTALLDIR=”%plesk_dir%” ADDLOCAL=ALL REMOVE=%plesk_exclude% /l*v “%plesk_dir%\plesk-install.log”

If “%ERRORLEVEL%” NEQ “0″ exit /b %ERRORLEVEL%

Note: You are welcome to change the script text above to suit your needs best. For example, you can change ‘/qn’ to ‘/qb’ in the script text, if you want to see the progress bar during the installation. Please make sure that you clearly understand what are you changing before making the changes, as SWsoft shall not be held liable in any manner whatsoever for any losses or damage caused by using the modified script text.
3. Open the command line interface (Start > Run > cmd.exe).
4. Run the following command to install Plesk 8.1 without SiteBuilder and with MSDE:

install-plesk-with-msde.cmd WSBNET []

The following variables are used by this command:
* - full path to plesk_x.x.x_buildYYMMDD.HH.msi file.
* - full path to the folder where Plesk should be installed.
* [] - Password for default MSDE administrator login ’sa’. Note that this parameter is optional; if you do not specify it, the default MSDE password will be set to ‘1q2w3e’.
5. The installer will proceed with installing Plesk 8.1 without SiteBuilder and with MSDE.

Comments Bookmark on del.icio.us

« Previous entries