View on
John Drago > Apache2-ASP-1.59 > Apache2::ASP::Manual::Installation::Linux


Annotate this POD


Open  3
View/Report Bugs


Apache2::ASP::Manual::Installation::Linux - Installation instructions for Linux


This document describes how to install Apache2::ASP on Linux.


Step 1: Install Apache HTTPD v2.0 or newer

Fedora Core 6 and RHEL4+ both come with Apache2.

You will also need to install the devel libraries. Specifically, you will need the executable apxs, because it is required to compile mod_perl2 and libapreq2.

Step 2: Install mod_perl2

Available at Because of the strange environment requirements of mod_perl2's test suite, installation via CPAN is discouraged.

Instead of installing via CPAN, simply download the latest stable tar.gz archive, extract it and install it like any other Perl module.

The only catch is that you can only make test as a non-root user. Then switch back to root so you can make install.

Step 3: Install libapreq2

Available at

Running make test may also require running as a non-root user.


Once you've installed the prerequisites (see above) you are all set to install Apache2::ASP.

Unfortunately the regular CPAN install won't work. Again, the test suite cannot be run as root unless the nobody user can write to the t/ directory.

Simply download the latest tar.gz file from CPAN and run the following commands:

  % tar -zxvf Apache2-ASP-1.xx.tar.gz
  % cd Apache2-ASP-1.xx
  % perl Makefile.PL
  % make
  % make test
  % make install

Now, when you run the command:

  % perl -MApache2::ASP -e 'print "Hello, World!\n"'

You should see:

  Hello, World!

If instead you see something like:

  Can't locate Apache2/ in @INC (@INC contains: /usr/lib/perl5/5.8.3/i386-linux-thread-multi
  /usr/lib/perl5/5.8.3 /usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/site_
  perl/5.8.2/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi /usr/l
  ib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/s
  ite_perl/5.8.2 /usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site
  _perl /usr/lib/perl5/vendor_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.2/
  i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.1/i386-linux-thread-multi /usr/lib/perl5/
  vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.3 /usr/lib/perl5/vendor
  _perl/5.8.2 /usr/lib/perl5/vendor_perl/5.8.1 /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/ven
  dor_perl .).
  BEGIN failed--compilation aborted.

Then Apache2::ASP was not successfully installed. Repeat the installation process again, but this time, pay attention!.

Installing Apache2::ASP is only part of the deal. You also need to configure a website to run on it.


Assuming your server root is /var/www and your DocumentRoot is /var/www/html then your directory structure would look like this:

  | `- index.asp (All ASP scripts go here, along with images, css, javascript, etc.)
  | +-    (Accessible as
  | `- (Accessible as
  | +- httpd.conf  (to be included by /etc/httpd/conf/httpd.conf)
  | `- apache2-asp-config.xml
  | `- Your application classes go here (i.e. Class::DBI or DBIx::Class modules)
  | `- (Apache must have read/write permissions for this directory)
  | `- (Apache must have read/write permissions for this directory)
    `- (your test files will go here)


The /conf directory should contain only configuration files.

Specifically, it should contain the Apache2::ASP::Manual::ConfigXML and the Apache2::ASP::Manual::HttpdConf file.


Your Handlers go here. All of them.

Learn more about what Handlers are by reading the following pages:

Start with Apache2::ASP::Manual::Handlers


All of your ASP scripts, images, CSS, JavaScript, SWF, PDF and other files go here, just like a regular website.

In addition to your ASP scripts you can also place your file in this directory.

Learn more about the file by reading Apache2::ASP::GlobalASA and Apache2::ASP::Manual::GlobalASA.


This is where uploaded files are stored.

NOTE: Your webserver must be able to both read and write to this directory.


This is where compiled ASP scripts are stored.

"What are compiled ASP scripts?" you ask? When Apache2::ASP::PageHandler prepares your ASP script for execution the first time around, it converts it from ASP markup to a first-class Perl module. Learn more by reading Apache2::ASP::Manual::ASP_Compilation.


Any Perl module that is not a Handler should go here. This includes (for example) your Class::DBI or DBIx::Class modules (or what have you) as well as any other custom, non-CPAN modules that your web application requires.

This directory is automatically added to @INC by Apache2::ASP::Config so you don't have to do it yourself.


It's possible that some bugs have found their way into this release.

Use RT to submit bug reports.


Please visit the Apache2::ASP homepage at to see examples of Apache2::ASP in action.


John Drago


Copyright 2007 John Drago, All rights reserved.

This software is free software. It may be used and distributed under the same terms as Perl itself.

syntax highlighting: