Puma::ServerPages
|
|
CONFIGURING THE SERVERPAGES EXTENSION
Before starting this section, you should have already completed
the base Puma installation.
Configuring the Puma:ServerPages is a little more complicated than the
base system install. You have to:
CONFIGURING APACHE
For this configuration example, we will presume that Apache has
configurations similar to the following
ScriptAlias /cgi-bin/ /var/www/cgi-bin/
or
ScriptAlias /cgi-bin/ /homr/httpd/cgi-bin/
You should find a line similar to this one in the file:
DirectoryIndex index.html index.htm index.cgi
Change the line to include index.psp. It should now look like this:
DirectoryIndex index.psp index.html index.htm index.cgi
You can place the index.psp anywhere in the line, but Apache will look
for the files on the order they are listed, so depending on how your web
site is structured, the precidence may be important.
AddType application/x-httpd-psp .psp Action application/x-httpd-psp /cgi-bin/pumasp.cgi
The above installation instructions are for a simple configuration and
are not intended to be comprehensive or cover all possible
configurations.
Use them as a guide to compliment your guru-like knowledge
of Apache, you Linux stud!
(I'm told flattery makes up for a lot of things.
Does that include poor documentation?)
SETTING UP THE HANDLER
Copy the handler.cgi script from the Puma/ServerPages to cgi-bin
directory of the Apache server.
Rename it, "pumasp.cgi" to make sure it doesn't conflict with any other
handlers you may install.
Next, edit the pumasp.cgi and modify the paths in the first few lines to
match your installation.
If you chose the default paths when you configured Puma, these should not
need to be changed.
CONFIGURING THE WEB SITE
At this point, you should be ready to go!
Here's a sample page to test if everything works:
<html><head> <title>Test PSP Page</title> </head><body> <pre><: use Data::Dumper; print Data::Dumper->Dump([%ENV], ['ENV']); /></pre> </body></html>
This page should dump the web server's %ENV hash to the web browser.
You'll be able to see all kinds of cool parameters like 'PATH_TRANSLATED'
which shows the page you're displaying, 'SERVER_ADDR' showing the IP
address of the server, 'SERVER_PORT' displaying the post the page was
served up on, and much more.
I won't get into these values much in this document, but there will be
the occasional reference to this values Puma's manual pages.
TODO: Describe setup for /etc/puma/config.xml and {webroot}/.config.xml
The next thing to do is add a .config.xml to the main directory of your
web site to configure site specific parameters.
This is entirely optional and not described at all here.
|