|Home||Pauline's Pages||Howto Articles||Uniquely NZ||Small Firms||Search|
Hypermart provides a very comprehensive set of services matched to the needs of small businesses (and only available for commercial use). It is free, if you accept their pop-up adverts or logos, or you can pay $99 a year to have them removed. A big advantage is that they support CGI (Common Gateway Interface), which is essential for forms, and also have Secure Servers so one can have credit card transactions. They have a lot of users and provide good support. They also provide simple utilities which enable one to upload a page, edit it and do other basic things like making a directory via a web interface which you obviously have to log onto. They also offer access to log files and a lot of useful analysis of visitors. Have a look at http://www.hypermart.net but note they only provide space for business use.
Hypermart and Netmechanic tools Hypermart have links and partner programs which provide a lot of very useful Web Authoring tools. The most useful general utilities are actually those of Netmechanic and they can also be accessed directly at http://www.netmechanic.com. These include a Search Engine submission to 12 popular engines and a number of Utilities to check the site and your pages. The utilities I tried were the link checks, the HTML checks (you can chose the version), Browser compatibility checks and estimates of download times. The more complex tasks are done off-line and when they are complete you are notified by an email which provides a web page address linking to the results which are held for 2 days. A very useful utility takes a .jpg file and shows you what happens if you reduce the memory size - each reduction swops back and forth to the original when you move the cursor over it so you can accurately choose how much degradation you can tolerate.
What is a cgi-bin ? The above sounds fairly simple as is the case when all the hard work has been done for you and you have a framework to modify as on Freeserve. Anywhere else you need to find out a lot of information about the server and what it permits you to do. Firstly one must remember the Script file is a program which you are running on the server - this could run amok and take the server down so often such programs were only allowed to be run from within a single directory in a carefully controlled manner. program put into this directory were very carefully tested and normal users would not be allowed to load programs or they were very careful checked first. This directory was almost always called cgi-bin. Your server may contain scripts you are allowed to use in its cgi-bin. More recently the servers have allowed programs with extension .cgi to run in users directories so you may well find that if a PERL program (usually with extension .pe) is renamed to .cgi it can be run and that the server does sufficient runtime checking to avoid disasters - in the case of p the errors are trapped and you can even look at the error log.
Locations of PERL and Mail programs: I tried to get scripts to run and found that it was not as easy as all this would indicate. Firstly the script needs to know where PERL is located on your server - Hypermart seems to be fairly standard and has the latest PERL 5.003 located at /usr/local/bin/us and for compatibility PERL 4 is also available at /usr/bin/peus one of those two is usually a good bet. You also need to know where the mail program is located and in the case of Hypermart they tell you it is at /var/qmail/bin/qmail-inject . Many servers use SendMail rather than qmail-inject and I do not know where that would normally live.
Permissions and chmod : The next problem is that one has to set up permissions on the cgi-bin scripts so they can be read and executed by yourself and other parts of the system. This is done on a typical UNIX server by a program called chmod and you find references to chmoding to 775 etc. This strange number seems to be an octal number and refers to setting the read, write and execute bits for yourself, your group and the world so 777 sets everything and 775 would prohibit the world from writing your script. HTML documents and images are always set up for you but you do seem to have to set permissions for cgi scripts. Hypermart have utility on the site to do it otherwise WS_FTP can do it via a nice interface but only if you right click the file name you want to change - it does not appear on the menus. Take great care as you can remove your own permissions and then you can do nothing but get in touch with the web space provider and beg.
Uploading S scripts - use ASCII mode: I thought by now I should have it all working but not true. After many hours and surfing round various FAQs etc I discovered that you must upload PERL scripts in ASCII mode, if you do it in Binary which is what I do with everything else they do not work and come back with error 503. I was worried about editing the scripts but it seems that Write does no harm when editing text files and I could work on a .pe or .cgi file without problems. (Notepad has limitations on file size and is much more basic)
PERL scripts for utilities and testing. I have spoken about scripts for FORMs but one does not want to use that for testing and I discovered various PERL utilities such as counters and time displays as well as the very important FormMail at Matt's Script Archive at http://www.worldwidemart.com/ I also did a short online tutorial at User Active at http://www.useractive.com where it takes you through the basics including uploading and running a simple CGI script in PERL. I saved that away for future tests. It looks much like HTML and the output is inserted into the HTML stream returned from the server to the browser.
Executing a PERL program as a SSI: A common way to run a PERL program is as a Server Side Include (SSI) which few of the free ISPs support but is supported on the Hypermart web space that I am using for this job and I did my first tests using simple PERL scripts run as SSis. A typical way to do this is by having a statement like <!--#exec cgi="/cgi-bin/perltest.cgi"--> in your HTML page which asks the server to execute the cgi program perltest.cgi and puts it's output into the HTML stream sent to your browser when the page is accessed.
Peter and Pauline Curtis
Most recent significant revision: 2nd September, 2000