UserLand Software
Scripting Links

Content Server

Setting Up

Email Publishing

FTP Publishing

CGI Publishing

Talking to Your Users

Publisher Menu

Open Folders

File Readers

Hooks

Browser Tips

Server Tips

Q & A

Pointers

Change Notes


Server Tips

We've been running a server running UserLand Frontier since September 1995. We've discovered a number of things along the way that will help keep your server stable and running at its fastest.


Web server should be frontmost

Make sure your webserver is always frontmost. One way to do this is with a Frontier agent that wakes up now and again and brings it to the front.

Our agent looks like this:

if webstar.isRunning ()
   webstar.bringToFront ()
clock.sleepFor (300)

The above script, which we store at system.agents.webstarAgent, wakes up every 5 minutes and brings WebStar (the server software we're running) to the front.


Frontier should not be hidden

Do not hide Frontier in the background. It should be visible but not frontmost.

Other applications, especially Filemaker Pro, should be hidden in the background. On our server, we hide Filemaker, AIMS, NetPresenz, and ListStar in the background.


Avoid multiple Startup Items

We've noted that crashes can be caused by more than one application opening at a time. Many people place all their server apps and databases in the Startup Items folder, but we've found this to be a cause of instability.

Instead, make your Frontier your only startup item, and place a script in Frontier's startup scripts table (@system.startup) that launches your applications one-by-one and opens necessary databases and files. Leave a few seconds buffer between opening each application.

You'd be surprised how much difference this can make. If you have any questions about this, consult Frontier documentation or the "Frontier Webmaster list".


QuickTime should be in your Extensions folder

Though it seems counter-intuitive, there are behind-the-scenes functions the QuickTime extension performs that are helpful to Frontier. You should use the latest version of the QuickTime extension -- at this writing it's version 2.5.

If your server is a PowerPC, also be sure to include the QuickTime PowerPlug extension.

Avoid, at this writing, all QuickTime MPEG extensions, including the new Thread Library that comes with this extension. Also avoid QuickTime Conferencing and QuickTime TV.


Run the latest versions of AppleScriptLib and ObjectSupportLib

If your server is a PowerPC, you should have AppleScriptLib and ObjectSupportLib files in your Extensions folder.

The latest version of AppleScriptLib (at this writing) is 1.1. The latest version of ObjectSupportLib is 1.2, and it's available for downloading:

ftp://ftp.scripting.com/apple/objectSupportLib.sit.hqx


Avoid 7.x System Software

Rule of thumb: don't use system 7.x software: always run an intermediate update, a system 7.x.y. For instance, 7.5.5 is good for servers, but 7.6 is not. Wait to upgrade until an update to 7.6 (such as 7.6.1 or whatever) is available.


Never run a web browser on your server

Running a web browser on your server is a sure-fire way to crash your server. Period. It will happen.

Avoid as much as possible running any client applications on your server machine, including email and FTP clients.


Never copy a 'used' Frontier root from another machine to your server

Your web server should always run a 'clean' root, as downloaded from http://www.scripting.com/frontier/

To update your root, export scripts and objects from another machine and import them into your new root. Do not simply copy the entire root file to your server.

When installing Frontier suites and objects written by other developers, always follow the directions in installing them into your server's root. Do not install them into another machine's root and then copy the installed objects to the server.


Backup frequently

As often as possible, backup the Frontier root on your server. In addition, run the Batch Exporter script frequently.

When a new version of Frontier is released, it's a good idea to download the entire package and use the new, clean root. If you've used Batch Exporter to export your old root, you can then import your objects that need to be loaded into the new root.

This is a little extra effort, but it has several benefits: it helps with stability; it helps ensure that your root is not corrupt; it helps you to be organized; and it helps keep your root slim and free of old, no-longer-used scripts and objects.


Avoid automated Frontier object importing

Some people run agents that automatically import uploaded Frontier objects into their server's Frontier root. Our experience with this has shown it to be a potential cause of instability. If you can avoid this, do so.

Though it's a manual solution, a remote system such as Timbuktu Pro is a better solution.


Use Timbuktu Pro 3.0.x

If you use Timbuktu Pro, do not use any version older than 3.0. There are conflicts with newer versions of System software that will cause your server to hang or freeze. If you're using an older version of Timbuktu, upgrade right away.


Frontier memory allocation

Give Frontier and your web server as much memory as you can.

We give Frontier 5 MB on our server. 2.5MB is a low end: try to provide at least 3.5 MB.


Remove unused server plug-ins

If you're running a web server that supports W*API or MOS API plug-ins, only run the plug-ins that you're actually using. Remove all others from your Plug-Ins folder.

Also: don't be afraid to run plug-ins from vendors other than the server vendor. In some cases, shareware plug-ins have proven to be faster and more reliable than plug-ins that do the same thing that come from the server vendor.

Nevertheless: do your research and be skeptical -- there are crashy plug-ins on the market.


Re-start your server occassionally

We've found that it's a good idea to re-start your server occassionally. Once a week should be sufficient.


Run Autoboot and Okey-Dokey; don't run Keep It Up

Autoboot really will re-start your server for you in many cases. Very handy.

Okey-Dokey is a little utility that automatically presses the default button in modal dialogs that may appear. Ideally, no apps on your server will display any modal dialogs, but you never know.

Don't run Keep It Up. If an app goes, down, it's better to re-start your server. Keep It Up will try to re-launch your application, usually causing a crash of some kind.


Get the news every day

Check in at MacInTouch and Scripting News pages every day for the latest news.

Even if you don't have time to participate, at least monitor the messages on the "Frontier Webmaster list" and your server software's mailing list.

Stay up-to-date with software running on your computer, but do not always install new software the moment it comes out. If it's not a critically-awaited update, you may want to wait a couple days to hear what other people are saying about the update. Your best bet is to check the news pages and mailing lists.


Use Net Events

If you're doing TCP scripting on your server (and Content Server does some of this) use Net Events rather than the built-in tcp UCMD. The latest version of the TCP commands uses Net Events.

A separate TCP application seems inherently more stable than running TCP commands through a UCMD.


Use client-side image maps and an image map plug-in

With image maps, you can provide a client-side map in your html code and provide a link to a server-side image map CGI. Newer browsers will use the client-side map, reducing the load on your server.

In addition, we've found that the various image map plug-ins available are far more stable (and faster) than separate image map applications. (This is not a trivial issue.) Always be sure to use the latest version of whatever image map plug-in you're using.


Turn off file-sharing, if possible

If you can, turn off file-sharing and disable AppleShare.

Unfortunately, NetPresenz requires file-sharing. Other, commercial FTP server software does not, but we haven't evaluated any of these packages. We've found NetPresenz 4.1 to be stable -- but it does require file-sharing to be turned on.


Watch total TCP connections

MacTCP users are limited in the number of TCP connections available. Add up the number of connections your server may receive (total web server, ftp, email, and so on connections) and keep this, if possible, under 50.

Open Transport does not have the same limitation on the number of connections. Nevertheless, it's a good idea to keep the number of connections for each server app as low as possible to save on overhead. Many applications will run a separate thread for each possible incoming TCP connection, whether or not the connection is in use.


OTTCPSlowLinkTuneup

At this writing, the current version of Open Transport is 1.1.2. It has one major flaw when run on webservers: the connection to clients on slow, modem links is terrible.

Definitely run the OTTCPSlowLinkTuneup patch on your server. It makes a huge difference in your server's connections to slower clients.

Place it in the Startup Items folder (yes, an exception to the rule above about multiple startup items).

This patch is safe in that it doesn't make any permanent changes. It only patches RAM. So it can be removed from you server simply by pulling it out of your Startup Items folder.

Download:

http://www.macintouch.com/otslow.sit.hqx


Turn off DNS lookup

Most servers allow you to turn off DNS lookups on incoming connections. Turn it off: your server doesn't need to know the domain name of everybody that visits.

If you want to know where people are coming from, use one of the many available server statistics programs to generate a report for you. Most of these will do DNS lookups for you.

There are several log-rolling utilities available. Use one of these to turn over your log periodically (we do every night at 2 a.m.) and run a new report.


Close Windows

When you're not directly administering your server, there is no need for any visible windows to be open.

If your server software has a console window, close it. If you have any Finder windows open, close them.

The only visible window should be Frontier's main window. Your server should look as if nothing at all is happening, as if it's sitting there bored -- even when it's serving 100,000 hits a day.


Use CGIs and SSI only when needed

Many people use server-side includes when they'd be better served by Frontier's web site creation framework.

For instance, using an SSI tag to put the last-modified date on an html page is a total waste of your server computer's time. Use Frontier to time-stamp your pages when they are rendered.

Frontier can render pages based on a template. You can include external files when the pages are rendered. And so on. Pages that don't need to change every time they are requested by a browser should be rendered as static html rather than re-rendered via SSI at every request.

Many other uses of SSI -- for instance, placing the current time on a page -- are usually wastes of CPU cycles.

There are plenty of legitimate reasons to use SSI and CGIs. The message: be economical. Think about when to render static pages and when to use SSI and CGIs. Think of SSI and CGIs as costing more, and think of yourself as Scrooge.


Remove unneeded extensions and control panels

Two traditionally buggy control panels are Apple Menu Options and General Controls. Remove these from your Control Panels folder.

Remove extensions you don't need. Do you need, for instance, ColorSync on a server, or Adobe Type Manager or PrinterShare? No. Take these out of your Extensions folder.

Also: be especially sure not run user interface enhancers (such as Aaron) on your server. They're not only useless on a server, but they can slow it down and contribute to server instability.

Does your server need a Control Strip? Probably not.


Virtual Memory and RAM Doubler

Your server should have as much RAM as possible. If you need more RAM, buy more RAM. If possible, avoid turning on virtual memory.

Definitely, at all costs, avoid RAM Doubler and other doubler-type extensions, control panels, and utilities.


Don't edit files live

Avoid editing files live on your server. Edit your pages on a separate machine. Don't run BBEdit, SimpleText, Claris Home Page, or other editors on your server.


Back up your server's hard drive

It's a good idea to back up your server's hard drive as often as possible -- every night if you can. It's also a good idea to keep a copy of the hard drive at a separate location.

Some server co-location providers will provide these services for an extra $20 or so a month. Choose one that does.


Get as much bandwidth as you can

If you're running a server on a 28.8 or other slow line consider placing graphics and multimedia files on a T1 server. You can rent space fairly cheaply. Your server need only serve text files and CGIs.

There are server plug-ins on the market which will handle uploading your graphics to a second server for you. You may want to look into these "accelerators." (They'll even update your image references transparently.)

If possible, put your server on a T1 or T3 line. If you do not have access to such a connection, consider co-location as a reasonable and economic option.

Next: Q & A


This page was built on a Macintosh running Frontier. Last modified 4/15/97; 1:10:44 PM. Copyright 1997 Userland Software.