cgi

PHP (or whatever) CGI configuration in web.config IIS

人走茶凉 提交于 2019-12-04 03:40:53
I recently developed an installer for a web application (Yes, Web Application with an Installer) using Wix Tool Set . The wizard guides the user to obtain all the basic information the site need for the installation, and looks like below: Using custom actions at the end of the installation I configured dynamically the IIS to handler CGI using the documentation , to configure FastCGI to Host PHP, Python, Applications . There are a lot of steps and development to achieve this results, but the problem is here: I installed the application and everything works fine, but, if I uninstall or install

multi threaded FastCGI App

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 03:33:19
I want to write a FastCGI app which should handle multiple simultaneous requests using threads. I had a look at the threaded.c sample which comes with the SDK: #define THREAD_COUNT 20 static int counts[THREAD_COUNT]; static void *doit(void *a) { int rc, i, thread_id = (int)a; pid_t pid = getpid(); FCGX_Request request; char *server_name; FCGX_InitRequest(&request, 0, 0); for (;;) { static pthread_mutex_t accept_mutex = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t counts_mutex = PTHREAD_MUTEX_INITIALIZER; /* Some platforms require accept() serialization, some don't.. */ pthread_mutex_lock(

How to get a python script to listen for inputs from another script

只谈情不闲聊 提交于 2019-12-04 03:16:21
I have a situation where I need one python script to be running in a continuous loop, and I need to pass parameters into it from another script which will run when an action occurs. The second script will be triggered by a website using cgi, I have this working fine. The continuous loop should take in parameters read out by the cgi script (and then send info via a serial port). For the specific problem I can't have the cgi script sending the data via serial directly as each time it runs it resets the serial port. I can't seem to find any information on this kind of setup. Are there any methods

How can I run Perl scripts using FastCGI on Nginx?

独自空忆成欢 提交于 2019-12-04 02:07:31
So I am following this guide: http://technotes.1000lines.net/?p=23 and I am going through the steps. I have a VPN (slicehost.com) with Debian Etch, serving a website (static so far) with nginx. I used wget to download FastCGI and I did the usual make make install routine. So I guess since FastCGI can't normally run CGI scripts you have to use some type of perl wrapper to interpret the perl. Now I run this script http://technotes.1000lines.net/fastcgi-wrapper.pl and I run into the exact same problem that a person ran into on the page that the script was submitted: http://www.ruby-forum.com

What are the differences between mod_php and cgi php script?

三世轮回 提交于 2019-12-04 00:39:32
What are the differences between mod_php and cgi php script? I mean, why it's better (is it?) to use mod_php instead simple php scripts, running them as CGIs? Thanks When using CGI : a PHP process is launched by Apache, and it is that PHP process that interprets PHP code -- not Apache itself . In theory, a distinct PHP process has to be created for each request -- which makes things slower : Apache has more work to do to answer a request. (Well, as pointed out by @AlReece45 in a comment, this can be made better using FastCGI) When using PHP as an Apache module ( mod_php , or mod_php5 ) , the

Is cgi dead? [closed]

筅森魡賤 提交于 2019-12-03 23:01:24
Ok, let's put it in a more mildly: Is cgi (common gateway interface) legacy? yes? no? Under what circumstances would a project starting today (one that does noot have to interact with legacy systems or libraries) use cgi? It's far from dead actually. Despite the overheads, many virtual web hosting companies are now running PHP as CGI for security considerations, because it can be used with suEXEC. suEXEC means that your scripts execute under your actual Unix user privileges, and thus are restricted by the operating system's privilege separation. This is a much more robust security model than

Python CGI编程

