![]() | |||||||||||||||||||
|
CONFIG Use with Apache. Copy the ./site/eg directory from the ASP installation to your Apache document tree and try it out! You have to put AllowOverride Allin your <Directory> config section to let the .htaccess file in the ./site/eg installation directory do its work. If you want a STARTER config file, just look at the .htaccess file in the ./site/eg directory. Here is a Location directive that you might put in a *.conf Apache configuration file. Set the optional ones if you want, the defaults are fine. The settings are documented below. # Generic apache directives to make asp start ticking. <Location /asp/> SetHandler perl-script PerlHandler Apache::ASP PerlSetVar Global /tmp </Location>You can use the same config in .htaccess files without the Location tag. I use the <Files ~ (\.asp)> tag in the .htaccess file of the directory that I want to run my asp application. This allows me to mix other file types in my application, static or otherwise. Again, please see the ./site/eg directory in the installation for some good starter .htaccess configs, and see them in action on the example scripts.
Global
Global is the nerve center of an ASP application, in which
the global.asa may reside, which defines the web application's
event handlers.
CookiePath
URL root that client responds to by sending the session cookie.
If your asp application falls under the server url "/asp",
then you would set this variable to /asp. This then allows
you to run different applications on the same server, with
different user sessions for each application.
GlobalPackage
Perl package namespace that all scripts, includes, & global.asa
events are compiled into. By default, GlobalPackage is some
obsure name that is uniquely generated from the file path of
the Global directory, and global.asa file. The use of explicitly
naming the GlobalPackage is to allow scripts access to globals
and subs defined in a perl module that is included with commands like:
UniquePackages
default 0. Set to 1 to emulate pre-v.10 ASP script compilation
behavior, which compiles each script into its own perl package.
AllowSessionState
Set to 0 for no session tracking, 1 by default
If Session tracking is turned off, performance improves,
but the $Session object is inaccessible.
SessionTimeout
Default 20 minutes, when a user's session has been inactive for this
period of time, the Session_OnEnd event is run, if defined, for
that session, and the contents of that session are destroyed.
SecureSession
default 0. Sets the secure tag for the session cookie, so that the cookie
will only be transimitted by the browser under https transmissions.
ParanoidSession
default 0. When true, stores the user-agent header of the browser
that creates the session and validates this against the session cookie presented.
If this check fails, the session is killed, with the rationale that
there is a hacking attempt underway.
Debug
1 for server log debugging, 2 for extra client html output
Use 1 for production debugging, use 2 for development.
Turn off if you are not debugging.
BufferingOn
default 1, if true, buffers output through the response object.
$Response object will only send results to client browser if
a $Response->Flush() is called, or if the asp script ends. Lots of
output will need to be flushed incrementally.
StatINC
default 0, if true, reloads perl libraries that have changed
on disk automatically for ASP scripts. If false, the www server
must be restarted for library changes to take effect.
StatINCMatch
default undef, if defined, it will be used as a regular expression
to reload modules that match as in StatINC. This is useful because
StatINC has a very high performance penalty in production, so if
you can narrow the modules that are checked for reloading each
script execution to a handful, you will only suffer a mild performance
penalty.
SessionSerialize
default 0, if true, locks $Session for duration of script, which
serializes requests to the $Session object. Only one script at
a time may run, per user $Session, with sessions allowed.
SoftRedirect
default 0, if true, a $Response->Redirect() does not end the
script. Normally, when a Redirect() is called, the script
is ended automatically. SoftRedirect 1, is a standard
way of doing redirects, allowing for html output after the
redirect is specified.
NoState
default 0, if true, neither the $Application nor $Session objects will
be created. Use this for a performance increase. Please note that
this setting takes precedence over the AllowSessionState setting.
StateDir
default $Global/.state. State files for ASP application go to
this directory. Where the state files go is the most important
determinant in what makes a unique ASP application. Different
configs pointing to the same StateDir are part of the same
ASP application.
StateManager
default 10, this number specifies the numbers of times per SessionTimeout
that timed out sessions are garbage collected. The bigger the number,
the slower your system, but the more precise Session_OnEnd's will be
run from global.asa, which occur when a timed out session is cleaned up,
and the better able to withstand Session guessing hacking attempts.
The lower the number, the faster a normal system will run.
StateDB
default SDBM_File, this is the internal database used for state
objects like $Application and $Session. Because an %sdbm_file hash has
has a limit on the size of a record / key value pair, usually 1024 bytes,
you may want to use another tied database like DB_File.
Filter
On/Off,default Off. With filtering enabled, you can take advantage of
full server side includes (SSI), implemented through Apache::SSI.
SSI is implemented through this mechanism by using Apache::Filter.
A sample configuration for full SSI with filtering is in the
./site/eg/.htaccess file, with a relevant example script ./site/eg/ssi_filter.ssi.
PodComments
default 1. With pod comments turned on, perl pod style comments
and documentation are parsed out of scripts at compile time.
This make for great documentation and a nice debugging tool,
and it lets you comment out perl code and html in blocks.
Specifically text like this:
DynamicIncludes
default 0. SSI file includes are normally inlined in the calling
script, and the text gets compiled with the script as a whole.
With this option set to TRUE, file includes are compiled as a
separate subroutine and called when the script is run.
The advantage of having this turned on is that the code compiled
from the include can be shared between scripts, which keeps the
script sizes smaller in memory, and keeps compile times down.
CgiHeaders
default 0. When true, script output that looks like HTTP / CGI
headers, will be added to to the HTTP headers of the request.
So you could add:
Clean
default 0, may be set between 1 and 9. This setting determine how much
text/html output should be compressed. A setting of 1 strips mostly
white space saving usually 10% in output size, at a performance cost
of less than 5%. A setting of 9 goes much further saving anywhere
25% to 50% typically, but with a performance hit of 50%.
MailHost
The mail host is the smtp server that the below Mail* config directives
will use when sending their emails. By default Net::SMTP uses
smtp mail hosts configured in Net::Config, which is set up at
install time, but this setting can be used to override this config.
MailErrorsTo
No default, if set, ASP server errors, error code 500, that result
while compiling or running scripts under Apache::ASP will automatically
be emailed to the email address set for this config. This allows
an administrator to have a rapid response to user generated server
errors resulting from bugs in production ASP scripts. Other errors, such
as 404 not found will be handled by Apache directly.
MailAlertTo
The address configured will have an email sent on any ASP server error 500,
and the message will be short enough to fit on a text based pager. This
config setting would be used to give an administrator a heads up that a www
server error occured, as opposed to MailErrorsTo would be used for debugging
that server error.
MailAlertPeriod
Default 20 minutes, this config specifies the time in minutes over
which there may be only one alert email generated by MailAlertTo.
The purpose of MailAlertTo is to give the admin a heads up that there
is an error at the www server. MailErrorsTo is for to aid in speedy
debugging of the incident.
|
||||||||||||||||||
Copyright (c) 1998-1999, Joshua Chamas, Chamas Enterprises Inc. |