cgi

Perl CGI display image to browser from file

为君一笑 提交于 2019-12-12 18:30:02
问题 Friends, I have been scouring the web for a solution to displaying images to a web browser with Perl and have found nothing that works for me. I've tried possible solutions such as: How To Display an Image with Perl Outputting Image Data Return an Image From a Script and none of it works for what I'm doing. I want to deny client access to the image (Or even simply place the image file out of the www root) and dish it out server-side. Here is an example of what I'm doing: In my main perl file:

Why does my Perl CGI program return a server error?

╄→尐↘猪︶ㄣ 提交于 2019-12-12 16:05:27
问题 I recently got into learning cgi and I set up an Ubuntu server in vbox. The first program I wrote was in Python using vim through ssh. Then I installed Eclipse on my Windows 7 station and created the exact same Perl file; just a simple hello world deal. I tried running it, and I was getting a 500 on it, while the Python code in the same dir (/usr/lib/cgi-bin) was showing up fine. Frustrated, I checked and triple-checked the permissions and that it began with #!/usr/bin/perl. I also checked

Running scripts from Perl CGI programs with root permissions

强颜欢笑 提交于 2019-12-12 15:28:23
问题 I have a Perl CGI that is supposed to allow a user to select some files from a filesystem, and then send them via Rsync to a remote server. All of the HTML is generated by the Perl script, and I am using query strings and temp files to give the illusion of a stateful transaction. The Rsync part is a separate shell script that is called with the filename as an argument (the script also sends emails and a bunch of other stuff which is why I haven't just moved it into the Perl script). I wanted

I'm searching a cgi lib in C to build a restful web service

江枫思渺然 提交于 2019-12-12 14:00:23
问题 I want to build a restful (CoAP) web service which can execute c code to handle events. Therefore I'm searching a lib which provides me with a rest api in C and cgi similar to restcgi which is sadly in c++ or CGI-Simple which is in perl. The server is running on a embedded device so it has very limited resources and the services will be accessed only by machines. Thank you very much. 回答1: You may be interested in Raphters framework and its architecture. It's pretty small, so you can examine

HTTP basic authentication, using python

房东的猫 提交于 2019-12-12 10:49:54
问题 I want my users to go to a protected directory on my domain. Both .htaccess and .htpasswd are created and reside in the protected library. The html that asks for a username/password combination is: <form method="post" enctype="multipart/form-data" action="bin/logintest.cgi"> Username: <input type="text" name="username" size="20" value="please enter.."><br> Password: <input type="password" name="password" size="20"><BR> <input name="submit" type="submit" value="login"> The python cgi script is

a (presumably basic) web scraping of http://www.ssa.gov/cgi-bin/popularnames.cgi in urllib

佐手、 提交于 2019-12-12 10:44:22
问题 I am very new to Python (and web scraping). Let me ask you a question. Many website actually do not report its specific URLs in Firefox or other browsers. For example, Social Security Admin shows popular baby names with ranks (since 1880), but the url does not change when I change the year from 1880 to 1881. It is constantly, http://www.ssa.gov/cgi-bin/popularnames.cgi Because I don't know the specific URL, I could not download the webpage using urllib. In this page source, it includes:

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

回眸只為那壹抹淺笑 提交于 2019-12-12 08:36:46
问题 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

multi threaded FastCGI App

一世执手 提交于 2019-12-12 08:31:40
问题 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

CGI script not executing bash commands such as 'CP'

自古美人都是妖i 提交于 2019-12-12 06:06:24
问题 I have a web server (apache2) set up to execute files with a .cgi file extension. This works for some commands. However, I need it to copy the file /var/www/on.html to the location of /var/www/a1.html. I am using Debian Linux. The script is as follows: #!/bin/bash echo "Content-type: text/html" echo "<html><head><title>Light on" echo "</title>" echo "<meta http-equiv='refresh' content='1; url=http://86.11.221.243' />" echo "</head><body>" echo "$(gpio mode 8 out) #this turns the light on"

What is the best method to set a session cookie using Python 3.x and Cgi on Apache?

余生长醉 提交于 2019-12-12 05:31:23
问题 I develop in Php, Perl and now am liking Python so much that I want to use it on the web. I can get things working that I need except for a good method for setting/managing sessions. Any help out there? Point me to a library? or ideally post some working python code for my technology stack? (looking for updated information on how to do this without depending on any framework) 来源: https://stackoverflow.com/questions/45155617/what-is-the-best-method-to-set-a-session-cookie-using-python-3-x-and