Apache::ASP::Install

<% Web Applications with Apache & mod_perl %>
| INTRO
% | INSTALL
| CONFIG
| SYNTAX
| EVENTS
| OBJECTS
| SSI
| SESSIONS
| XML/XSLT
| CGI
| PERLSCRIPT
| STYLE GUIDE
| FAQ
| TUNING
| CREDITS
| SUPPORT
| SITES USING
| TESTIMONIALS
| RESOURCES
| TODO
| CHANGES
| LICENSE
| EXAMPLES
| INSTALL
The installation process for Apache::ASP is geared towards those with experience with Perl, Apache, and unix systems. For those without this experience, please understand that the learning curve can be significant. But what you have at the end will be a web site running on superior open source software.
If installing onto a Windows operating system, please see the section titled Win32 Install.
Need Help | Quick Start
Download and CPAN Install | Build static Apache and mod_perl for Apache 1.3.x
Regular Perl Module Install | Win32 / Windows Install
Modern Linux Distributions | WinME / 98 / 95 flock() workaround
Need Help
Often, installing the mod_perl part of the Apache server can be the hardest part. If this is the case for you, check out the FAQ and SUPPORT sections for further help, as well as the "Modern Linux Distributions" notes in this section.
Please also see the mod_perl site at http://perl.apache.org/ which one ought to give a good read before undertaking a mod_perl project. Download and CPAN Install
You may download the latest Apache::ASP from your nearest CPAN, and also:
      http://search.cpan.org/dist/Apache-ASP/
      http://cpan.org/modules/by-module/Apache/
As a Perl developer, you should make yourself familiar with the CPAN.pm module, and how it may be used to install Apache::ASP, and other related modules. The easiest way to install Apache::ASP for the first time from Perl is to fire up the CPAN shell like:
     shell prompt> perl -MCPAN -e shell
      ... configure CPAN ...
      ... then upgrade to latest CPAN ...
     cpan> install CPAN
      ...
     cpan> install Bundle::Apache::ASP
Installing the Apache::ASP bundle will automatically install all the modules Apache::ASP is dependent on as well as Apache::ASP itself. If you have trouble installing the bundle, then try installing the necessary modules one at a time:
     cpan> install MLDBM
     cpan> install MLDBM::Sync
     cpan> install Digest::MD5  *** may not be needed for perl 5.8+ ***
     cpan> install Apache::ASP
For extra/optional functionality in Apache::ASP 2.31 or greater, like support for FormFill, XSLT, or SSI, you can install this bundle via CPAN:
      cpan> install Bundle::Apache::ASP::Extra
Regular Perl Module Install
If not doing the CPAN install, download Apache::ASP and install it using the make or nmake commands as shown below. Otherwise, just copy ASP.pm to $PERLLIB/site/Apache
      > perl Makefile.PL
      > make
      > make test
      > make install

      * use nmake for win32
Please note that you must first have the Apache Web Server & mod_perl installed before using this module in a web server environment. The offline mode for building static html at ./cgi/asp-perl may be used with just perl. Modern Linux Distributions
If you have a modern Linux distribution like CentOS or Ubuntu, you will likely have the easiest path by using the repository tools to automatically install mod_perl and Apache before installing Apache::ASP via CPAN.
For example for CentOS, this will install mod_perl into your apache httpd, the latter likely being installed already by default on your server:
      bash> sudo yum install mod_perl-devel.x86_64
For Ubuntu this would be done like this:
      bash> sudo apt-get install libapache2-mod-perl2
Quick Start
Once you have successfully built the Apache Web Server with mod_perl, copy the ./site/eg/ directory from the Apache::ASP installation to your Apache document tree and try it out! You must put "AllowOverride All" in your httpd.conf <Directory> config section to let the .htaccess file in the ./site/eg installation directory do its work. If you want a starter config file for Apache::ASP, just look at the .htaccess file in the ./site/eg/ directory.
So, you might add this to your Apache httpd.conf file just to get the scripts in ./site/eg working, where $DOCUMENT_ROOT represents the DocumentRoot config for your apache server:
      <Directory $DOCUMENT_ROOT/asp/eg >
        Options FollowSymLinks
        AllowOverride All
      </Directory>
To copy the entire site, including the examples, you might do a raw directory copy as in:
      shell> cp -rpd ./site $DOCUMENT_ROOT/asp
So you could then reference the Apache::ASP docs at /asp/ at your site, and the examples at /asp/eg/ .
This is not a good production configuration, because it is insecure with the FollowSymLinks, and tells Apache to look for .htaccess which is bad for performance but it should be handy for getting started with development.
You will know that Apache::ASP is working normally if you can run the scripts in ./site/eg/ without any errors. Common problems can be found in the FAQ section. Build static Apache and mod_perl for Apache 1.3.x
For a quick build of apache, there is a script in the distribution at ./make_httpd/build_httpds.sh that can compile a statically linked Apache with mod_ssl and mod_perl. Just drop the sources into the make_httpd directory, configure the environments as appropriate, and execute the script like this:
     make_httpd> ./build_httpds.sh
You might also find helpful a couple items:
      Stas's mod_perl guide install section

      Apache Toolbox
People have been using Apache Toolbox to automate their complex builds of Apache 1.3.x with great success. Win32 / Windows Install
If you are on a Win32 platform, like WinNT or Windows 2000, you can download the win32 binaries linked to from:
      http://perl.apache.org/download/binaries.html#Win32
and install the latest perl-win32-bin-*.exe file.
Randy Kobes has graciously provided these, which include compiled versions perl, mod_perl, apache, mod_ssl, as well as all the modules required by Apache::ASP and Apache::ASP itself.
After installing this distribution, in Apache2\conf\perl.conf (pulled in via Apache2\conf\httpd.conf) there's directives that have Apache::ASP handle files placed under the Apache2\asp\ directory. There should be a sample Apache::ASP script there, printenv.html, accessed as http://127.0.0.1/asp/printenv.html which, if working, will print out your environment variables. WinME / 98 / 95 flock() workaround
For those on desktop Windows operation systems, Apache::ASP v2.25 and later needs a special work around for the lack of flock() support on these systems. Please add this to your Apache httpd.conf to fix this problem after mod_perl is installed:
      <Perl>
       *CORE::GLOBAL::flock = sub { 1 };
      </Perl>
      PerlModule  Apache::ASP
Please be sure to add this configuration before Apache::ASP is loaded via PerlModule, or a PerlRequire statement. |