What it Takes to Run a Dedicated Server

July 17, 2008

This dedicated server hosting checklist is designed to help you understand what it takes to run a dedicated server. After all, it’s not just about purchasing a box - you need to know how to manage and work with it too. So here’s what it takes, your checklist for running a dedicated server:

  • A powerful web hosting platform
  • Managed Hosting
  • 24/7 technical support - through email is best, so you can document errors and solutions
  • State of the art data centers - the more data centers a provider runs, the better chances of redundant uptime for you and your server
  • Guaranteed RAM
  • Easy upgrades
  • Great dedicated hosting deals - amazing coupons to help lower your monthly costs or incentives for staying longer
  • Ability to perform website backups

What is a Rootkit?

June 24, 2008

As a webmaster, you know the importance of a good spam blocking and virus protection program, and maybe you have learned from our dedicated server tutorials how to set con jobs for scheduled tasks, how to protect your system or administer backups, but did you know that there may be things you are unaware of trying to hack your server?

One of these necessary evils of dedicated server hosting is called a rootkit. A rootkit is simply a program usually designed by hackers who attempt to take control of your dedicated server without authorization. They can gain complete access to your system or install themselves as drivers, kernel modules, or other malware. They often go undetected and can seize control of your operating system and obscure the presence of potentially harmful viruses, commands, or Trojans.

Oftentimes, once a rootkit has hidden utility programs in your system, they open a backdoor to your server at any time of the day and can thus be severely harmful to the health of your dedicated server.

If your dedicated web host has a Managed Hosting option, you should look into it, as they often perform rootkit checks to ensure the security of your dedicated server. Remember, a good dedicated web hosting provider doesn’t want your server brought down either and will do everything in their power to keep you a happy customer.

Backing Up Windows Server 2003

May 29, 2008

Why backup?

Well you never know when the worse might happen.  After searching the Web though from coast to coast and corner to corner is seems like there are not many tools to help you back your Windows Server 2003 dedicated machines.

Backing up your Windows-based dedicated server can sometimes be a challenging task.  Here are a few tools that may make that backing up process a little easier:

tar from tar http://gnuwin32.sf.net
rsync from http://sourceforge.net/projects/rsyncwin32/

Be sure to keep checking for updates, because if we run across anymore we will be letting you know.  Now you have no excuse for not backing up your Windows dedicated hosting.

Backing up Your Website Automatically on a Dedicated Server

April 7, 2008

You already know the importance of backing up your dedicated server, but there are easier ways to accomplish that, which do not require periodic backups by hand. In fact, you can easily setup website backups to run automatically via what are called “cron jobs”.

What is a con job? A cron job is what’s known as a time-based scheduling service. This just means it does a specific job at a specific time. It’s most often used in Linux or Unix operating systems, so normally you can run them easily from cPanel or SSH.

Here are some helpful scripts that you can use to setup cron jobs with dedicated web hosting! These make backing up your website a breeze.

Site Backup via Cron

<?
$datestamp = date(”Y-m-d_H-i-s”); // Current date to append to filename of backup file in format of YYYY-MM-DD

/* CONFIGURE THE FOLLOWING VARIABLES TO MATCH YOUR SETUP */
$filename= “Full_Account_Backup-$datestamp.tar”; // The name (and optionally path) of the dump file
$ftp_server = “123.123.123.123″; // Name or IP. Shouldn’t have any trailing slashes and shouldn’t be prefixed with ftp://
$ftp_port = “21″; // FTP port - blank defaults to port 21
$ftp_username = “anonymous”; // FTP account username
$ftp_password = “”; // FTP account password - blank for anonymous
$filename = “/home/YOURACCOUNT/” . $filename . “.gz”;

