cgi

PHP/Java bridge problem

匿名 (未验证) 提交于 2019-12-03 01:58:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using tomcat 6 on windows. Here is the code I am testing. import java.io.ByteArrayOutputStream; import java.io.Closeable; import java.io.StringReader; import javax.script.Invocable; import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; /** * Create and run THREAD_COUNT PHP threads, concurrently accessing a * shared resource. * * Create 5 script engines, passing each a shared resource allocated * from Java. Each script engine has to implement Runnable. * * Java accesses the Runnable script engine using * scriptEngine

PHP passing $_GET in linux command prompt

匿名 (未验证) 提交于 2019-12-03 01:52:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Say we usually access via http://localhost/index.php?a=1&b=2&c=3 How do we execute the same in linux command prompt? php -e index.php But what about passing the $_GET variables? Maybe something like php -e index.php --a 1 --b 2 --c 3? Doubt that'll work. Thank you! 回答1: Typically, for passing arguments to a command line script, you will use either argv global variable or getopt : // bash command: // php -e myscript.php hello echo $argv[1]; // prints hello // bash command: // php -e myscript.php -f=world $opts = getopt('f:'); echo $opts['f'];

what is cgi programming

走远了吗. 提交于 2019-12-03 01:35:07
What is exactly meant by CGI programming . If I am writing a cgi program in 'C' , in that context , what does the 'cgi' mean ? Is the servelt environment is an abstraction of classical cgi programming ? Abbreviation of Common Gateway Interface, a specification for transferring information between a World Wide Web server and a CGI program. A CGI program is any program designed to accept and return data that conforms to the CGI specification. The program could be written in any programming language, including C, Perl, Java, or Visual Basic. CGI programs are the most common way for Web servers to

How to run cgi script on apache server

匿名 (未验证) 提交于 2019-12-03 01:12:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: This is my program: [ root@localhost cgi - bin ]# locate first . pl / home / Ram / Desktop / work / first . pl / usr / local / apache2 / cgi - bin / first . pl [ root@localhost cgi - bin ]# cd / usr / local / apache2 / cgi - bin / [ root@localhost cgi - bin ]# vi first . pl #!/usr/bin/perl -w use warnings ; use warnings ; use CGI ; print "content-type: text/html\n\n" ; print " Hello, World! \n" ; I am calling the script from my browser like this: http://localhost/usr/local/apache2/cgi-bin/first.pl I didn't get output, but I'm

Disable all CGI (php, perl, …) for a directory using .htaccess

匿名 (未验证) 提交于 2019-12-03 01:10:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a directory where users can upload files. To avoid security issues (e.g. somebody uploading a malicious php script), I currently change the files' extension by appending .data for example, but then when downloading the file, they have to manually remove the .data . Another common solution is to upload the files in a directory that is not served by Apache, and have a php script manage all downloads by calling readfile() . What I'd like to do is to simply disallow execution of any scripts (php, perl, cgi scripts, whatever I may install

ScriptAlias configuration not working in apache2

匿名 (未验证) 提交于 2019-12-03 00:56:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I installed apache2 on ubuntu. I added the following to /etc/apache2/httpd.conf file ScriptAlias /cgi-bin/ "/home/PROJECT/cgi-bin/" I am able to open the cgi file if i copy the cgi file to /usr/lib/cgi-bin/hello.cgi [DocumentRoot directory] and access the URL http://localhost/cgi-bin/hello.cgi , but i get cannot access the file if i put it in /home/PROJECT/cgi-bin/hello.cgi even though ScriptAlias is set and apache2 restarted. Any thing that i am missing here ? 回答1: I had the same problem. The reason was in httpd.conf, I had to remove global

Hosting Mercurial HG via VisualSVN Server

。_饼干妹妹 提交于 2019-12-03 00:40:07
I have tried to host a Mercurial HG repository using a Scriptalias. ScriptAlias /hg/ "htdocs/hgwebdir.cgi" If I go to Chrome it display the contents of the cgi file. In IE it does render however images and links are not displayed. In either case the repository I want to display is not shown. Has anyone managed to get this working with VisualSVN? Also will this work if I have windows authentication and https? Here's a alternative setup using mod_wsgi (fast!), combined repository directory, and you can manage Mercurial repository level access from the VisualSVN Server GUI. Download mod_wsgi.so

web微信

匿名 (未验证) 提交于 2019-12-03 00:40:02
网页微信客户端封包大全 http://www.langyeweb.com/Program/70.html 网页版微信功能只有一个:聊天。根据 ***Copyright (C) 狼夜***我这两天研究发现, 网页版微信可以脱离手机微信,也就是手机微信退出、手机关机,都不影响网页端微信的 在线以及聊天,关于如何使用加好友、朋友圈、摇一摇功能,我有个思路就是抓手机封包 @Icenowy 在微博上有抓手机包的计划 然后使用,不过这个想法因为时间问题没有去实践, 希望大家能研究出来的话在本页面留一个链接,十分感谢! 以下是Post/Get的封包大全,如果能看懂这个,基本上你就可以做出来了。 获取uuid https://login.weixin.qq.com/jslogin?appid=wx782c26e4c19acffb&redirect_uri=https%3A%2F%2Fwx.qq.com%2Fcgi-bin%2Fmmwebwx-bin%2Fwebwxnewloginpage&fun=new&lang=zh_CN&_=1388994062250 获取二维码 https://login.weixin.qq.com/qrcode/{$uuid}?t=webwx 等待扫描Get https://login.weixin.qq.com/cgi-bin/mmwebwx-bin/login

Apache

匿名 (未验证) 提交于 2019-12-03 00:38:01
Apache HTTP Server(简称Apache)是Apache软件基金会的一个开放源码的网页服务器,可以在大多数计算机操作系统中运行,由于其多平台和安全性被广泛使用,是最流行的Web服务器端软件之一。它快速、可靠并且可通过简单的API扩展,将Perl/Python等解释器编译到服务器中。 yum install httpd -y systemctl start httpd systemctl stop firewalld systemctl enable httpd systemctl disable firewalld apache的基本配置 index.html apache的默认发布文件 /etc/httpd/conf/httpd.conf /etc/httpd/conf.d/*.conf apache的配置文件 /var/www/html apache的默认发布目录 80 apache的默认端口 根据这些默认设置,我们可以先试验一下: [root @localhost html]# echo "<h1 style="c olo r":limegreen>FirstHtml</h1>" >> index.html [root @localhost html]# pwd /var/www/html 效果如图: 1.修改默认发布文件 [root @localhost

【转】常见的网关协议

匿名 (未验证) 提交于 2019-12-02 23:49:02
常见的网关协议 在工作中一直使用PHP,但知道怎么开车,不知道车是怎么跑的是不行的,不然出问题了也不知道出在哪里,因此了解下PHP-FPM的运行原理。、 CGI 通用网络接口(Common Gateway Interface),是用来规定Web Server和应用程序直接进行数据数据传输的协议。可以用任意语言来实现,只要我们使用的语言的能够支持标准输入、标准输出及环境变量等处理,就能够开发出一个CGI程序。 CGI的运行过程: 用户访问Web应用,发起一个HTTP请求,Web服务受到该请求; HTTP服务器将请求数据从HTTP请求中解析出来,根据请求的URL创建一个新的CGI进程,并通过环境变量和标准输入传入到CGI进程中; CGI进程根据请求进行逻辑处理,连接其他服务请求数据或者从DB获取数据或者只是单纯的进行逻辑运算; CGI进程将处理的结果写入到标准输出中; Web服务器从标准输出中读取相应,并返回给用户; Web服务器关闭CGI进程。 从上面可以看出,对于每一个用户请求,都需要重新fork一个子进程处理请求、请求结束销毁子进程的过程,如果是少量请求,如果是大并发,这种 fork-and-execute 显然不适合,这是就出现了下面要讲的 fastcgi 模式。 FastCGIģʽ 快速通用网关接口(Fast Common Gateway Interface/FastCGI