cgi

Installing and Running CGI Proxy Python on Tomcat 7

拜拜、爱过 提交于 2019-12-11 03:22:44
问题 I want to set up a proxy running on tomcat for openlayers, so I followed these steps: Downloaded the proxy.cgi file from the OpenLayers web site: http://trac.osgeo.org/openlayers/browser/trunk/openlayers/examples/proxy.cgi Here is the code: #!c:/Python27/python.exe """This is a blind proxy that we use to get around browser restrictions that prevent the Javascript from loading pages not on the same server as the Javascript. This has several problems: it's less efficient, it might break some

Catching the url path following a python cgi script?

廉价感情. 提交于 2019-12-11 02:43:08
问题 It's better if I do an example to explain my question: Filename of cgi script: 'awesome' URL: http://omgpython.com/awesome 'awesome' script runs normally. I append a 'fake' path: '/omg/so/fake' URL: http://omgpython.com/awesome/omg/so/fake' 'awesome' script runs normally without any errors, but is it possible to catch the 'fake' path within 'awesome'? I'm trying to clean the URL by not using URL params. 回答1: You want os.environ['PATH_INFO'] . In the second example it will contain " /omg/so

JQuery inside here-doc not working

时光总嘲笑我的痴心妄想 提交于 2019-12-11 02:33:04
问题 Is it possible to include JQuery in the here-doc section of perl. I tried but no success. Here is my code. my $cgi = CGI->new();print header();print start_html("JQuery in perl"); print <<JS; <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script><!-- $(document).ready(function(){ $("p").click(function(){ $(this).hide(); }); }); //--></script> <p>Click to hide</p> <p>Click to hide</p> <p>Click to hide</p> </body> JS print end_html(); But when I write a

How can I call Perl from my PHP page on apache?

☆樱花仙子☆ 提交于 2019-12-11 02:27:33
问题 my friend and I are creating a log parser for a series of games. We have written the frontend (web) in PHP/MySQL and the parser in Perl (also using MySQL, of course). Now we are having problems getting these two to communicate. All we wan't to do is this: one administration page online where you have the button "parse". When you click this a Perl script should start. Like "exec("perl /home/www/Init.pm -f games_mp.log"). Is this possible? Remember, it's suppose to be easy to set up. We've

Is CGI still slow when used with a compiled program that doesn't require a VM?

风格不统一 提交于 2019-12-11 02:19:57
问题 When I learned CGI I learned that any programing language can be used to hook it's output to the http response message and it's input is the http request message. Many articles I've red talk about CGI in the context of Perl, is this because Perl is the most common language used in conjunction with CGI? What I'm wondering is if CGI connects to a program written in C/C++ would it still be slower than using PHP? 回答1: CGI is a standard denoting how an application should interact, not a specific

ImportError while running cgi-bin on localhost - undefined symbol: lo_truncate64

試著忘記壹切 提交于 2019-12-10 23:18:19
问题 I'm trying to run a cgi-bin site on localhost. And I get the following error: <type 'exceptions.ImportError'>: /usr/local/lib/python2.7/dist-packages/psycopg2/_psycopg.so: undefined symbol: lo_truncate64 My current PostgreSQL version is 9.4.5. How can I fix the issue? 回答1: The comment by Ali Nikneshan under now deleted answer saved me couple times already when I had this same problem. Not sure why it was deleted, but here I am reposting it in hopes it helps someone: pip install -U --no-cache

Tomcat配置系统管理、配置应用管理、部署一个应用、配置虚拟主机基础验证单点登录、限制主机访问

做~自己de王妃 提交于 2019-12-10 22:03:49
配置系统管理 (Admin Web Application) 大多数商业化的JavaEE服务器都提供一个功能强大的管理界面,且大都采用易于理解的Web应用界面。Tomcat按照自己的方式,同样提供一个成熟的管理工具,并且丝毫不逊于那些商业化的竞争对手。Tomcat的Admin Web Application最初在4.1版本时出现,当时的功能包括管理context、data source、user和group等。当然也可以管理像初始化参数,user、group、role的多种数据库管理等。在后续的版本中,这些功能将得 到很大的扩展,但现有的功能已经非常实用了。 Admin Web Application被定义在自动部署文件:CATALINA_BASE/webapps/admin.xml 。 必须编辑这个文件,以确定Context中的docBase参数是绝对路径。也就是说, CATALINA_BASE/webapps/admin.xml 的路径是绝对路径。作为另外一种选择,也可以删除这个自动部署文件,而在server.xml文件中建立一个Admin Web Application的context,效果是一样的。不能管理Admin Web Application这个应用,换而言之,除了删除CATALINA_BASE/webapps/admin.xml ,可能什么都做不了。

/dev/mem access denied on raspberry pi

痴心易碎 提交于 2019-12-10 21:55:30
问题 I am working with my Raspberry Pi and I am writing a cgi python script that creates a webpage to control my gpio out pins. My script crashes when I try to import RPi.GPIO as GPIO. This is the error that I am getting: File "./coffee.py", line 7, in <module> import RPi.GPIO as GPIO RuntimeError: No access to /dev/mem. Try running as root! My code works perfectly when I use sudo to run my script, but when I am running from a URL from my apache2 server it says that I do not have access to /dev

Perl web serving with nginx and FastCGI - not able to read parameters

空扰寡人 提交于 2019-12-10 20:41:58
问题 There are any number of tutorials out there on how to use FastCGI to CGI wrappers to serve Perl code using nginx. But I'm comfortable working with Perl modules myself, so I don't need the wrapper. I'm trying to figure out the right way to set this up. Here's the code I have so far: #!perl use CGI; use FCGI; my $s = FCGI::OpenSocket(':9000',20); my $r = FCGI::Request( \*STDIN, \*STDOUT, \*STDERR, \%ENV, $s); while ($r->Accept >= 0) { my $cgi = CGI->new; print "Content-type: text/html\n\n";

Debugging CGI python

给你一囗甜甜゛ 提交于 2019-12-10 18:18:04
问题 Is there any easy way to debug cgi python programs apart from looking at the log file each time the browser generates an error? 回答1: You can use the cgitb module. It's as simple as import cgitb cgitb.enable() It doesn't always work (e.g. it won't help you for permission errors, or certain other kinds of errors), but when it does it's quite helpful! 回答2: You could capture (or form by hand) the data and env variables which the CGI script receives, then plainly run the script under your favorite