$command = “tar cvf ~/$filename ~/*”;
$result = exec($command);

$command = “gzip -9 -S .gz ~/$filename”;
$result = exec($command);

// set up basic connection
$ftp_conn = ftp_connect($ftp_server);

// Turn PASV mode on or off

ftp_pasv($ftp_conn, false);

// login with username and password
$login_result = ftp_login($ftp_conn, $ftp_username, $ftp_password);

// check connection
if ((!$ftp_conn) || (!$login_result))
{
echo “FTP connection has failed.”;
echo “Attempted to connect to $ftp_server for user $ftp_username”;
exit;
}
else
{
echo “Connected to $ftp_server, for user $ftp_username”;
}

// upload the file
$upload = ftp_put($ftp_conn, “foo.tar.gz”, $filename, FTP_BINARY);

// check upload status
if (!$upload)
{
echo “FTP upload has failed.”;
}
else
{
echo “Uploaded $filename to $ftp_server.”;
}

// close the FTP stream
ftp_close($ftp_conn);

unlink($filename); //delete the backup file from the server
?>

**Make sure that this script is with a .php extension, and the file has 755 permissions. You also need to change the first few variables to those of your site setup and add a cron job in Cpanel with a path to the script such as php /home/username/path-to-the-php-script (replacing path-to-the-php-script with your actual path to it).

Backing up MySQL Databases Automatically on a Dedicated Server

Backing up your website is extremely important to the server security of your dedicated server, but you can’t forget about your server databases either! Your MySQL databases are the backbone of your website, especially if you are using it for database server hosting. In either situation, you cannot rely on manual backups of your dedicated server databases if you access them every day and if they are integral to your website’s success and uptime.

So below, we have included some helpful scripts that can be setup via cron jobs (scheduled tasks) on your server. These will automatically backup your databases for you, so you’ll never have to worry again! There are two options for these backups – you can either have them emailed to you or FTPed to you, both of which will assist with your dedicated web hosting experience.

MySQL backup via cron - Emailed to You

<?
$datestamp = date(”Y-m-d”); // Current date to append to filename of backup file in format of YYYY-MM-DD

/* CONFIGURE THE FOLLOWING SEVEN VARIABLES TO MATCH YOUR SETUP */
$dbuser = “”; // Database username
$dbpwd = “”; // Database password
$dbname = “”; // Database name. Use –all-databases if you have more than one
$filename= “backup-$datestamp.sql.gz”; // The name (and optionally path) of the dump file
$to = “you@remotesite.com”; // Email address to send dump file to
$from = “you@yourhost.com”; // Email address message will show as coming from.
$subject = “MySQL backup file”; // Subject of email

$command = “mysqldump -u $dbuser –password=$dbpwd $dbname | gzip > $filename”;
$result = passthru($command);

$attachmentname = array_pop(explode(”/”, $filename)); // If a path was included, strip it out for the attachment name

