亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 3576 | 回復(fù): 2
打印 上一主題 下一主題

Catalyst Nginx 在web應(yīng)用中如何協(xié)作 [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2014-03-20 21:16 |只看該作者 |倒序瀏覽
   Catalyst 內(nèi)置了web服務(wù)器,看來使用Nginx作為生產(chǎn)環(huán)境的Web服務(wù)器比較好,一直沒有搞清楚兩者如何結(jié)合?
   
   看了一些資料,感覺Nginx通過配置和一個fastcgi后臺運行的守護進程進行交互,由這個守護進程和catalyst框架通訊實現(xiàn)。

   還有一個疑問,如果我的前端使用dojo toolkit,這個框架直接在那些tt2文件中使用就可以了?雌饋砗唵,但是整體的各個組件如何相互協(xié)作需要搞清楚?

   我咨詢了Catalyst的作者,他是這樣回答的:
  Catalyst, unlike a framework like say Ruby on Rails, sits at the center of a number of other Perl technologies.  You named a few, such as Plack/PSGI, Template Toolkit, etc.  Others might include DBIx::Class for interfacing with a database.  And of course any number of testing tools on the Test::* namespace.  As a result you have to put together a stack that makes sense to you, although one of the more common ones would be those mentioned.

Plack is an implementation of the PSGI specification, which connections a web application (such as Catalyst) to a web server, such as Nginx, Apache, Starman, etc.  This glue layer is reusable across many web frameworks, so we all work on it together for the betterment of all.  Plack also implements common middleware for concerns that are cross cutting, such as session and cookie management, authentication, etc.  Some web frameworks make heavy use of middleware, such as Web::Simple, while Catalyst tends to mix and match between middleware and pre-existing Catalyst specific components.  For example, Catalyst has its own mature session and authentication components, so we tend to use that rather than the Plack middleware (although over time I'd personally like to move towards using more middleware).

Template Toolkit (TT) is a templating system which is a common choice for a View layer in Catalyst.  It allows you a more cleanly expressive approach to the concern of how your web pages look.  Quite often you will use a Javascript framework, such as Dojo, Jquery or Angular.js to name a few of the ones I am personally familiar with.  Javascript will be integrated into the View (TT).  Catalyst, unlike some web frameworks, doesn't offer a lot of Javascript code generation tools since most Perl programmers prefer a more hands on approach and write their Javascript manually.  Catalyst offers some tools for interacting with a Javascript application, such as support for JSON.  So using Javascript with Catalyst is totally fine, just as I said compared to some frameworks you might find yourself needing to write a bit more manual code.  As I said, Perl programmers tend to like to be 'close to the metal' so that is reflected in how Catalyst works.

I recommend you look at a few Catalyst applications on Github and review the tutorial if you can.  

  FastCGI is great, and my first choice for production systems.  Plack implements PSGI and offers you a way to integrate a server such as FastCGI with your Catalyst web application.  It also lets you 'glue' that same application to a different server.  For example, many people use Starman as a server for development be cause its very easy to setup, but use something else in production (although Starman if run behind a proxy can be solid in production as well and some people choose that setup).

[client web browser] <--> [Apache <--> FastCGI] <--> [Plack FastCGI Handler <--> Catalyst <--> DBIx::Class <--> Database]

^^ is one example stack.  

Here's a great blog of someone that started with Catalyst from the start and he did his best to record the journey.  Maybe it will help you.

http://blogs.perl.org/users/j0e/

Also, I recommend reading the current and past Advent Calendars:

http://www.catalystframework.org/calendar/

   You are welcome!

Best of luck! --jnap

   歡迎指導(dǎo)!

論壇徽章:
0
2 [報告]
發(fā)表于 2014-03-22 08:16 |只看該作者
這個Catalyst難道就沒有人使用嗎?

論壇徽章:
0
3 [報告]
發(fā)表于 2014-03-22 11:39 |只看該作者
nginx+fastcgi+catalyst,catalyst 使用 template toolkit 做前端模板, DBIX::Class 做數(shù)據(jù)庫,我是這樣的。
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP