Articles : Intro to Apache2::ASP : Page 1


  Next Page >>
Page: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10

 

Anatomy of an Apache2::ASP Website
The top-level folders in an Apache2::ASP website
The top-level folders in an Apache2::ASP website.
There's more to an Apache2::ASP website than a bunch of ASP scripts lying around.
Let's look at each folder briefly, before going into their contents.

» conf - Configuration files go here.
» etc - YAML files, word dictionaries, certificates, etc.
» handlers - Form-processing modules.
» htdocs - Your ASP scripts and your GlobalASA.pm.
» lib - Application-specific modules, such as Class::DBI or DBIx::Class modules.
» MEDIA - Where files are uploaded to.
» PAGE_CACHE - Where the "compiled" version of your ASP scripts live.
» t - Your website's unit tests go here.

 

Contents of the /conf folder
Contents of the /conf folder.
Unless you have other needs, /conf will only contain 2 files:
  • apache2-asp-config.xml
  • httpd.conf
apache2-asp-config.xml:
You can view an example of this file here.
All of your application's configuration data goes in this file.

httpd.conf:
You can view an example of this file here.
You will also need to include this file in your main httpd.conf, using Include /path/to/your/apache2-asp/httpd.conf

 

Contents of the /etc folder
Contents of the /etc folder.
This is a great place to put your *.yaml files.
If you want some information about YAML, take a look at the YAML module on CPAN.

Apache2::ASP uses Data::Properties::YAML to parse and handle the YAML files themselves.

properties.yaml:
This is a great place to store all diagnostics and validation error messages (i.e. "Email address is a required field" or "That password is too short").
You can download an example here.

test_fixtures.yaml:
This file figures in later when we discuss unit-tests for your website. We will discuss it more later.
You can download an example here.

 

Contents of the /handlers folder
Contents of the /handlers folder.
/handlers contains your "handlers" - usually in the form of Apache2::ASP::FormHandler sub-classes.

More on handlers later.

 

Contents of the /htdocs folder
Contents of the /htdocs folder.
/htdocs is where your ASP scripts and other website files (images, javascripts, css, etc) go.

 

Contents of the /lib folder
Contents of the /lib folder.
/lib is where your application-specific classes go. Class::DBI or DBIx::Class classes, for example, would go here.

 

Contents of the /MEDIA and /PAGE_CACHE folders
Contents of the /MEDIA and /PAGE_CACHE folders.
/MEDIA/[application_name] is where files are uploaded to (by default).

/PAGE_CACHE/[application_name] is where the "compiled" version of your ASP scripts are stored.

 

Contents of the /t folder
Contents of the /t folder.
/t will contain all of your unit tests. That's right - unit tests for your website.

The whole point of Apache2::ASP is to allow the correct use of unit tests and Devel::Cover to generate nice code-coverage reports so you know whether your website has some gaping security hole or whatever.

 

  Next Page >>
Page: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10