cgi-bin

Importing & running matplotlib via CGI

别等时光非礼了梦想. 提交于 2021-02-11 17:28:19
问题 I'm having some dramas with matplotlib and CGI, despite a night spent searching for solutions. In brief, I'm running Python2.7 with matplotlib through a Bluhost server. I have want a simple script to display an image, but it's getting stuck on the import of matplotlib: import cgitb, os cgitb.enable() import matplotlib The traceback yields the following: : No module named matplotlib args = ('No module named matplotlib',) message = 'No module named matplotlib' Any clues? It seems most of the

Running PHP file outside of documentroot (cgi-bin folder)

岁酱吖の 提交于 2019-12-31 03:55:12
问题 I am working with a colleague to set up their local environment on a MAC in XAMPP, on windows my vhost looks like the one below. When I access a URL like http://domain.local/cgi-bin/handler.php the web server processes the PHP correctly but on his we get a 500 server error and this message... The server encountered an internal error and was unable to complete your request. Error message: Premature end of script headers: We tried changing the name of the cgi-bin folder to something else as I

Return an image to the browser in python, cgi-bin

元气小坏坏 提交于 2019-12-29 00:44:05
问题 I'm trying to set up a python script in cgi-bin that simply returns a header with content-type: image/png and returns the image. I've tried opening the image and returning it with print f.read() but that isn't working. EDIT: the code I'm trying to use is: print "Content-type: image/png\n\n" with open("/home/user/tmp/image.png", "r") as f: print f.read() This is using apache on ubuntu server 10.04. When I load the page in chrome I get the broken image image, and when I load the page in firefox

java.lang.IllegalStateException: Cannot create a session after the response has been committed

假装没事ソ 提交于 2019-12-28 07:09:14
问题 I've got this really strange request for an invalid URL on: Invalid URL: /cgi-bin/1st.cgi This is causing the following error: SEVERE: Exception initializing page context java.lang.IllegalStateException: Cannot create a session after the response has been committed at org.apache.catalina.connector.Request.doGetSession(Request.java:2381) at org.apache.catalina.connector.Request.getSession(Request.java:2098) at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:833) at

Steps in order to pass data from HTML form to Perl script

白昼怎懂夜的黑 提交于 2019-12-24 01:44:41
问题 I have created a simple HTML, which contains the form below: <form action="WEB-INF/cgi/run.pl" method="post"> <table border="0" cellspacing="0"> <tbody> <tr><th align="center" bgcolor="F7F5F2"> <p class="normal">Submission Form</p> </th></tr> <tr><td align="center" bgcolor="F7F5F2"> <p class="normal">Insert your text below:</p> </td></tr> <tr><td><textarea wrap="virtual" name="seq_data" rows="15" cols="80"></textarea></td></tr> </tbody></table> or upload a file : <input type="file" name="file

ScriptAlias configuration not working in apache2

╄→гoц情女王★ 提交于 2019-12-23 16:30:04
问题 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.

Output of command in Bash script to Drop-down box?

百般思念 提交于 2019-12-20 06:19:05
问题 First off, I appreciate any and all help in answering this question. I have a command in a bash script that will output the following: 255 254 253 252 ... 7 6 5 4 3 2 1 It is a specific list of numbers, beginning with the largest (which is what I would like), then going to the smallest. The dataset is space-delimited. The output above (except including all numbers), is what you would see if you ran this command in the terminal on a linux machine, or through a bash script. I have configured my

Why can't I execute another python script using the subprocess module via a webserver

两盒软妹~` 提交于 2019-12-13 16:37:35
问题 Having a problem envoking another script, by the way it works fine from the console when I just call python main.py (which then calls test3.py) but when I do it via the webserver it gives the error below which is cryptic I can't call this (test3 is just a print...) #proc = subprocess.Popen(['python', 'test3.py'], stdout=subprocess.PIPE) but this works fine proc = subprocess.Popen(['ls', '-la'], stdout=subprocess.PIPE) Error Log in /var/log/httpd-error.log on FreeBSD [Thu Mar 01 12:26:55 2012]

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

Why is my stdout interfering with my webpage in python?

妖精的绣舞 提交于 2019-12-11 07:28:45
问题 Really simple code that just fires one pcap (packet) using scapy, If I just want to do simple cgi-bin POSTS to myself to run a set of 10 easy tests why is this just kicking back as text (rather than a website). If I comment out the line sendp(a, iface="em1") Then the below code actually generates the website fine... but it won't actually send the packet, I imagine this is something with stdout.... suggestions are welcome! #!/usr/local/bin/python from scapy.all import * #import v6tester_main