cgi

Profiling a Perl CGI script that times-out

五迷三道 提交于 2019-12-22 05:33:38
问题 I have a Perl CGI application that sometimes times out, causing it to be killed by Apache and 504 Gateway Time-out error to be sent to browser. I am trying to profile this application using NYTProf, however I cannot read profile data: $ nytprofhtml -f www/cgi-local/nytprof.out Reading www/cgi-local/nytprof.out Profile data incomplete, inflate error -5 ((null)) at end of input file, perhaps the process didn't exit cleanly or the file has been truncated (refer to TROUBLESHOOTING in the

Perl throws “keys on reference is experimental”

ε祈祈猫儿з 提交于 2019-12-22 04:46:08
问题 Development environment is OS X 10.10.3, Perl -v This is perl 5, version 18, subversion 2 (v5.18.2) built for darwin-thread-multi-2level (with 2 registered patches, see perl -V for more detail) Here is the problem I moved the project from my local environment to a Windows Server and now I get the following error: "keys on reference is experimental at CGI/Router.pm line 94." line 94 of the module shows my $num_regexes = scalar keys $token_regexes; the entire module can be found here https:/

internal server error (500) in simple cgi script

折月煮酒 提交于 2019-12-22 04:05:16
问题 I am trying to run a simple cgi script after configuring my server. My script looks like this: print "Content-type: text/html" print print "<html><head><title>CGI</title></head>" print "<body>" print "hello cgi" print "</body>" print "</html>" When I go to my scripts url http://127.0.0.1/~flybywire/cgi-bin/main.py I get: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. And in error.log I get the following: [error] (8

internal server error (500) in simple cgi script

痴心易碎 提交于 2019-12-22 04:05:01
问题 I am trying to run a simple cgi script after configuring my server. My script looks like this: print "Content-type: text/html" print print "<html><head><title>CGI</title></head>" print "<body>" print "hello cgi" print "</body>" print "</html>" When I go to my scripts url http://127.0.0.1/~flybywire/cgi-bin/main.py I get: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. And in error.log I get the following: [error] (8

XAMPP Mercurial installation on Windows Apache --> HgWebDir.cgi Script Error

吃可爱长大的小学妹 提交于 2019-12-22 00:31:51
问题 I try to publish multiple existing mercurial repository-locations though XAMPP Apache via CGI Python script hgwebdir.cgi ... as in this tutorial https://www.mercurial-scm.org/wiki/HgWebDirStepByStep I get the following error from the apache error logs, when I try to access the repository path with a browser: Premature end of script headers: hgwebdir.cgi [Tue Apr 20 16:00:50 2010] [error] [client 91.67.44.216] Premature end of script headers: hgwebdir.cgi [Tue Apr 20 16:00:50 2010] [error]

CGI、FastCGI、PHP-CGI、PHP-FPM、Spawn-FCGI解析

百般思念 提交于 2019-12-21 22:16:05
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 什么是CGI CGI全称是“公共网关接口/通用网关接口”(Common Gateway Interface),HTTP服务器与你的或其它机器上的程序进行“交谈”的一种工具,其程序须运行在网络服务器上。 CGI可以用 任何一种语言编写 ,只要这种语言具有标准输入、输出和环境变量。如php,python, perl, tcl等 什么是FastCGI   FastCGI(" 快速通用网关接口 ")像是一个常驻(long-live)型的CGI,它可以一直执行着,只要激活后,不会每次都要花费时间去fork一次(这是CGI最为人诟病的fork-and-execute模式)。它还支持分布式的运算, 即FastCGI程序可以在网站服务器以外的主机上执行并且接受来自其它网站服务器来的请求。   FastCGI是语言无关的、可伸缩架构的CGI开放扩展,其主要行为是将CGI解释器进程保持在内存中并因此获得较高的性能。众所周知,CGI解释器的反复加载是CGI性能低下的主要原因,如果CGI解释器保持在内存中并接受FastCGI进程管理器调度,则可以提供良好的性能、伸缩性、Fail-Over特性等等。 FastCGI与CGI特点   1、如CGI,FastCGI也具有语言无关性.   2、如CGI, FastCGI在进程中的应用程序

网关协议

跟風遠走 提交于 2019-12-21 22:15:48
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> CGI CGI即通用网关接口(Common Gateway Interface),是外部应用程序(CGI程序)与Web服务器之间的接口标准,是在CGI程序和Web服务器之间传递信息的规程。CGI规范允许Web服务器执行外部程序,并将它们的输出发送给Web浏览器,CGI将Web的一组简单的静态超媒体文档变成一个完整的新的交互式媒体。通俗的讲CGI就像是一座桥,把网页和WEB服务器中的执行程序连接起来,它把HTML接收的指令传递给服务器的执行程序,再把服务器执行程序的结果返还给HTML页。CGI 的跨平台性能极佳,几乎可以在任何操作系统上实现。 CGI方式在遇到连接请求(用户请求)先要创建cgi的子进程,激活一个CGI进程,然后处理请求,处理完后结束这个子进程。这就是fork-and-execute模式。所以用cgi方式的服务器有多少连接请求就会有多少cgi子进程,子进程反复加载是cgi性能低下的主要原因。当用户请求数量非常多时,会大量挤占系统的资源如内存,CPU时间等,造成效能低下。 CGI脚本工作流程: 浏览器通过HTML表单或超链接请求指向一个CGI应用程序的URL。 服务器收发到请求。 服务器执行所指定的CGI应用程序。 CGI应用程序执行所需要的操作,通常是基于浏览者输入的内容。

how to display pdf file contents as well as its full name in the browser using cgi python script?

☆樱花仙子☆ 提交于 2019-12-21 17:36:34
问题 I wish to display the full path of the pdf file along with its contents displayed on the browser. My script has an input html, where user will input file name and submit the form. The script will search for the file, if found in the subdirectories will output the file contents into the browser and also display its name. I am able to display the contents but unable to display the full fine name also simultaneously Or if I display the filename I get garbage character display for the contents.

Configuring lighttpd to handle CGI C executables

那年仲夏 提交于 2019-12-21 17:25:45
问题 Does anyone know how to configure lighttpd to handle plain CGI executables, in this case written in C? I have compiled a test program (test.cgi) and put it in $HOME/public_html/cgi-bin. I have also enabled the CGI module with lighty-enable-mod cgi and restarted the web server. Still, when requesting http://localhost/~august/cgi-bin/test.cgi the program is not run but is instead treated as a static file. Here is my test program by the way: #include <stdio.h> int main(void) { printf("Content

How can I reduce Perl CGI script start-up time?

前提是你 提交于 2019-12-21 17:18:55
问题 I'm developing some CGI scripts and I'm trying to find a solution to decrease the "starting time" produced when I import a lot of modules with "use". Update: The solutions provided are nice, but the scripts I'm working runs both in console and CGI mode checking if some typical HTTP environment variables are present. In "console mode" they dump the data "normally", and in "html mode" they make some realtime replacements and send other HTTP headers to the client. I'd like to improve the startup