Perl Apprenticeship Site

来自开放百科 - 灰狐
2007年2月20日 (二) 14:10Allen (讨论 | 贡献)的版本

(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转到: 导航, 搜索

http://apprentice.perl.org/

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+
  • Digest::SHA1
  • Email::Valid
  • HTML::FromText
  • Lingua::EN::Inflect
  • MIME::Lite
  • 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

This will ask you several questions. Then run:

 ./Build
 ./Build install

This will install the site's Mason components and Perl modules,, and it will set up the database instance used by the site.

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:

PerlModule  Apprentice
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.

分享您的观点
个人工具
名字空间

变换
操作
导航
工具箱