Perl Apprenticeship Site
The installation of the Perl Apprentice site involves several steps.
You will need Apache with mod_perl installed, as well as the MySQL DBMS installed and running.
Obviously, you will need Mason, at least version 1.10. The latest 1.1x or 1.2x version is strongly recommended. This site will not work with 1.0x or earlier.
Additionally, you will need the following Perl modules:
- Apache::Request 0.33+ # apt-get install libapache-request-perl
- Digest::SHA1 #
- Lingua::EN::Inflect # apt-get install liblingua-en-inflect-perl
- Time::Piece 1.0+
- URI and URI::Escape (both in the URI distribution)
The site is coded in a way that assumes that your component root and document root are the same. The site will not work properly if this is not the case.
The installation itself requires that you install Module::Build.
Start the installation with the following command:
perl Build.PL ./Build ./Build test ./Build install (this step may need to be done as the superuser) Writing /usr/local/lib/perl/5.8.4/auto/Module/Build/.packlist
This will install the site's Mason components and Perl modules,, and it will set up the database instance used by the site.
wget http://www.masonbook.com/source/Apprentice-0.19.tar.gz perl Build.PL vi insert_dummy_data.pl vi /usr/lib/perl/5.8/Apprentice/Data.pm DB_NAME, DB_USER
The second and final step is to configure Apache. Assuming that this is a fresh Apache install, with a document root of /var/www, the needed Mason configuration looks like this:
PerlSetVar MasonDataDir /path/to/data/dir # this can be any directory you like PerlSetVar MasonArgsMethod mod_perl
PerlSetVar MasonAllowGlobals $Schema PerlAddVar MasonAllowGlobals $User
<Location /var/www> SetHandler perl-script PerlHandler HTML::Mason::ApacheHandler </Location>
Once this has been added, restart the Apache server. You should now be able to view the Perl Apprentice site through your Apache server.
A single, admin level, account has been created. The user name for this account is "admin" and the password is "fayewong".
The htdocs/lib/set_login_cookie.mas and htdocs/users/logout.html components specifies "apprentice.perl.org" as a domain. You will need to change this if you want to run the code on your own system.