Colocation Services



             


Monday, March 9, 2009

Running a CGI Script on a Web Server

For many years I have been writing Perl scripts to process ASCII files of one sort or another on my computer. I typically do this when I need to reformat or tidy up a series of HTML pages, for example.

To run a Perl script that is installed on your computer, which needs to process one or more files on your computer, and where the Perl interpreter is also installed on your computer, is very simple - you just need to double-click the perl script and it does the business - assuming that everything is set up correctly of course, for example, the location of the perl.exe program is defined in your path. You can also open a DOS window and type perl perlfile.pl to run a script (where perlfile.pl is the name of the Perl script you want to run).

However, when it comes to running a Perl script, or CGI script, on a web server, things can be a bit trickier - not too tricky, but a bit trickier.

In this article I'll look at two versions of the same script: one that will run quite happily on a local machine (by double-clicking the script, for example), and one that will run on a web server.

The script itself is very simple - it opens a file, changes some text inside the file, and then saves the file under a different name.

Version 1 - the local version

Here is version 1 of the script. This is the version that will run locally on a computer, without a web server is sight. Note that I've inserted spaces at appropriate places to prevent the code from being processed by your browser. I've done this wherever necessary in this article.

localScript.pl

$name = "before.htm" or die "cannot assign to variable: $!";
rename $name, "$name.bak" or die "cannot rename: $!";
open (IN, "<$name.bak") or die "cannot open: $!";
open (OUT, ">$name") or die "cannot create: $!";
undef $/;
while ($line = < IN >) {
$line =~ s/hello world/goodbye cruel world/s;
(print OUT $line);
}
close (OUT);
close (IN);
rename "before.htm", "after.htm";
rename "before.htm.bak", "before.htm";
 

This script opens a file called before.htm, uses a regular expression to change the string 'hello world' to 'goodbye cruel world', and writes the contents to a file called after.htm. If after.htm does not exist, it is created.

The file before.htm simply contains one line - hello world. So it's not even a proper HTML file in fact, but that doesn't matter for this exercise as it's the script that's important, not the file that's being processed.

Version 2 - the web server version

Here's the web server version of the script. It contains everything that's in version 1, plus a bit more. Again, I've inserted spaces where appropriate to ensure that the code displays correctly in your browser.

webScript.cgi

#!/usr/bin/perl -w
use CGI qw(:all);
use CGI::Carp qw(fatalsToBrowser warningsToBrowser);
warningsToBrowser(1);
use strict;
print header;
my $name = "before.htm" or die "cannot assign to variable: $!";
rename $name, "$name.bak" or die "cannot rename: $!";
open (IN, "<$name.bak") or die "cannot open: $!";
open (OUT, ">$name") or die "cannot create: $!";
undef $/;
my $line;
while ($line = < IN >) {
$line =~ s/hello world/goodbye cruel world/s;
(print OUT $line);
}
close (OUT);
close (IN);
rename "before.htm", "after.htm";
rename "before.htm.bak", "before.htm";
 

A couple of initial points to note:

1. Why does the script have a .cgi extension instead of a .pl extension? CGI is an abbreviation for Common Gateway Interface, which is a specification for transferring information between a web server and a CGI script. So CGI iteself is not a language, but CGI scripts can be written in a number of languages of which Perl is one. If you write a Perl script with a .pl extension, and then change that extension to .cgi, the script becomes a CGI script, and providing it conforms to the CGI specification, it will run on a web server.

2. If you call this script webScript.pl it will run without any problems on a local disk - just as version 1 did. That's to say, all the extra code will not prevent it from running locally.

Ok, lets go through the script line by line to see what's going on.

Running the script

To run the script you need to first upload the script and the file before.htm into the cgi-bin directory on your web server. On your web server the cgi-bin directory might be called something else, but it will probably be recognizable as the place where cgi scripts need to be located.

By default, when you upload a file onto your web server it will probably have permissions of 644. You need to change these to 755 so that the script can be run by anyone. Your ISP should provide you with a way to do this. If not, contact me at john@dixondevelopment.co.uk and I'll send you a script to change the permissions for you.

Once you have uploaded the files and changed the permissions, all you need to do is browse to the script in your favorite browser. If the browser window is blank, then everything has probably worked OK. Check in your cgi-bin directory to see if the file after.htm has been created and that it contains the words 'goodbye cruel world'.

About the Author: John Dixon is a web developer and technical author. He enjoys developing database-driven websites using PHP, Perl, and MySQL. John is also interested in anything to do with computer history. Visit http://www.computernostalgia.net/listDocumentsOutline.htm to see the current list of computer history articles on his site. To find out more about John, visit http://www.dixondevelopment.co.uk.

Labels: , , , ,

Monday, March 2, 2009

Choosing the Right Web Server - Part 3 of the How To Build Your Web-Site Series

In my previous articles in this series (Part One & Two on How To Build A Web Site both available here at EzineArticles.com) I began to outline just what is needed for the "real" web-site to succeed. In this article we are going to discuss the first important decision that you will have to make and which most people do not understand the far-reaching consequences that can affect and effect your web site way down the line as you get more sophisticated.

In the previous article Part Two of the How to Build Your Own Web Site series the first challenge we mentioned in our "Cookbook" was:

1. Web Server - Two choices here: Linux or Windows (and it does make a difference) And what else will my provider offer me?

Okay, so the first thing you may want to do to get an answer to this is to ask a few friends who are "techies". Before you do that get ready with some suitable body armor and make sure you can handle people frothing at the mouth and getting very excited about such a subject. You may find that some people will tell you:

"You are nuts to use a Linux Server. They are decent servers and fast that is true, but they require an incredible amount of attention and a System Administrator at the web hosting site that lives, breathes, eats and drinks Unix, Linux, RedHat etc. ."

And the others will tell you:

"Hah! Windows as a web server? Are you crazy? Open to attack. Vulnerable. Slow. Horrible to deal with. Crashes. Dll's all over the place that simply just crash. Microsoft? Keep them for Office. Big Boys use Linux!"

Okay, so now you are really confused. So let us get a few facts out there.

  1. Both types of servers are vulnerable to attacks. Period.

     

  2. Both types of servers need professional maintenance from trained professionals.

     

  3. Both types of servers have been known to crash.

 

These are NOT the points you need to consider. What you do need to consider is the following:

  1. Are you going to use a pure HTML site (all .htm pages) and are you going to use FrontPage or the equivalent to build it? In this case go with a Windows server.

     

  2. Are you going to use ASP technology? - Must have Windows server.

     

  3. Are you going to use Php? - You can use either Linux or Windows. However if you use Windows you must make sure you service provider supports PHP. Only they can answer that. Most people who use PHP use Linux servers and control access with the FTP changemod commands and a file called .htaccess. However, you can still use a Windows server with PHP and very effectively, I might add.

     

  4. Are you going to need to need MYSQL Database? Database generation is sophisticated, but sometimes needed and often very important. Here I will make one clear point. Do not use Access for Web servers. It is slow, it is not made for large databases and it is very difficult to maintain on a web site. If you insist on using Access, then make sure you have a Windows server to support it. Don't forget to make sure that your web provider supports Mysql and gives you the ability to deal with your tables directly.

Still all mysterious for you?

Think ahead a bit. In actual terms you do not need to know nor should you care what server is being used as long as you have ftp access to your site and you can directly update it. However, if you are even an emerging "techie" then taking into account:

  1. Database

     

  2. PHP

     

  3. ASP

     

  4. HTML

     

  5. FTP access

are all critical.

In truth the majority of web servers are not Windows servers. However, do not be fooled by that comparison. Remember, the Unix, Linux, RedHat variations are either totally FREE or very cheaply priced for the Web Farm compared to their purchase of a Windows Server License. That is one MAJOR reason that the Linux servers are out there and so popular.

So when you want to look for a web provider ("Server-Farm") on the net you will usually see that they offer either Windows Plans or Linux Plans. Consider what you think you will need in the future. Database? PHP? ASP? HTML?

