AllHostGuide.com: How to Install a CGI Script and Increase Web Site Interactivity




Web Hosting: Which is the host with the most?


So you want to publish a web site do you? Welcome to the club. These days it seems that almost everyone has a web site of some kind, and thousands more continue to be launched every day. It's challenging enough to design a site and fill it with interesting content, but when all is said and done another challenge still remains - where to host it?

A popular choice for newbie webmasters, and even experienced ones, is to secure a free hosting plan with a company such as Yahoo! Geocities, Tripod or Angelfire. While these are easy to setup and free of charge, they do have limitations. Most free hosts don't offer all the nice features that paid hosts do such as FTP access, CGI-BIN, or your own personal domain name. Instead you're stuck with minimal features and a generic URL such as www.freewebhost.com/marcswebsite. This somewhat limits your web site‘s potential. Most free hosts also require you to run banners or pop-up ads on your web site to make it worth their while - these banners and pop-ups can obstruct the view of your web page and ultimately annoy visitors and drive them away. Lastly, most free hosts have a daily bandwidth limit that is very small, so if you do get a lot of traffic you'll most likely exceed the allotted bandwidth and your site will be temporarily disabled. Overall I would recommend free web hosts for people that are new to web hosting and want to get a feel for how it works. I'd also recommend them for web sites that are personal in nature (such as an online journal) as well as web sites that don't plan to generate any revenue. Free web hosts are a great stepping stone to paid web hosts - I myself starting building web sites 4 years ago using free hosts, and today I run several high traffic web sites that are hosted on paid web hosting plans.

Now it's time to get into the good stuff - paid web hosting. Web hosting companies that charge money for their services are plentiful on the Internet, and feature a wide array of hosting packages at various price points. First we begin with so called "budget" web hosts, who claim to offer you the world for only $1 per month. Having used numerous such companies I feel I must tell you to proceed with caution here, as these companies aren't all that they are cracked up to be. Many claim to offer 24/7 e-mail support, which in my experience turned out to be 0/0 e-mail support. My e-mails were either never answered or answered a week after I sent them. Even when I got a response it was generic in nature and completely unhelpful. Also, expect frequent outages with these budget web hosts as they rarely even have their own web servers - often they are reselling space on someone else's web servers over which they have no control. One budget web host I used went down unexpectedly for 6 days, and they didn‘t even bother to notify their customers. As a result, my web site was down for 6 days and I lost most of my visitors as well as my hard-earned search engine rankings. Lesson learned: if the reliability and success of your web site is important to you, budget web hosting might not be the answer. However, this is not to say that all budget web hosts are bad - 1dollarhosting.com is one of the leaders in the budget web hosting arena and has quite a good reputation.


More...

How to Install a CGI Script and Increase Web Site Interactivity


You may have delayed cgi script installation due the apparently complex process. Well, I avoided it also for several years, however if you want to increase your web site's interactivity it's a necessity to know how to do it. It's not hard to learn and you don't have to be a programmer.

What is CGI ?

Common Gateway Interface or CGI is a program that can interact with an html form on your web site, and processes the results on your server using a cgi script. The result generated is a dynamic web page. The cgi script is written in a language called PERL ("practical extraction and reporting language").

Uses of CGI scripts

CGI scripts are most commonly used for creating user interaction with a html form on your web site. Other uses include: autoresponders, shopping carts, counters, mailing list managers, ad management, surveys, polls, discussion boards, content management, calendars and click tracking.

There are 100s of free cgi scripts that can be found on the Net. Just do a search on Google for "free cgi scripts" or visit the resources at the end of this article.

We will create an html email form to collect the name, email address and comments of subscribers using a secure cgi formmail script. An automatic confirmation will be sent and the results of the email form will be passed on to your email address.

Steps to installing your own cgi script

1. Check that your web host supports CGI - your web host will have a cgi-bin folder installed on the server. The cgi-bin is a special directory in the server where all the files which require security are kept. This is where you will upload your cgi script once it has been modified.

2. Download the cgi script - this is a secure cgi formmail script. Spammers can't access and harvest your email address from this script.

http://nms-cgi.sourceforge.net/formmail.zip

3. Read the documentation that comes with the script - this will give you a thorough understanding what changes you need to make to have it work correctly with your web site and server. It will also provide you with some examples.

Editing your script

4. Open and edit your cgi script using notepad (don't use an html editor as this can create errors).

5. Remove the html tags from the script (at the top and bottom).

6. Change the path to perl to: #!/usr/bin/perl -wT (this is the first line of the script to be edited).

7. The section of the cgi script shown below, are the other minimum fields to fill out in the script (replace the fields in the script you downloaded with the changed fields in the script below).

# USER CONFIGURATION SECTION # -------------------------- # Modify these to your own settings. You might have to # contact your system administrator if you do not run # your own web server. If the purpose of these # parameters seems unclear, please see the README file. # BEGIN { $DEBUGGING = 1; $emulate_matts_code= 0; $secure = 1; $allow_empty_ref = 1; $max_recipients = 1; $mailprog = '/usr/lib/sendmail -oi -t'; $postmaster = 'youraddress@yourdomain.com'; @referers = qw(yourdomain.com); @allow_mail_to = qw(); @recipients = (); %recipient_alias = ('siteowner' => 'youraddress@yourdomain.com',); @valid_ENV = qw(REMOTE_HOST REMOTE_ADDR REMOTE_USER HTTP_USER_AGENT); $locale = ''; $charset = 'iso-8859-1'; $date_fmt = '%A, %B %d, %Y at %H:%M:%S'; $style = ''; $no_content = 0; $double_spacing = 1; $wrap_text = 0; $wrap_style = 1; $send_confirmation_mail = 0; $confirmation_text = <<'END_OF_CONFIRMATION'; From: youraddress@yourdomain.com Subject: Subject of Your Contact Form

(short note here->> )Thank you for your interest. We will respond shortly.

END_OF_CONFIRMATION # # USER CONFIGURATION << END >> # ---------------------------- # (no user serviceable parts beyond here) --------------------------------------------------------------------------------

$postmaster = Who's sending the email @referrers = Domains that are allowed to host the script %recipient_alias = Whom the script will send email to

In my form:


You can see how the siteowner variables match up in the .pl script and in my form. This way, nobody can tell what address the form is being emailed to!

8. Rename your cgi script - name your script something else besides formmail (ie contactus.pl), as this is the most common name people use. This will prevent spammers from harvesting your email address.

9. Create your html form (contactus.htm).

[an error occurred while processing this directive]