|
Choosing a technology
If you are here, then you are most likely thinking about ways to make maintaining a site quicker
and/or easier.
There are several options available and three of them do not involve using the CGI-BIN server.
Perl CGI
It is possible to create HTML pages "on the fly" using a CGI script. Obvious examples of
this are electronic postcard and guestbook scripts.
Advantages are that variables can be more easily passed between pages and a more customised
approach used.
The disadvantages are that the process will take noticeably longer and you have to contend with
CHMOD and upload modes.
Perl is the most flexible option, but it can be difficult to get the hang of changing file
permissions when you first start using it on a web server.
SSI
Server Side Includes allow you to include the content of one or more files within another
automatically.
This is ideally suited for a site that lends itself to being based on a template system.
The main advantage is that it is simple to use. The drawbacks are slower page loading and
having to use the CGI-BIN server.
PHP
PHP is also available on the CGI-BIN server and in some ways is a more flexible approach.
It basically combines a language similar to C and Perl with the option to include files as with
SSI. The scripting language and the HTML can be placed all in one document, thus saving on
development time.
It also isn't as picky about CHMOD and ASCII or Binary modes.
It's a newer technology than Perl or SSI, so there are fewer freeware scripts available, but
that is changing quite rapidly.
Although there are now at least as many freeware programs available written in PHP as there are
written in Perl, it is a much newer technology. The fact that it can be easier for new users
to start writing in PHP has led to a higher percentage of inferior programs becoming available,
however.
The development team also seem to delight in changing the way the language works, thus causing
older programs to stop working.
Content management
I have seen several scripts designed to make site content management an easier task.
They mostly seem to work on some sort of template system, so that you can design the layout of
the site once and then concentrate on the content. The script will then pour the content into
the layout to create the pages.
Links 2 from Gossamer Threads is a form of content management, although it is specifically
designed for creating pages of links as a Yahoo style directory.
Other scripts are available for other needs, and the range is growing.
Advantages and disadvantages will vary, although one remains the same - they all require the
script and resultant pages to be on the CGI-BIN server.
MySQL
This is a database system, so it will need to be used in conjunction with either Perl or
PHP. It will however make both of those quicker compared to using flat text files to hold
data.
The main advantages are speed and the fact that data held in a MySQL database is not affected by
the 1000 file limit on the CGI-BIN server.
The biggest drawbacks are that it is one more thing to learn and you are forced to use the
CGI-BIN server.
If you have decided that you definitely need to use either Perl or PHP to cope with a very large
site, try to find (or write) a script that uses MySQL.
Remotely hosted services
There are a number of sites that provide remotely hosted Perl and PHP programs of all types.
Bravenet is one of the most popular.
The advantages to using these are that you do not need to worry about installing the programs
yourself, and the servers are generally optimised for whetever type of program they are running,
which potentially makes them faster at peak traffic times.
For example, suppose 1,000 users installed a forum such as phpBB2 on the CGI-BIN server.
Many of the files would be duplicated needlessly. If each had 10 smiley images, that would
mean that there were in fact 10,000 images stored on the server.
A remotely hosted version would only provide users with duplicate copies of
files. In other words, 1,000 users could share the same 10 smiley images and the fewer files
are on a server, the quicker it can access them.
The main disadvantage to using a remotely hosted service is that you are unlikely to be able to
customise the program as much as if you had installed it yourself.
Very few of them allow you to upload images, for instance, and most free hosts (Spaceports
included) will not allow images stored on their servers to be used in pages elsewhere.
This can make it difficult to match the remotely hosted pages with those on your main web
site.
HTML editors
Some HTML editors feature a code library which allow you to include blocks of code from
elsewhere. Usually the code blocks are stored in a specific location, but otherwise they are
similar to using SSI.
Macromedia Dreamweaver has this feature.
The advantages to them are that the code is included by the editor automatically to create
static HTML documents, which makes the resulting pages quicker to load than SSI equivalents.
You also do not have to use the CGI-BIN server for the pages.
The main disadvantage is that if you change one of the included files, any pages using that file
have to be rebuilt and uploaded again.
HTML pre-processors
There are programs available that will allow you to "compile" source files and header files into
resultant HTML files quickly and easily.
They act in a similar way to an SSI capable server in that they search through source files for
special commands and act on them to create HTML documents. The difference is that the
resultant static document is saved, allowing you to upload it to your site.
The advantages and disadvantages are about the same as using an HTML editor with a code library
facility, with the added bonus that you aren't tied to using a particular editor.
There are several shareware and freeware versions available, or you could even attempt to write
one yourself if you have unusual needs.
|