cgi

Configure Apache to use Python just like CGI PHP

橙三吉。 提交于 2019-12-02 10:26:25
I think one commonly known way of adding PHP to an Apache webserver is to configure it like this: ScriptAlias /php5.3 /usr/local/php5.3/bin Action application/php5.3 /php5.3/php-cgi AddType application/php5.3 .php Now I tried to write a similar configuration for Python: ScriptAlias /python /usr/bin Action application/python /python/python AddType application/python .py I have a small test script that looks like this: print "Content-Type: text/html\n\n" print "Test" But something seems to be wrong since the apache error log says the following: Premature end of script headers: python So my first

Writing a perl cgi applications which runs as root

旧城冷巷雨未停 提交于 2019-12-02 08:30:21
I am writing a perl cgi application. At some point of time this cgi application needs to run as root to access and write into a specific file. I would like to know how exactly I should go about doing this and the security precautions that I should take while doing it. You pretty much shouldn't. If you can't avoid it, create a small and simple piece of code that runs with setuid root that does exactly that task and nothing more, or use sudo or similar to run a script that does just that. Giving that file the appropriate permissions so that your web user can write to it (not necessarily read

How can I use a database server from a Perl CGI script?

最后都变了- 提交于 2019-12-02 08:28:16
My program works already, I have Perl (GUI Window) where I can input data, data passed to the webpage (using to Tomcat server, JSP) and then saved it to oracle database. What I want is to make search parameter (webapp) that retrieve/extract data from the Oracle database using Perl CGI. Is it possible? Or any suggestions to solve my program? Thanks!:-) draegtun Yes you can by using DBI and DBD::Oracle modules. However there are some gotchas with Oracle. I remember a few fun and games with Oracle 8 so these may no longer be applicable but it did require setting ENV variables like ORACLE_HOME,

How to upload and open a file in xampp apache server using CGI Perl Script?

那年仲夏 提交于 2019-12-02 07:46:12
问题 This code works fine in my local xampp apache server. I run the same code in local area network with different ip addressed system. The file cannot open and i cant write it to the expected directory. Kindly do the needful? Thanks in advance. Am passing the xml file through below code. #!"C:\xampp\perl\bin\perl.exe" #!"172.18.5.23:\xampp\perl\bin\perl.exe" #!\usr\bin\perl -wT #!perl use strict; use warnings; use CGI; my $query = new CGI; print $query->header( "text/html" ); print <<END_HERE;

I am trying to create a form with PERL/CGI, and I would like to process the data introduced in that form within the same CGI file

£可爱£侵袭症+ 提交于 2019-12-02 07:39:55
' I am trying to create a form with PERL/CGI, and I would like to process the data introduced in that form within the same CGI file. This is what I have for my code on the HTML5 side….' <body> <form action="form.cgi" method="get"> </form> <h1>Feedback Form</h1> <p>Please fill out the entire feedback form.</p> <table> <tr> <td><b>To (recipient's e-mail address):</b></td> </tr> <tr> <td><input type = "text" name = "mailTo" size = "40" /></td> </tr> <tr> <td><b>From (your e-mail address):</b></td> </tr> <tr> <td><input type = "text" name = "mailFrom" size = "40" /></td> </tr> <tr> <td><b>Enter a

Returning Output of Python CGI MySQL Script

旧街凉风 提交于 2019-12-02 07:13:46
问题 I'm very new to Python and MySQL and this is my first Stack question. So, apologies in advance if I'm missing something obvious. But, I really did try to research this before asking. I'm trying to learn the basics of Python, MySQL, and CGI scripting. To that end, I've been reading tutorials at http://www.tutorialspoint.com/python/python_cgi_programming.htm and http://www.tutorialspoint.com/python/python_database_access.htm, among others. I'm trying to have a CURL GET or Python Requests GET

编译安装PHP7

…衆ロ難τιáo~ 提交于 2019-12-02 07:12:54
#按需求自行删减 cc gcc-c++ make cmake automake autoconf gd file bison patch mlocate flex diffutils zlib zlib-devel pcre pcre-devel libjpeg libjpeg-devel libpng libpng-devel libxml2 libxml2-devel freetype freetype-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel libcurl libcurl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel openssl openssl-devel openldap openldap-devel openldap-clients openldap-servers openldap-devellibxslt-devel nss_ldap kernel-devel libtool-libs readline-devel gettext-devel libcap-devel php-mcrypt libmcrypt libmcrypt-devel recode

Perl warning printed without 'use warnings' or -w in any files

佐手、 提交于 2019-12-02 07:03:55
问题 I have a lot of old Perl code that gets called frequently, I have been writing a new module and all of a sudden I'm getting a lot of warnings in my error_log for Apache, they are for every module currently being used. e.g, "my" variable $variable masks earlier declaration in same statement at /path/to/module.pm line 40 (#1) Useless use of hash element in void context at /path/to/another/module.pm line 212 (#2) The main layout of the codebase is one giant script that includes the modules and

Perl warning statements being printed without 'use warnings' or -w in any files

夙愿已清 提交于 2019-12-02 05:11:46
I have a lot of old Perl code that gets called frequently, I have been writing a new module and all of a sudden I'm getting a lot of warnings in my error_log for Apache, they are for every module currently being used. e.g, "my" variable $variable masks earlier declaration in same statement at /path/to/module.pm line 40 (#1) Useless use of hash element in void context at /path/to/another/module.pm line 212 (#2) The main layout of the codebase is one giant script that includes the modules and directs the requests to them needed to create certain pages for the website and the main script then

Python CGI queue

冷暖自知 提交于 2019-12-02 04:53:42
I'm working on a fairly simple CGI with Python. I'm about to put it into Django, etc. The overall setup is pretty standard server side ( i.e. computation is done on the server): User uploads data files and clicks "Run" button Server forks jobs in parallel behind the scenes, using lots of RAM and processor power. ~5-10 minutes later (average use case), the program terminates, having created a file of its output and some .png figure files. Server displays web page with figures and some summary text I don't think there are going to be hundreds or thousands of people using this at once; however,