cgi

Cgi-bin scripts get run without a user?

Deadly 提交于 2020-01-15 03:12:09
问题 I'm running a binary that requires a license key to reside in the user's home directory. I'm making a cgi script that calls upon this binary and everything is happy when I execute the script from the command line using sudo -u www-data binary. However, when I run the cgi script from the web, the binary can't find the license key. The apache error log states: License key "(null)/.key" not found., referer: Does this mean that cgi scripts are executed without any user attached for security

Writing CGI script in Java

旧城冷巷雨未停 提交于 2020-01-14 14:04:57
问题 I trying to figure out how to write CGI scripts in Java. I followed this examples -> http://www.javaworld.com/jw-01-1997/jw-01-cgiscripts.html?page=1 It provide cgi_lib.java, hello.html and hello.java Everything seems fine, but in the html part. The action is pointed to cgi_lib/hello.cgi There's no cgi provided. So I tried with cgi_lib/hello.java, and it print the entire source code in the hello.java. Then i tried to edit the hello.java extensions into hello.cgi, and tried again. The browser

Writing CGI script in Java

最后都变了- 提交于 2020-01-14 14:03:40
问题 I trying to figure out how to write CGI scripts in Java. I followed this examples -> http://www.javaworld.com/jw-01-1997/jw-01-cgiscripts.html?page=1 It provide cgi_lib.java, hello.html and hello.java Everything seems fine, but in the html part. The action is pointed to cgi_lib/hello.cgi There's no cgi provided. So I tried with cgi_lib/hello.java, and it print the entire source code in the hello.java. Then i tried to edit the hello.java extensions into hello.cgi, and tried again. The browser

Python: CGI update webpage before script exit

拥有回忆 提交于 2020-01-14 02:29:05
问题 Okay here's my situation. I wrote a HTML form with a textarea that submits a POST request to my python script. I use cgi library to parse the textarea and split it into an array. I then process the items using a loop and print items as they're processed. It seems that even though I put the print statement in the loop it doesn't print until the entire process is completed and the script has exited. The html page also hangs until the process is finished. I have tried to flush the buffer using

PHP底层原理

 ̄綄美尐妖づ 提交于 2020-01-13 21:05:57
SAPI,即服务器应用编程接口,实质上就是定义了一个统一的接口,它的核心就是一个结构体sapi_module_struct。SAPI提供给了外部应用跟php通信的管道,这个外部应用包括不限于Apache,httpd,liunx终端等,sapi通俗的讲就是php-cgi,php-cli,mod_php等,php就是php内核。 参考链接:SAPI: https://blog.csdn.net/github_38392025/article/details/79373918 什么是CGI 什么是FastCGI 什么是PHP-Fpm 什么是PHP-cgi Nginx和php-fpm是怎么通信的? 什么是代理和反向代理? php-fpm支持三种运行模式 如何优化? php-fpm 三种运行方式: 第一种:是pm = static,始终保持一个固定数量的子进程,这个数由pm.max_children定义,这种方式很不灵活,也通常不是默认的。 第二种:是pm = dynamic,他是这样的,启动时,会产生固定数量的子进程(由pm.start_servers控制)可以理解成最小子进程数,而最大子进程数则由pm.max_children去控制,OK,这样的话,子进程数会在最大和最小数范围中变化,还没有完,闲置的子进程数还可以由另2个配置控制,分别是pm.min_spare_servers和pm

Apache/httpd /var/www/html/ .cgi scripts throw 500 internal server error

我们两清 提交于 2020-01-13 06:12:26
问题 I installed a new CentOS 7 x86_64 LAMP server today. I compiled a simple CGI script in c and i called it test.cgi, and I enabled the AddHandler for .cgi scripts. However everytime i try to load the /test.cgi page from my /var/www/html directory any simple .cgi script will throw me a 500 internal server error page. I tested that the script is working fine from the /var/www/cgi-bin directory. My server is running selinux and apache/httpd is using suEXEC. EDIT: also I didn't create any extra

Apache/httpd /var/www/html/ .cgi scripts throw 500 internal server error

て烟熏妆下的殇ゞ 提交于 2020-01-13 06:12:21
问题 I installed a new CentOS 7 x86_64 LAMP server today. I compiled a simple CGI script in c and i called it test.cgi, and I enabled the AddHandler for .cgi scripts. However everytime i try to load the /test.cgi page from my /var/www/html directory any simple .cgi script will throw me a 500 internal server error page. I tested that the script is working fine from the /var/www/cgi-bin directory. My server is running selinux and apache/httpd is using suEXEC. EDIT: also I didn't create any extra

How to change Apache httpd.conf file on Mac OS X?

心已入冬 提交于 2020-01-13 04:31:09
问题 I'm on a MacBook running OS X trying to teach myself how to write CGI scripts and I'm stuck on the very first step, altering the httpd.conf file. I'm following these instructions: http://www.cgi101.com/book/connect/mac.html and I'm trying to alter the httpd.conf file using the terminal command sudo vim /etc/apache2/httpd.conf . However when I get ready to try and save the file it says that it's read-only. The instructions that I'm following say that I'm supposed to uncomment the line

How can I redirect the client from one CGI page to another using Perl?

故事扮演 提交于 2020-01-12 20:27:50
问题 My problem is the following. After the password is recognized as valid I need to redirect to main.cgi but I am getting the message as: Status: 302 Found Location: http://localhost/cgi-bin/Main.cgi I know the reason for this is that I am writing this statement after Content-Type so it is taking this as HTML and printing it on screen. I am a newbie to Perl. Can anybody please help me find the solution for this and make my code work the way I want it to? Or please suggest me some alternative

CGI,FastCGI,PHP-FPM

房东的猫 提交于 2020-01-11 10:19:06
CGI(Common Gateway Interface) CGI 是Web 服务器运行时外部程序的规范,按CGI 编写的程序可以扩展服务器功能。CGI 应用程序能与浏览器进行交互,还可通过数据库API 与数据库服务器等外部数据源进行通信,从数据库服务器中获取数据。格式化为HTML文档后,发送给浏览器,也可以将从浏览器获得的数据放到数据库中。几乎所有服务器都支持CGI,可用任何语言编写CGI,包括流行的C、C ++、VB 和Delphi 等。CGI 分为标准CGI 和间接CGI两种。标准CGI 使用命令行参数或环境变量表示服务器的详细请求,服务器与浏览器通信采用标准输入输出方式。间接CGI 又称缓冲CGI,在CGI 程序和CGI 接口之间插入一个缓冲程序,缓冲程序与CGI 接口间用标准输入输出进行通信 FastCGI FastCGI像是一个常驻(long-live)型的CGI,它可以一直执行着,只要激活后,不会每次都要花费时间去fork一次(这是CGI最为人诟病的fork-and-execute 模式)。它还支持分布式的运算, 即 FastCGI 程序可以在网站服务器以外的主机上执行并且接受来自其它网站服务器来的请求。 FastCGI是语言无关的、可伸缩架构的CGI开放扩展,其主要行为是将CGI解释器进程保持在内存中并因此获得较高的性能。众所周知