白昼怎懂夜的黑 提交于 2019-12-03 22:58:41
Python CGI编程 什么是 CGI CGI 目前由 NCSA 维护,NCSA 定义 CGI 如下: CGI(Common Gateway Interface),通用网关接口,它是一段程序,运行在服务器上如:HTTP 服务器,提供同客户端 HTML 页面的接口。 网页浏览 为了更好的了解 CGI 是如何工作的,我们可以从在网页上点击一个链接或 URL 的流程: 1、使用你的浏览器访问 URL 并连接到 HTTP web 服务器。 2、Web 服务器接收到请求信息后会解析 URL,并查找访问的文件在服务器上是否存在,如果存在返回文件的内容,否则返回错误信息。 3、浏览器从服务器上接收信息,并显示接收的文件或者错误信息。 CGI 程序可以是 Python 脚本,PERL 脚本,SHELL 脚本,C 或者 C++ 程序等。 CGI架构图 Web 服务器支持及配置 在你进行 CGI 编程前,确保您的 Web 服务器支持 CGI 及已经配置了 CGI 的处理程序。 Apache 支持 CGI 配置: 设置好CGI目录: 所有的HTTP服务器执行 CGI 程序都保存在一https://www.xuanhe.net/个预先配置的目录。这个目录被称为 CGI 目录,并按照惯例,它被命名为 /var/www/cgi-bin 目录。 CGI 文件的扩展名为 .cgi ,python 也可以使用

How to config apache for C++ CGI scripts?

六月ゝ 毕业季﹏ 提交于 2019-12-03 22:13:59
I've found a lot of stuff for Perl, but nothing for C++. I'm running Ubuntu right now but I'm fairly inexperienced with it, so simple instructions would be awesome. I've just written a small C++ program made to work as a CGI, and I need to test it out. Thanks! You shouldn't need to do anything special; just compile it to an executable file named *.cgi (or whatnot), and make sure you have AddHandler cgi-script .cgi (or whatnot) in your server config or .htaccess or whatnot. (Disclaimer: It's been many years since I've done that, so I may be forgetting something. But I think that should be all

CGIHTTPRequestHandler run php or python script in python

天涯浪子 提交于 2019-12-03 20:45:42
I'm writing a simple python web-server on windows.. it works but now I want to run dynamic scripts (php or py) and not only html pages.. here is my code: from BaseHTTPServer import HTTPServer from CGIHTTPServer import CGIHTTPRequestHandler class RequestsHandler(CGIHTTPRequestHandler): cgi_directories = ["/www"] #to run all scripts in '/www' folder def do_GET(self): try: f = open(curdir + sep + '/www' + self.path) self.send_response(200) self.send_header('Content-type', 'text/html') self.end_headers() self.wfile.write(f.read()) f.close() except IOError: self.send_error(404, "Page '%s' not found

PHP-FPM的相关知识的深度解释

我们两清 提交于 2019-12-03 20:33:59
一、 需要搞清楚几个名词概念 1. CGI ( Common Gateway Interface , CGI )通用网关接口 , 是 Web 服务器运行时外部程序的规范 ,按 CGI 编写的程序可以扩展服务器功能。 CGI 应用程序能与 浏览器 进行交互,还可通过数据 API 与数据库服务器等外部数据源进行 通信 ,从数据库服务器中获取数据。格式化为 HTML 文档后,发送给浏览器,也可以将从浏览器获得的数据放到数据库中。几乎所有 服务器 都支持 CGI ,可用任何语言编写 CGI ,包括流行的 C 、 C ++ 、 Java 、 VB 和 Delphi 等。 所以说 CGI 是一个协议,不是进程。 CGI 的存在,可以使用户通过浏览器来访问执行在服务器上的动态程序; CGI 是 Web 服务器与 CGI 程序间传输数据的标准; 服务器端 CGI 程序接收信息有三种途径:环境变量、命令行和标准输入。 命令行: <form> 表单的 Method=GET ,向 CGI 传递表单编码信息是通过命令方式来进行的。 标准输入: <form> 表单的 Method=POST ,向 CGI 传递表单编码信息是通过标准输入方式来进行的。 环境变量: 表单编码信息是通过环境变量 QUERY_STRING 来传递。 浏览器传递数据方式: POST: 发送数据大小不受限制, 环境变量 CONTENT