Perl Apprenticeship Site

来自开放百科 - 灰狐
(版本间的差异)
跳转到: 导航, 搜索
 
(未显示1个用户的1个中间版本)
第8行: 第8行:
  
 
Additionally, you will need the following Perl modules:
 
Additionally, you will need the following Perl modules:
* Apache::Request  0.33+
+
* Apache::Request  0.33+ # apt-get install libapache-request-perl
* Digest::SHA1
+
* Digest::SHA1 #
 
* Email::Valid
 
* Email::Valid
 
* HTML::FromText
 
* HTML::FromText
* Lingua::EN::Inflect
+
* Lingua::EN::Inflect # apt-get install liblingua-en-inflect-perl
 
* MIME::Lite
 
* MIME::Lite
 
* Time::Piece  1.0+
 
* Time::Piece  1.0+
第28行: 第28行:
 
  Writing /usr/local/lib/perl/5.8.4/auto/Module/Build/.packlist   
 
  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.
 
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 insert_dummy_data.pl
  use lib '//var/www/mason/html/my/lib';
+
  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:
 
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:
第51行: 第54行:
  
 
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.
 
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.
 +
 +
[[category:perl]]

2013年2月14日 (四) 10:41的最后版本

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+ # apt-get install libapache-request-perl
  • Digest::SHA1 #
  • Email::Valid
  • HTML::FromText
  • Lingua::EN::Inflect # apt-get install liblingua-en-inflect-perl
  • 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.

wget http://search.cpan.org/CPAN/authors/id/K/KW/KWILLIAMS/Module-Build-0.2806.tar.gz

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:

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.

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

变换
操作
导航
工具箱