什么是安装Perl Web应用程序的最佳系统? [英] What's the best system for installing a Perl web app?

查看:89
本文介绍了什么是安装Perl Web应用程序的最佳系统?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

似乎大多数Perl安装程序都集中在安装Perl模块而不是应用程序上.诸如ExtUtils :: MakeMaker和Module :: Build之类的东西非常适合于模块,但是Web Apps需要一些额外的工作.

It seems that most of the installers for Perl are centered around installing Perl modules, not applications. Things like ExtUtils::MakeMaker and Module::Build are very well suited for modules, but require some additional work for Web Apps.

理想情况下,从存储库中检出源代码后,可以执行以下操作会很不错:

Ideally it would be nice to be able to do the following after checking out the source from the repository:

  • 检测到缺少的依赖项
  • 从CPAN下载并安装依赖项
  • 运行命令以将源构建"到最终状态(执行本地环境所需的任何源解析或配置).
  • 运行命令以将生成的文件安装到适当的位置.不仅perl模块,而且还应该可以通过Web访问的模板(.tt)文件,CGI脚本,JS和图像文件之类的东西.
  • 确保已安装的文件(和SELinux上下文,如有必要)设置了适当的权限.

现在,我们有一个基于 Module :: Build 的系统来完成大部分任务.该工作是由当时正在学习使用 Module :: Build 的同事完成的,我们希望获得一些有关推广解决方案的建议,因为这是特定于应用程序的权利现在.特别是,我们的系统要求我们手动安装依赖项(尽管它确实会检测到它们).

Right now we have a system based on Module::Build that does most of this. The work was done by done by my co-worker who was learning to use Module::Build at the time, and we'd like some advice on generalizing our solution, since it's fairly app-specific right now. In particular, our system requires us to install dependencies by hand (although it does detect them).

您是否使用过特别成功的特定系统?您是否必须基于您的应用程序编写 Module :: Build ExtUtils :: MakeMaker 的安装程序,或者该程序更通用?

Is there any particular system you've used that's been particularly successful? Do you have to write an installer based on Module::Build or ExtUtils::MakeMaker that's particular to your application, or is something more general available?

编辑:要回答布赖恩的以下问题:

To answer brian's questions below:

  • 我们可以登录机器
  • 我们无权访问计算机
  • 这些机器(表面上)都是启用了SELinux的RHEL5的所有相同版本
  • 当前,安装机器的人员仅是我们小组中的程序员,而我们的资料仅供公众使用.但是,可以想到,我们的源代码最终可以安装在组织中其他人的计算机上,由他们的程序员或系统人员安装.
  • 尽管我们希望可以选择使用分布式归档文件(请参见上文),但我们还是通过从存储库中签出进行安装.

推荐答案

安装Web应用程序有哪些限制?您可以登录机器吗?所有的机器都运行相同的东西吗?是安装Web应用程序的同事还是来自普通大众的人?安装此系统管理员,程序员,Web管理器或其他工具的人员吗?您是通过分发存档进行安装还是从源代码管理中签出?

What are your limitations for installing web apps? Can you log into the machine? Are all of the machines running the same thing? Are the people installing the web apps co-workers or random people from the general public? Are the people installing this sysadmins, programmers, web managers, or something else? Do you install by distributed an archive or checking out from source control?

对于我的大多数工作(涉及熟悉在控制环境中安装Perl的系统管理员),我只使用 MakeMaker .如果您对MakeMaker有所了解,可以很容易地执行列出的所有事情.如果您想进一步了解,请问另一个问题. ;) Module :: Build 一样简单,但是要走的路如果您还不喜欢使用MakeMaker.

For most of my stuff, which involves sysadmins familiar with Perl installing in control environments, I just use MakeMaker. It's easy to get it to do all the things you listed if you know a little about MakeMaker. If you want to know more about that, ask a another question. ;) Module::Build is just as easy, though, and the way to go if you don't already like using MakeMaker.

Module::Build将是处理许多不同情况的好方法. Module::Build将具有很大的灵活性,但还有更多工作要做.而且,cpan工具(Perl随附)可以从当前目录安装并为您处理依赖项.只需告诉它安装当前目录即可:

Module::Build would be a good way to go to handle lots of different situations if the people are moderately clueful about the command line and installing software. You'll have a lot of flexibility with Module::Build, but also a bit more work. And, the cpan tool (which comes with Perl), can install from the current directory and handle dependencies for you. Just tell it to install the current directory:

 $ cpan .

如果您只需要安装在一个平台上,则可能会更轻松地制作本机格式的软件包.您甚至可以让Module::Build为您制作该程序包,以便开发人员具有Module::Build的灵活性,但是安装程序可以简化本机过程.坚持使用Module::Build还意味着您可以通过一个构建工具为不同的平台创建不同的软件包.

If you only have to install on a single platorm, you'll probably have an easier time making a package in the native format. You could even have Module::Build make that package for you so the developers have the flexibility of Module::Build, but the installers have the ease of the native process. Sticking with Module::Build also means that you could create different packages for different platforms from a single build tool.

如果安装Web应用程序的人员确实不了解命令行,CPAN等内容,那么您可能想要使用不会吓them他们或使他们思考发生了什么的打包程序和安装程序,并可以自动准确地向您报告问题.

If the people installing the web application really have no idea about command lines, CPAN, and other things, you'll probably want to use a packager and installer that doesn't scare them or make them think about what is going on, and can accurately report problems to you automatically.

正如Dave所指出的那样,使用真实的CPAN镜像始终可以为您提供模块的最新版本,但您也可以使用自己的伪造"产品. CPAN镜像完全符合您想要的发行版,并从中安装了普通的CPAN工具.对于我们的客户,我们制作了"CD上的CPAN". (尽管拇指驱动器现在也不错).通过简单的运行我"脚本将按照所需的确切版本安装所有内容.例如,如果您对此感兴趣,请参阅我的我自己做的CPAN演讲.同样,在考虑这一点时要考虑听众.这不是您要交给大众的东西.

As Dave points out, using a real CPAN mirror always gets you the latest version of a module, but you can also make your own "fake" CPAN mirror with exactly the distributions you want and have the normal CPAN tools install from that. For our customers, we make "CPAN on a CD" (although thumb drives are good now too). With a simple "run me" script everything gets installed in exactly the versions they need. See, for instance, my Making my own CPAN talk if you're interested in that. Again, consider the audience when you think about that. It's not something you'd hand to the general public.

祝你好运,:)

这篇关于什么是安装Perl Web应用程序的最佳系统?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