In the next article we will discuss exactly what you should demand from your web provider (the Server-Farm) as part of the package.

Ted Gross runs Virgin Earth Article Submissions which is designed to accept articles about any country, place historical event or current events in the world. Virgin Earth Article Submissions gladly accept articles about travel and places and countries - and of course places of interest. From small towns and museums to the MET in NYC. From ball parks to zoos. Places of interest all over the world. Ted Gross is also a published author and maintains a web site for his works And of course maintains his blog when the muses hit him.

Labels: , , ,

Tuesday, February 17, 2009

Web Server Hosting

A successful website does not end with a well designed website. If you have a website for your business, it should have an online presence in order to generate traffic. One of the most effective ways to do this is through web server hosting.

Web server hosting is a web hosting solution committed to providing you with the advanced changes in technology. It gives your online business exposure on the worldwide web in order to reach your target market. This makes you more competitive, and helps you keep up with the fast-paced online technology.

With so many web-hosting companies, packages for web server hosting also begin to look very similar. That is why you have to look at all the features and small details included in the package such as articles, images, shopping carts and music.

Before you choose a web server-hosting package, you must first know your specific needs such as the amount of traffic per month, size of disk space, number of needed email addresses and price. After determining your needs, you can start your search for a server hosting company with a web server hosting service that features 24/7 live support, a 30-day money-back guarantee, Windows and Linux hosting, shared SSL and free setup.

When looking for a web server hosting company, you can begin your search by going online. You can also rely on word of mouth. Sometimes, colleagues can recommend a company. Online and printed advertisements can also help you in your search.

With stiff competition in the online industry, it is necessary that you rely on web server hosting solutions to better give you an online presence. This way, your competitors will not leave you behind the scene.

Server Hosting provides detailed information on Server Hosting, Dedicated Server Hosting, Web Server Hosting, SQL Server Hosting and more. Server Hosting is affiliated with Free ASP Hosting.

Labels: , , , ,

Monday, February 2, 2009

More On How To Choose A Data Center

As a follow-up to an earlier article "How To Choose A Data Center"....here are just a few other considerations / concerns I would recommend. Combine the lists from both articles and you're more likely to make a smart decision choosing a data center.

Current Customers:

This is not a guaranteed seal of approval, but a Data Center's current customer base should give you an idea of the type of due diligence that others have performed on the Data Center you are evaluating. If numerous Fortune 50 companies are at a Data Center then there is a good chance it is a reliable place to keep your servers. NOTE: Some Data Centers will take on a "marquee" client at a loss in order to get the brand name. Make sure there are at least 2 high profile companies colocated there.

Employee Retention:

Ask the company how long the facility engineers have worked for that particular Data Center. High turn-over can be an indication of a number of things (including issues).

Power Outages:

Ask about the last power issue / outage they suffered - time-frame, length of the outage, reason(s) for the outage, mitigation steps. Most Data Centers will face some time of issue over the course of its use and you want to make sure they are honest with you about past issues, and have taken steps to correct any errors.

Bandwidth Connectivity:

How many "separate" bandwidth feeds are coming into the facility? A lot of companies say they have peering with "numerous" providers. BUT, all of that fiber may be coming into the building in single conduit. That means that if someone is digging a trench your Internet access may be cut off.

Expansion:

If your company makes it big, will you have room to grow? Right now there are a LOT of Data Centers out of space and / or power. Make sure you aren't in a position where you have to choose another place to go down the road.

SLAs (Service Level Agreement):

Although there is no compensation for your e-commerce site taking a hit for an hour, make sure there are strict SLAs in place which will bring some financial relief in the case of an outage.

Managed Hosting:

There is a trade-off between owning the equipment (and keeping it at a Data Center), and utilizing a managed hosting provider. Make sure analyze the pros and cons of both based on the current and future needs of your business. If you have older equipment, don't want to staff-up, I.T. isn't your core competence, etc, then consider going managed.

Data Recovery:

No matter where you go...make sure you have a DR plan in place. Keep backups of everything off-site and have a plan of action (hot-spares, DNS change-over, contact list, etc).

