cgi

Python Subprocess Popen Stalling CGI Page

一个人想着一个人 提交于 2019-12-20 01:46:40
问题 I have a tool that I am working on and I need it to run a parser and also output another analysis log. Currently I have it so that it's through a web interface. User goes to the form and submits a filename for parsing (file already on system). Form submits information to Python CGI script Python CGI script runs and spawns a subprocess to run the parsing. Parser finds appropriate information for analysis and spawns subprocess also. I am using import subprocess ... subprocess.Popen(["./program

Python Subprocess Popen Stalling CGI Page

六月ゝ 毕业季﹏ 提交于 2019-12-20 01:46:13
问题 I have a tool that I am working on and I need it to run a parser and also output another analysis log. Currently I have it so that it's through a web interface. User goes to the form and submits a filename for parsing (file already on system). Form submits information to Python CGI script Python CGI script runs and spawns a subprocess to run the parsing. Parser finds appropriate information for analysis and spawns subprocess also. I am using import subprocess ... subprocess.Popen(["./program

How can I tell Apache2, run mod_php5 by default but run this VH in CGI mode?

好久不见. 提交于 2019-12-19 20:46:12
问题 The Server I have a development server that I'm using to host my current projects. Here are some stats: root@myserver:/usr/bin $ cat /etc/*-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=10.10 DISTRIB_CODENAME=maverick DISTRIB_DESCRIPTION="Ubuntu 10.10" root@myserver:/usr/bin $ apache2 -v Server version: Apache/2.2.16 (Ubuntu) Server built: Nov 18 2010 21:17:43 root@myserver:/usr/bin $ php --version PHP 5.3.3-1ubuntu9.1 with Suhosin-Patch (cli) (built: Oct 15 2010 14:00:18) Copyright (c) 1997-2009

【转】网关协议学习:CGI、FastCGI、WSGI、uWSGI

*爱你&永不变心* 提交于 2019-12-19 18:45:11
一直对这四者的概念和区别很模糊,现在就特意梳理一下它们的关系与区别。 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 can I set Perl's inclusion path for modules for a CGI script?

不问归期 提交于 2019-12-19 16:47:37
问题 I’ve got several Perl modules installed on my hosting machine in ~/perl , how do I add them to Perl module path? Setting PERL5LIB or unshift ing the paths to @INC surely works, but the environment variable does not help when running as a CGI script and the @INC way is not very portable. Is there a better way? This has to be a common problem, am I missing something? 回答1: PERL5LIB works just fine for CGI scripts. You just have to set the variable in the right place, such as the server

Apache [PTY Errors] in cgi-perl file while creating a new Expect object

◇◆丶佛笑我妖孽 提交于 2019-12-19 11:53:37
问题 I have a perl script: #!/usr/bin/perl -w use DateTime; use Expect; use IO::Pty; use CGI::Fast; while($q = new CGI::Fast){ my $ip = $q->param('ip'); my $folder = $q->param('folder'); my $username = $q->param('username'); my $password = $q->param('password'); print "Content-type: text/html\r\n\r\n"; print "<head>\n<title>FastCGI</title>\n\</head>"; print "<h3> $ip - $folder - $username - $password </h3>"; my $ssh = new Expect; if($ssh->spawn("ssh -q -l $username $ip")){ print "<h4>Connexion OK<

Apache2 sends two HTTP headers with a mapped “nph-” CGI

假装没事ソ 提交于 2019-12-19 08:58:25
问题 Summary I'm trying to map some file extensions to be executed by a nph (Non Parsed Header) CGI executable. Let's say I want to access a URL http://server/file.ext and map the "ext" file extension to "trigger" the execution of my nph CGI (/var/www/cgi-bin/nph-test.sh). Apache configuration To do that I'm using mod_actions and mod_cgid, this is my relevant configuration information: <VirtualHost *:80> DocumentRoot /var/www/htdocs ScriptAlias /cgi-bin /var/www/cgi-bin Action cgi-wrapper /cgi-bin

Calling exec returns errno 14 (bad address) with absolute path

被刻印的时光 ゝ 提交于 2019-12-19 08:05:32
问题 in making a simple cgi server for a course. To do that in some point I have to make a fork/exec to launch the cgi handler, the problem is that the exec keep returning errno 14. I've tried the following code in a standalone version an it works with and without the absolute path. Here's the code: static void _process_cgi(int fd, http_context_t* ctx) { pid_t childProcess; int ret; char returnValue[1024]; log(LOG, "calling cgi", &ctx->uri[1], 0); if((childProcess = fork()) != 0) { /// /// Set the

Calling exec returns errno 14 (bad address) with absolute path

萝らか妹 提交于 2019-12-19 08:05:10
问题 in making a simple cgi server for a course. To do that in some point I have to make a fork/exec to launch the cgi handler, the problem is that the exec keep returning errno 14. I've tried the following code in a standalone version an it works with and without the absolute path. Here's the code: static void _process_cgi(int fd, http_context_t* ctx) { pid_t childProcess; int ret; char returnValue[1024]; log(LOG, "calling cgi", &ctx->uri[1], 0); if((childProcess = fork()) != 0) { /// /// Set the

Calling exec returns errno 14 (bad address) with absolute path

会有一股神秘感。 提交于 2019-12-19 08:05:06
问题 in making a simple cgi server for a course. To do that in some point I have to make a fork/exec to launch the cgi handler, the problem is that the exec keep returning errno 14. I've tried the following code in a standalone version an it works with and without the absolute path. Here's the code: static void _process_cgi(int fd, http_context_t* ctx) { pid_t childProcess; int ret; char returnValue[1024]; log(LOG, "calling cgi", &ctx->uri[1], 0); if((childProcess = fork()) != 0) { /// /// Set the