Chinaunix首页 | 论坛 | 博客
  • 博客访问: 308991
  • 博文数量: 106
  • 博客积分: 1948
  • 博客等级: 上尉
  • 技术积分: 947
  • 用 户 组: 普通用户
  • 注册时间: 2010-11-27 00:11
文章分类

全部博文(106)

文章存档

2014年(1)

2013年(14)

2012年(61)

2011年(30)

分类: 系统运维

2012-01-24 23:11:29

ubuntu系统
1安装:

其他的模块就不多说了
百度搜集来各种安装方法,不管三七二十一先装上
sudo perl -MCPAN -e shell

install Catalyst
install Catalyst::Devel
install Catalyst::View::TT     #Template Toolkit模块 之前可能会自动装上
install DBIx::Class
install Catalyst::Model::DBIC::Schema


Catalyst 常用的插件列表(转自)

1
2
3
4
5
6
7
8
Catalyst::Plugin::Authentication
Catalyst::Plugin::Authorization::Roles
Catalyst::Plugin::ConfigLoader
Catalyst::Plugin::Session
Catalyst::Plugin::Session::State::Cookie
Catalyst::Plugin::Session::Store::FastMmap
Catalyst::Plugin::StackTrace
Catalyst::Plugin::Static::Simple

如果安装过程中出现错误,到~/.cpan/build/找相应的模块编译安装

2建立第一个项目 
cd ~www/
catalyst.pl myApp
cd myApp

下面是目录结构
  1. ~/www/myApp$ tree
  2. .
  3. ├── Changes
  4. ├── lib
  5. ?? ├── myApp
  6. ???? ├── Controller
  7. ?????? └── Root.pm
  8. ???? ├── Model
  9. ???? └── View
  10. ?? └── myApp.pm
  11. ├── Makefile.PL
  12. ├── myapp.conf
  13. ├── myapp.psgi
  14. ├── README
  15. ├── root
  16. ?? ├── favicon.ico
  17. ?? └── static
  18. ?? └── images
  19. ?? ├── btn_120x50_built.png
  20. ?? ├── btn_120x50_built_shadow.png
  21. ?? ├── btn_120x50_powered.png
  22. ?? ├── btn_120x50_powered_shadow.png
  23. ?? ├── btn_88x31_built.png
  24. ?? ├── btn_88x31_built_shadow.png
  25. ?? ├── btn_88x31_powered.png
  26. ?? ├── btn_88x31_powered_shadow.png
  27. ?? └── catalyst_logo.png
  28. ├── script
  29. ?? ├── myapp_cgi.pl
  30. ?? ├── myapp_create.pl
  31. ?? ├── myapp_fastcgi.pl
  32. ?? ├── myapp_server.pl
  33. ?? └── myapp_test.pl
  34. └── t
  35.     ├── 01app.t
  36.     ├── 02pod.t
  37.     └── 03podcoverage.t

  38. 10 directories, 25 files

启动

  1. script/myapp_server.pl
  2. [debug] Debug messages enabled
  3. [debug] Statistics enabled
  4. [debug] Loaded plugins:
  5. .----------------------------------------------------------------------------.
  6. | Catalyst::Plugin::ConfigLoader 0.30 |
  7. '----------------------------------------------------------------------------'

  8. [debug] Loaded dispatcher "Catalyst::Dispatcher"
  9. [debug] Loaded engine "Catalyst::Engine"
  10. [debug] Found home "/var/www/myApp"
  11. [debug] Loaded Config "/var/www/myApp/myapp.conf"
  12. [debug] Loaded components:
  13. .-----------------------------------------------------------------+----------.
  14. | Class | Type |
  15. +-----------------------------------------------------------------+----------+
  16. | myApp::Controller::Root | instance |
  17. '-----------------------------------------------------------------+----------'

  18. [debug] Loaded Private actions:
  19. .----------------------+--------------------------------------+--------------.
  20. | Private | Class | Method |
  21. +----------------------+--------------------------------------+--------------+
  22. | /default | myApp::Controller::Root | default |
  23. | /end | myApp::Controller::Root | end |
  24. | /index | myApp::Controller::Root | index |
  25. '----------------------+--------------------------------------+--------------'

  26. [debug] Loaded Path actions:
  27. .-------------------------------------+--------------------------------------.
  28. | Path | Private |
  29. +-------------------------------------+--------------------------------------+
  30. | / | /index |
  31. | /... | /default |
  32. '-------------------------------------+--------------------------------------'

  33. [info] myApp powered by Catalyst 5.90007
  34. HTTP::Server::PSGI: Accepting connections at http://0:3000/
这时可以在浏览器里输入 就可以看到一个catalyst 的第一个页面了

---------------------------------------------------------------------------------------------------------------------------------

有问题看看手册
  208  perldoc Catalyst
  209  perldoc Catalyst::Manual
  210  perldoc Catalyst::Manual::Intro


未完待续


阅读(774) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~