Fire suppression systems:

What provisions does the facility have for fire suppression? Is it a regular sprinkler system, Dry Pip Pre-action, gaseous CO2 or something else.

A Water based system is to protect the building, it will not protect the systems or the data because you're spraying water on computer systems in the event of a fire. A Pre-action system with dry pipes that only charge when there is a fire detected (smoke and heat detectors) is better because it prevents a construction accident where a sprinkler head is bumped or a pipe is broken from causing an incident.

Gaseous CO2, Energen, Halotron, Halon, etc are best, but more expensive. A combination of CO2 where power is run (under the floor perhaps?) and Pre-action sprinkler's above allows for a small fire to be contained in the underfloor space before water enters into the equation.

One thing to be very wary are what kind of hand held extinguishers are in the Data Center space? Are they Dry Chemical? If so, that's bad. Very bad. A fire (say in a garbage can) that would not jeopardize the data center or building can be made worse (in terms of the protection of the data center) because when someone goes to fight that fire, they're going to perhaps put the fire out (likely if small) but very likely spread a corrosive dust around the data center which will require either replacement of the systems OR professional cleaning of them. Look for halogenated or CO2 type extinguishers in the data-center for handheld use.

Physical Security:

Armed security guards are better than not armed in my opinion. Better training (ie more) and a more serious perspective on security of the building and the people. Guards more able to respond to serious problems are preferable to an old retiring that's more of a night watchman who calls 911 when there's an issue.

Physical Structure security is also important. What kind of walls does the building have? Are they several layers of concrete block or just one layer? Is it glass? Bullet Resistant glass (also good in storms) and is there an inner layer between the glass and the rest of the facility?

Do they have spill protection kits for dealing with water leaks? If there's a major rain storm and the roof is damaged, how does this impact the facility? Badly, slightly, total shutdown? Look for drip pans over critical infrastructure like PDUs and UPS systems.

Logistics:

Does the facility have a good loading dock that's near the data center or sufficiently proximate? If not, you're going to have a harder time getting your systems to the data center to install them. A good sized door large enough for the largest of racks and gear is important. Is there a lab where you can diagnose problems with your systems there? An area where you can stand up your systems if you need to? How are you getting final configuration work done at the site?

Generator Power:

Fuel Supplies cannot be underscored. A large on-site bunker is a good thing to see. A contract with a fuel supplier to be able to provide supplemental fuel on a daily basis is also important. I've seen an instance where a call center was left without power because the backup generator ran out of fuel after running for 24 hours. No-one thought o check the generator and get a fuel shipment to the call center.

Generator Maintenance can be important as well. A periodic maintenance contract with a major service company is good. But having someone that rides herd on the generator and power systems themselves is also important. Many small things that would not be noticed by a rotating batch of mechanics would be noticed by someone that can get a feel for all of the systems and perform periodic checks. It could be as simple as noticing that Generator No 2 sounds off and realizing there's an exhaust leak or as complex as a lubrication problem that is only found by periodic oil and coolant analysis by a lab that specializes in such tasks.

Periodic maintenance of the fuel is also important. Fuel that becomes contaminated with water can stop a generator system cold if bacteria begin growing in the fuel. The sludge that the bacteria produce will clog injectors and pumps as well as the fuel filters themselves. Periodic checks of the fuel as well as polishing and treatment is important.

There you go. Now you're fully armed with all the details you need to select just the right data center to meet your needs....and expectations.

Michael is the owner of FreedomFire Communications....including DS3-Bandwidth.com and Business-VoIP-Solution.com. Michael also authors Broadband Nation where you're always welcome to drop in and catch up on the latest BroadBand news, tips, insights, and ramblings for the masses.

Labels: , , , ,

Friday, January 30, 2009

Top Three Factors to Consider While Choosing a Data Center for Your Business

