| Migrating
Servers: Enabling CGI:
Part 1 | Part 2
Mike
de Sousa, Director, AbleStable, and Zoltan Milosevic,
Fluid Dynamics Software
Related
Resources at AbleStable: An
introduction to CGI | CHMOD
Calculator
We continue our extended article as we investigate
the issues surrounding server migration and CGI
scripts.
Migration
of Data

The actual copying of a script from one server to
the next is usually an easy process and requires
you to copy the script onto your local computer
(ensuring you download using ASCII), then upload
it onto your new host folder (ensuring the path
is correct and the script can function according
to the guidance set out above).
Licensing

When migrating from one server to another check
to see your script license permits this without
an additional charge. Look out for a statement like:
"Additional instances of the product can be
installed and registered, using the original key,
on web sites that act as non-public development
and test platforms for the registered instances."
For purposes of a server or site migration, the
new or old site is often considered a non-public
dev/test support site as long as the DNS is not
actively pointing to it.
Uploading CGI Scripts

An often overlooked yet significant issue is to
ensure Perl scripts are uploaded in ASCII mode.
All around the world at this very moment webmasters
sit staring at a blank error page as they attempt
to configure or run their script but have not uploaded
their scripts using ASCII.
CHMOD: Setting Permissions

When you first upload your CGI files you'll need
to set your 'permissions'. Be aware many common
web site generation programs like Macromedia Dreamweaver
do not support this FTP functionality, and you may
require a separate FTP application that allows this.
We provide a CHMOD
Calculator at AbleStable to easily set permissions
on your cgi files via FTP.
Permission numbers translated into attributes (some
FTP programs use the term 'Other' or 'Global' instead
of the term 'World' as used below):
0755 Global read/execute
permission
Owner: read-write-execute
Group: read-execute
World: read-execute
0766 Global read/write
permission
(If your server won't write to directories with
0766, use 0777):
Owner: read-write-execute
Group: read-write
World: read-write
0777 Global read/write/execute
permission
(Try 0766 first):
Owner: read-write-execute
Group: read-write-execute
World: read-write-execute
Using
Server Variables

Make use of the server variables when possible.
A well written script will use these to learn where
it is and what server it is running on, making changes
to the way that it works accordingly.
The PATH_INFO, SCRIPT_NAME and SERVER_NAME server
variables are a quick way for a script to learn
more about itself but you'll need scripting knowledge
to amend these. Don't even try to alter the script
unless 1. You have permission to do so from the
author (this would be unusual), and 2. You know
what you're doing.
There are likely to be some scripts that are unable
to make use of server variables or require that
you provide a hard coded variable based on some
server path that it is unable to detect. Speed up
the time needed to change all these hard coded elements
in the future by grouping and declaring all your
variables at an easily recognizable location in
the script (near the top).
Testing
CGI: Server Issues

When migrating your website from one host to another
you'll want to test your new site out carefully
before changing your Domain Name Server (DNS) to
point to your new host address. Hosts provide a
variety of ways that you can achieve this. You'll
be able to access your test site by entering your
new IP address, however, you may well find that
you are unable to test your scripts in test mode
because of the way your new host has configured
their server, and scripts may require an active
domain name to function correctly.
Once you have successfully uploaded your CGI program
onto your server you must test it as there are many
reasons why a CGI program might not to work. Follow
the FAQ checklist below:
• is your server CGI enabled?
• have you uploaded your scripts using the
ASCII method?
• have you ensured the correct permissions
have been set on the remote server?
• has the CGI script been uploaded into the
correct server folder?
• is your CGI file path on the web page correctly
configured?
• have you double checked the paths to the
URL and CGI scripts are correct?
• is there a problem with the CGI source code?
• have you tested your web page in a variety
of browsers and operating systems?
Post
A Site Notice

After
you have uploaded all your files, tested your scripts,
and are happy that your site is ready to migrate,
place a prominent notice on your site a week or
so before the migration. We advise placing a site
notice on your homepage above the fold like the
following:
"This website will be migrating servers on
[the date of migration]. Our new server will deliver
considerable improvements in performance, scalability
and resilience. We will attempt to make this process
as transparent as possible. The whole process of
migration may take up to 48 hours while the Domain
Name Servers around the world are updated. If you
do experience problems during this period please
email support@your-email-address and we will resolve
the problem as quickly as possible".
A site notice of this sort will help ensure visitors
will (hopefully) be a little more forgiving of 404
errors or CGI errors.
Conclusion

Enabling CGI on your website does require time and
effort to set up, configure, and test, but the benefits
of a great script can be immense, both for the user
and the website owner. If you're interested in trying
out a CGI script for the first time, visit the CGI
Resource Index which provides numerous scripts
and further information about the world of CGI.
Related Resources at AbleStable: An
introduction to CGI | CHMOD
Calculator
Migrating
Servers: Enabling CGI:
Part 1 | Part 2
|
|
|
|
 |
| |
| Authors
background |

Mike
de Sousa is the Director of AbleStable®.
Mike has been commissioned as an artist, music
composer, photographer, print and web site designer,
and author.
Zoltan
Milosevic runs Fluid Dynamics Software (www.xav.com)
which develops and markets CGI scripts that
add value to customers' websites and, by extension,
provide value to the Internet community. These
scripts are offered to the broadest possible
audience through low prices, flexible license
policies, and innovative distribution methods.
The excellent FDSE Search engine is reviewed
at AbleStable at:
http://www.ablestable.com/products/software/dev/reviews/fdse.htm
If you observe inaccuracies in our in-house
contributions or wish to contribute an article
or review to be included at AbleStable®
visit Feedback.
Copyright
Notice
Although our contents are free to browse, copyright
resides with the originators of all works accessed
at AbleStable®, and unauthorised copying
or publication of our site contents is strictly
prohibited. To use our specially selected premium
content go to Content
Syndication and Licensing.
AbleStable © 2002-2008 |
| |
 |
|
|
|
|