$message = “Compressed database backup file $attachmentname attached.”;
$mime_boundary = “<<<:” . md5(time());
$data = chunk_split(base64_encode(implode(”", file($filename))));

$headers = “From: $from\r\n”;
$headers .= “MIME-Version: 1.0\r\n”;
$headers .= “Content-type: multipart/mixed;\r\n”;
$headers .= ” boundary=\”".$mime_boundary.”\”\r\n”;

$content = “This is a multi-part message in MIME format.\r\n\r\n”;
$content.= “–”.$mime_boundary.”\r\n”;
$content.= “Content-Type: text/plain; charset=\”iso-8859-1\”\r\n”;
$content.= “Content-Transfer-Encoding: 7bit\r\n\r\n”;
$content.= $message.”\r\n”;
$content.= “–”.$mime_boundary.”\r\n”;
$content.= “Content-Disposition: attachment;\r\n”;
$content.= “Content-Type: Application/Octet-Stream; name=\”$attachmentname\”\r\n”;
$content.= “Content-Transfer-Encoding: base64\r\n\r\n”;
$content.= $data.”\r\n”;
$content.= “–” . $mime_boundary . “\r\n”;

mail($to, $subject, $content, $headers);

unlink($filename); //delete the backup file from the server
?>

MySQL backup via cron - FTPed to You

<?
$datestamp = date(”Y-m-d”); // Current date to append to filename of backup file in format of YYYY-MM-DD

/* CONFIGURE THE FOLLOWING THREE VARIABLES TO MATCH YOUR SETUP */
$dbuser = “”; // Database username
$dbpwd = “”; // Database password
$dbname = “”; // Database name. Use –all-databases if you have more than one
$filename= “backup-$datestamp.sql.gz”; // The name (and optionally path) of the dump file

$command = “mysqldump -u $dbuser –password=$dbpwd $dbname | gzip > $filename”;
$result = passthru($command);

/* CONFIGURE THE FOLLOWING FOUR VARIABLES TO MATCH YOUR FTP SETUP */
$ftp_server = “”; // Shouldn’t have any trailing slashes and shouldn’t be prefixed with ftp://
$ftp_port = “21″; // FTP port - blank defaults to port 21
$ftp_username = “anonymous”; // FTP account username
$ftp_password = “”; // FTP account password - blank for anonymous

// set up basic connection
$ftp_conn = ftp_connect($ftp_server);

// Turn PASV mode on or off
ftp_pasv($ftp_conn, false);

// login with username and password
$login_result = ftp_login($ftp_conn, $ftp_username, $ftp_password);

// check connection
if ((!$ftp_conn) || (!$login_result))
{
echo “FTP connection has failed.”;
echo “Attempted to connect to $ftp_server for user $ftp_username”;
exit;
}
else
{
echo “Connected to $ftp_server, for user $ftp_username”;
}

// upload the file
$upload = ftp_put($ftp_conn, $filename, $filename, FTP_BINARY);

// check upload status
if (!$upload)
{
echo “FTP upload has failed.”;
}
else
{
echo “Uploaded $filename to $ftp_server.”;
}

// close the FTP stream
ftp_close($ftp_conn);

unlink($filename); //delete the backup file from the server
?>

**MAKE ABSOLUTELY SURE that either script you use from above includes a .php extension. That file should have 755 permissions, and you MUST change the first variables to those specific to your website’s setup. Also, you MUST have a cron job setup in Cpanel and the path to the script needs to look like this: php /home/username/path-to-the-php-script. Just make sure you replace path-to-the-script with your script’s physical path. ;)

The Role of Server Management

When talking about management of a dedicated server, there is a big tent of tasks and jobs that could fit under that description.  Nobody has ever said, “Ok, these 12 things are what server management is all about” because new tasks always seem to be added to that list.  Some of the rolls might include (but are not limited to):

Operating system updates, script updates, monitoring over the server, simple network and hardware monitoring, tech support for the dedicated server, security monitoring (including antivirus and firewall issues) DDoS protection and prevention and disaster recovery.

As you can see the job of anybody managing a server is a really big one.  That isn’t even counting things like load balancing, performance tuning, software installs and more.  As you can see I could go on and on with what is expected of a person or team who does the monitoring for any given server.  If these are things you really have no real desire to do or jump into with both feet then you might be a good candidate for semi-managed or managed hosting.

Backing up Your Website & Database on a Dedicated Server

April 4, 2008

One of the first things you will notice about having a dedicated web host is that there is a fix for everything. Even if your server’s databases go down or you make a mistake that causes you to lose these databases, there is an easy way to back them up before you test scripts or applications so that you’ll never lose a thing on your dedicated server.

So how do you backup your MySQL databases using cPanel on a dedicated server?

1. First, navigate to cPanel and login.

2. Then, click on the “Backup” icon in cPanel and find your database’s name. Once you click on this, it will download a gzipped copy straight to your computer, where you can store it for future restores.

**You can also use the PHPMyAdmin feature via your dedicated server’s control panel by clicking on MySQL and then “phpmyadmin” at the bottom. In PHPMyAdmin, simply select the database that you need to backup and then click the export tab on the right. You can choose one specific table, several tables, or all tables to backup. When you’ve chosen the appropriate table(s), simply tick “save file as” and click “go” – you can then save the databases straight to your computer!

If you have the patience to manage your dedicated server periodically like this, backing up your databases regularly is a great idea. However, there are also automated solutions for site and MySQL backups using cron jobs.

Reselling on a Dedicated Server

March 26, 2008

Can you resell services to make back a little ‘bit of your money on your dedicated hosting server costs?  Well the terms and conditions may vary from web host to web host, but most will not have a problem with this.  Often, once reseller account clients outgrow their current setups or want to give their own customers more bang for their buck - this is the route they will take.

As long as it is not hurting them and it is not illegal, many web hosts are fine with whatever you need to do on your dedicated server so dividing it up might not be that bad of an idea.  Before doing so, I would make sure that you can get things backed up on your current end before canceling your old web hosting.  You might even wait till after you have everything moved in before flipping the light off with the old web host too.

One concern that might come into play is who is paying the bill?  Make sure only one person is listed as the contact as far as the web host goes, and they are a reliable person who will be paying on time.  Having a confusing paper trail to follow to find out who is actually hosting the account will make many web hosts just a little nervous. 

So is reselling services on a dedicated server ok?  Sure is, you are the one paying for it right?

What is Remote Server Backup?

February 18, 2008

Backing up is something you do with your personal computer at home all the time, is it not?  Then why should your hosting space and dedicated server be treated any differently.  Remote backups are an important part of dedicated hosting because they give you the ease of mind that your information is safely stored somewhere else.

A remove or managed backup service is providing a user with an Online system for backing up or storing files, setting and more from the server.  The backing up is usually customized around a client’s needs and are run on a schedule (for an example, once a day). 

Now the advantages of doing remote server backups is that it does not require much work on your part.  It is all done automatically most of the time without you even having to hit a button.  Also most if not all remote backups are totally secure so no need to worry about documents falling into the wrong hands.  The disadvantage would mainly be the fact that depending on the location of the backup it might take some time to do a full restore if needed. 

As with any kind of backing up, it is always better to have done it rather than not do it at all.  Restoring from any type of backup can not be nearly as painful as trying to recreate any content you had if it was ever lost for good.

Managed Hosting

February 2, 2008

Especially if you’re just starting with a new Dedicated Server, you are going to run across Managed Hosting services.  Knowing exactly what managing a dedicated server entails will help you understand if it’s something you will need to include in your dedicated server purchase.  Finding affordable managed hosting solutions can often be tough, so make sure to choose your web hosting provider carefully.

Managed Hosting is a service that any reliable dedicated hosting provider should offer.  Normally, there will be various levels of managed hosting solutions available at various costs.  Depending on your level of familiarity with dedicated servers, you may be comfortable adding the cheaper option or the more expensive one.

Included in the most basic managed hosting services should be internal monitoring tools that check if your server is displaying HTTP, that there are no issues with high processes or CPU usage, and that FTP and MySQL databases are fully functional.  Any reliable dedicated host will also include the ability to email you when problems arise with immediate 24/7/365 monitoring of your server for these issues.

For a more intense managed hosting solution, clients should get the following for their dedicated server:

  •    Free setup of APF Firewall
  •    Free Root Kit Check on your server or servers
  •    Immediate and advanced notifications of exploits on the most well known 3rd party software and applications
  •    24/7 upgrades of kernels, PHP, Apache, and administration panels for security on your dedicated server (keep in mind, this should be per your verification)
  •    24/7/365 Monitoring of your server
  •    Unlimited rebooting instances for your server

Every dedicated host is different, so make sure you choose one with managed hosting options available.  The best dedicated hosting company we have come across will also add some extra freebies to your managed hosting purchase, so make sure to look carefully.