Data Centers are the core of the Internet. The computer servers that power the Interne,t call Data Centers their home. If you think of how many billions of online transactions that happen every day you will be amazed to know that the final resting place of all these stored transactions is the Data centers. This Amazement quickly turns into Panic when you think about how much private data and vital data is stored there. Over years the Data Center technologies have evolved a lot into much advanced techniques like server virtualization and high speed power houses. There are more than 100 factors one should evaluate a data center against before choosing one to home their servers. In this article we will see the three main that in turn dictate the rest of the factors.

1. Security: We just now saw how much data is stored, processed and served by the data centers. All these are vital data that makes or breaks a global economy. Security includes the data encryption capability of the servers, the security of the uplinks or the backbone networks that are employed. It includes security mechanisms like the Public key dongles and the capability to store the data securely and safely. The less talked aspect is the physical security of the box and the whole data center itself. We are talking about limiting snooping and sniffing the packets, but what happens if one person just walks in carries off a server. How much credit card data, transaction details, bank details and the SSN’s get compromised! You can have a slow box but an insecure one creates a ton of problems in the form of countless lawsuits. Choose the data center that excels in all aspects of security. Ask pointed questions, expect the right answers.

2. Reliability: The next important aspect is the reliability of the systems and the data center infrastructure itself. We are just not talking about backup machines or RAID 5 HDD. We are talking of highly available power systems with sufficient backup time and in house generators for emergencies. The additional aspect to consider is reliability of the company that offers the data center and the persons working for the company. You many want to talk a little bit about their hiring and daily authentication and authorization process if you are even a mid-sized company. Disaster recovery systems are critical for the five 9’s in reliability don’t be stalled because a California power-company had a complete emergency shutdown due to an earthquake or a hurricane in Florida. You should be able to gracefully failover to alternate sites.

3. High Speed: The third aspect is the much needed speed. This is more complex than you think. Adding a word saying that we have the high end servers making a data center a high speed infrastructure is minimum requirement. The network uplinks and the Internet backbone the center are connected to are also very important. You have to ask for custom solutions like caching technologies, load balancing blueprints and high end routers, switches and backplanes.

This article just touches on these major concepts and you have to do sufficient research on the keywords employed in this article. As I said there are 100 factors to consider before choosing the right datacenter. Any good company owning a data center would openly help you evaluate their infrastructure against these factors.

You can find a good Data Center with many of the good capabilities discussed in this article in fastpcnet.net. Ask them about their custom solution and how they measure against the deciding factors and you will be happy at the answers.

Author Holds a Masters in Distributed computing and does freelancing for many great Internet companies through the no fee free freelance website freelancefree.com.

Labels: , , , , ,

Tuesday, January 13, 2009

Benefits of Working In a Data Center

As the Internet continues to grow and produce large amounts of traffic the need for data centers and data center management increases. This continued growth creates data center jobs and IT careers in the technology field. Data Centers not only provide large hubs for Internet traffic, but it also completes the network infrastructure of most mid-large size companies. Data centers usually house thousands of computers, servers, and technical components. This in itself tells why it is a tremendous benefit to working within a data center. Just the amount of knowledge you can gain while on the job is rewarding enough. Having a data center job puts you on the bleeding edge of technology and hi-tech equipment. By working in a data center you will naturally be more advance than your peers who work in different industries experienced in technology.

Data center jobs consist of many different job types which fall under information technology, such as: system administration, network administration, IT security, computer operations, help desk support, server administration, pc repair, engineering, and so much more. If you ever been to school for a computer-related field or you always had an interest to work with computers then working in a data center should have been at the top of your list. Though, most do not consider data center jobs when looking for a job in the information technology field. This is mainly because data center jobs are merely overlooked. Most individuals consider working for a company or corporation in an industry other than data centers, mainly in a company like where they previously worked, before being technically inclined. Gaining a data center job is exactly why you went to school or aligned yourself within the technology field of work.

Data centers are inhabited with individuals who are fairly intelligent, usually skilled professionals with an educational background. The benefit of surrounding yourself with knowledgeable individuals is that it enhances your own technical aptitude and empowers your keen technical sense. Another benefit to working in a data center is many times the operations are around the clock (24/7), which means you may have the option of being flexible and working flex schedules, at your leisure. The biggest benefit of working in a data center is “stability”. The fact being that so many operations, calculations, and transactions depend solely on data centers - society cannot afford to lose data centers. Data centers will always be around and continue to thrive, so this means data center jobs will never fall short. Even in the wake of economic hardships, data centers still did not take a plunge or lose its clarity. If you are reading this article right now, then more than likely at some point a data center involvement allowed me to deliver this article to you. Data center jobs are for life!

