如何在没有Apache的情况下运行我的Perl CGI脚本? [英] How can I run my perl CGI script without apache?

查看:60
本文介绍了如何在没有Apache的情况下运行我的Perl CGI脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在不使用Apache的情况下运行perl CGI脚本?这是出于测试目的,因此某种类型的单进程服务器一次只处理一个请求就足够了。

解决方案

< blockquote>

脚本应以特定用户身份运行,目前我不想在测试 apache suexec c $ c>。


没有什么可以阻止您复制必需的Apache配置的,除了用户使用 httpd 将要运行,要绑定到的接口/端口(可能是 cgi-bin 目录),并运行的单独副本httpd (带有 -f 选项)。这是在应该运行的环境中测试应用程序的最安全方法。


请参见启动Apache


可以在运行时使用<$ c指定其位置$ c> -f 命令行选项,如

  / usr / local / apache2 / bin / apachectl -f /usr/local/apache2/conf/httpd.conf 



How can I run my perl CGI script without apache? This is for testing purposes, so some kind of single-process server that processes only one request at time should be enough for me.

解决方案

Script shoud be run as specific user and currently I do not want to setup suexec on testing apache.

There is nothing preventing you from duplicating the requisite Apache configuration except for the user under which httpd is going to be run, the interface/port to bind to and possibly the cgi-bin directory and running a separate copy of httpd (with the -f option). That would be the safest way to test the application in the environment it is supposed run.

See Starting Apache:

it is possible to specify its location at run time using the -f command-line option as in

/usr/local/apache2/bin/apachectl -f /usr/local/apache2/conf/httpd.conf

这篇关于如何在没有Apache的情况下运行我的Perl CGI脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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