Ant Onaf is the owner and founder of DataCenterLife which is a job portal dedicated to data center jobs and information technology jobs. Primarily, DataCenterLife.com offers job searching, resume searching, job posting, and resume posting for individuals, companies, and recruiters in the data center industry and profession.

Labels: , , , , , ,

Friday, June 6, 2008

Choosing A Reliable Colocation Facility

There are no industry standards to designate a good colocation facility, but key areas can help identify one: power, cooling, Internet connection, and service. Good colocation facilities offer reliability through redundancy, maintenance, and service, meaning more uptime for networks and longer equipment lifetimes. Ask questions, be prepared to research answers, and look for the facility that meets the needs of their customers.

Power A good colocation facility will have a power system with backup units not only for the generator, but also the universal power supplies (UPS) and transfer switches or circuit breakers.

  • UPSs run the servers while power switches from regular electricity to generators. Regardless of quality, UPSs fail regularly, so facilities must have multiple UPSs running sufficiently below capacity to manage the total server load if one fails. Transfer switches or circuit breakers switch power to the generators.
  • Circuit breakers are more dependable than transfer switches, but it is important to have a backup for either system so that power can be transferred regardless of equipment failure.
  • As the primary source of power during an outage, the generator must be large enough to handle 1.5 times the total building load. If there are multiple generators, the colocation facility must be able to transfer the load between generators, otherwise a failure could disable all generators.
Cooling An overlooked consideration for uptime and equipment maintenance is cooling. All servers generate heat yet are designed to operate at room temperature, between 72°F and 76°F. Computer room air conditioning (CRAC) units, chillers, and facility layout ensure that all servers receive adequate cooling. High-end colocation facilities regularly maintain cooling systems and monitor temperature, humidity, and power usage for optimum server performance.
  • Chillers pipe cooled fluids to the CRAC units. There must be redundant pumps and chillers which automatically take over in case of failure so that the CRAC units continue to operate.
  • CRAC units are large (20 to 30 tons), specialized air conditioners which constantly blow cold air. The minimum number of CRAC units to cool a facility is .030 tons per square foot. If there are four 30-ton units and the facility is 4,000 square feet, then there are .030 tons per square foot (120 tons ÷ 4000 square feet).
  • The facility layout should have designated hot and cold rows. Server fans blow hot air from the back of the servers into hot rows; the CRAC units blow cold air down cold rows across the front of the servers. Solid floor facilities should have return vents on one side of the room to draw hot air from the servers, and cold air vents in the ceiling blowing down the top of the server racks. Raised floor designs should blow the cold air with enough pressure to force air to the top of the racks.
Internet Connection There are two major types of Internet connection.
  • Tier 1 providers create national networks which are dependable and fast but tend to have high latency and poor out-of-network performance.
  • Tier 2 companies buy access from multiple tier 1 networks, so they have speed and dependability combined with better latency and performance from a wider network. Some tier 2 providers offer performance routing to route traffic more efficiently between networks, boosting network performance by 50% and creating a self-healing network.
Service A quality colocation facility offers extra service, including any of the following:
  • A dedicated, 24-hour customer service line, plus onsite engineers for emergencies.
  • Changing backup tapes and storing them in a fire-proof safe.
  • Crash carts with monitors, keyboards, and other tools available when a computer crashes.
  • Structural designs to withstand earthquakes, storms, and floods.
Tour of the colocation facility, take notes and ask questions about their systems, backup systems, and maintenance, and find the facility with the service, access, and quality care to give your business reliable, dependable network.

American Internet Services is the premier San Diego colocation service provider with state-of-the-art Internet data center technology. http://www.colocation.ccccom.com

Labels: , , , , , , ,