5,182
questions
0
votes
0
answers
9
views
Binary runs fine from the terminal but when run from a CGI script gives weird error
I have a legacy binary that needs to be served up through a legacy CGI script. Recently, the website stopped working as intended due to the output of the binary missing. When investigating, I found ...
0
votes
1
answer
40
views
Why http.server does not deliver the data to the CGI script in this basic example?
I am testing the legacy CGI functionality of python http.server module by implementing a "hello world" alike example that sends data from a fictional "add customer" form from the ...
0
votes
0
answers
35
views
Error while running C++ CGI file on the Apache2 server
I created a main.cpp which is converted to song_stack.cgi and is stored in /opt/homebrew/var/www/cgi-bin
the httpd.conf file is stored in /opt/homebrew/etc/httpd/httpd.conf
I created an index.html and ...
0
votes
0
answers
31
views
Error in display the desired output on the webpage with c++ uisng CGI
I am making a music player that has the link stored in a stack.
Error:
I am trying to add the song html to a stack on the webpage it is showing me the following thing when i click on add button or any ...
0
votes
0
answers
30
views
Converting from a cgi based project to Flask
I have multiple python scripts on a VPS running Apache. These use cgi so I make http calls from my front end (VBA in Excel). I believe that this architecture is not optimal. I have installed Flask and ...
0
votes
0
answers
52
views
Apache Error 500: Problem with cgi script execution on python 2.4
When trying to access a python file via http request. I get an error:
Internal server error
The server encountered an internal error or misconfiguration and was unable to fulfill your request.
Please ...
1
vote
1
answer
162
views
Drop-in replacement for the cgi module
Python 3.13 removed the cgi module.
While there are many ways described how to workaround that issue, e.g. via using urllib and the email package, for one project I actually need a drop-in replacement,...
0
votes
0
answers
19
views
Having problems running flask-app on CGI - app code works, htaccess (probably) breaks it
I am trying to run a Flask Webapp with simple Login/Logoff Functionality (for now). It is a simple a small private project. As i do not have any WSGI-options with my shared hosting provider, i have to ...
0
votes
2
answers
39
views
Python flask adding additional new lines to file while saving
While writing html textarea content in a file, python flask is adding additional new lines in the file.
There is no issue while reading the content on textarea.
Initial file content:
line1
Line2
Line ...
0
votes
0
answers
26
views
Why does elementTree break CGI file when printing to HTML?
I'm trying to create a simple CGI program that will output XML to an HTML webpage. In the course of debugging, I noticed that tree = ET.parse(path) prevents HTML from displaying on the webpage.
Here'...
0
votes
1
answer
28
views
Convert single-line .CGI to Multiline in Powershell
I have a media application that outputs the playlist into a handy .CGI web file. When viewing from browser (view-source:http://) is shows it as a list (line 1, 2, 3 etc); however Powershell's Invoke-...
0
votes
0
answers
12
views
Flask and Perl on Apache - can they coexist on Port 443?
I have Flask WSGI running on Apache2, port 443, via the Virtual Host directive in a sites-enabled conf file on Ubuntu 22.4. I also have CGI scripts (both Perl .cgi and Python .py enabled by the Add ...
0
votes
0
answers
24
views
Redirect video resource on Apache Tomcat
I have a Tomcat 10 server with my java application and I have an IP camera with a html cgi video resource to view the stream.
This camera has a standard Digest Auth and I want to embedd its video ...
0
votes
0
answers
29
views
Shellshock command on pWnOS 1.0 doesnt work
"So I create a quick bash script with the extension of .CGI in the /tmp directory.
Again I used the Webmin file inclusion to call the file I had created in the tmp directory and using tamper data....
0
votes
0
answers
44
views
Using Apache to Proxy HTTP Requests to HTTPS for Legacy Win32 EXE without SSL Support
I have a Win32 exe program installed on hundreds of clients. This application makes an HTTP API call to retrieve information about an address based on the provided ZIP code. The exe calls an address ...
0
votes
0
answers
19
views
Unable to run cgi program on apache2 server (with some mod_jk configuration)
In a apache2 server which have enabled mod_jk to access tomcat10 contexts, it was also enabled and configured the mod_cgid to run programs from the folder /var/www/apps/cgi-bin.
But when I try access ...
0
votes
1
answer
154
views
New Apache2 and Virtual Host install showing plain text for cgi directory
I have a new vps which has Ubuntu 22.04 installed and Apache/2.4.52 (Ubuntu). I have SSL installed on this machine, and created a Virtual Host which looks like this:
<VirtualHost *:443>
...
0
votes
1
answer
133
views
Python in web. Cgi, flask and py-script
I am working on my pet-project which is supposed to take user's data from web page and show the result (calculated on python). I just do not know how to connect my python code with html+css+js page.
I ...
1
vote
0
answers
90
views
Delphi CGI SQL query runs on one machine but not the other
I have a console app running queries to a SQL Server. The SQL Server and the website are running on the same server (colocation). I have an image of the website on my local machine where a copy of the ...
0
votes
1
answer
74
views
newlines containing text to SQLite in windows console
Running batch files powered CGI web site with SQLite database, storing text with newlines requirement newly arise.
I am able to store text with newlines into a database by:
sqlite3.exe "\work\...
0
votes
1
answer
82
views
lighttpd return 403 for python script that had been working on older installs
I have a github for a kiln controller that runs on raspberry pi. I did not write the server setup. I did change it enough to run python 3 when that started being an issue. Wrote an install script ...
0
votes
2
answers
349
views
I get a 404 error while trying to open my python file using apache cgi
I'm new to python backend development, I was trying to set up an apache to use cgi-bin and a simple python file.
This is my apache2.conf (I"ve added the following):
<Directory "/var/www/...
0
votes
0
answers
14
views
.htaccess redirect dynamic URLs to new system [duplicate]
I've got an old CGI/Perl based news system that generated URLs like this (only the bit after id= changes / is dynamic):
https://www.mysite.co.uk/cgi-bin/news/viewnews.cgi?id=EEyulAFAAESQUwZyzN
I've ...
0
votes
0
answers
127
views
Can't POST with python's http.server (code 501 Can only POST to CGI scripts)
Here is the python code I use to launch a server (when in the directory D:my-app/ where I have my html and javascript files) :
import http.server
server = http.server.HTTPServer
handler = http.server....
0
votes
0
answers
90
views
Failed to download file from the URL. The server committed a protocol violation. Section=ResponseHeader Detail=Content-Length header value is invalid
I'm facing an issue with downloading a file from a specific URL when using a desktop browser, while it works perfectly on a mobile device (Chrome browser). I've thoroughly tested this in multiple ...
0
votes
0
answers
138
views
How to upload a file with Quasar's q-uploader component to a server running python/cgi?
Hello I am running Apache2 web server on Windows 10 and want to upload single file with Quasar's q-uploader component via python/cgi?
I tried a lot but cannot solve the problem alone.
There is an ...
0
votes
1
answer
478
views
How to refresh symlink in PHP-FPM under apache
I have PHP-FPM running under Apache, and I use symlinks to switch between releases, like /html -> /release/1
However it is a well-know problem that symlinked files are cached under PHP-FPM. The ...
1
vote
0
answers
214
views
What Python code for replacing cgi.FieldStorage for reading contents of uploaded files?
Since the python cgi module will soon be removed, I need a way to capture file contents uploaded through an HTML form that looks like this:
<form id="uploadfile" method="post" ...
0
votes
1
answer
513
views
CGI deployment for a Django Webapp e.g. Strato.de Webhosting
iam trying to deploy my django app via cgi on strato.de . Strato only supports basic cgi so iam forced to use this method.
I already made a flask app run on strato via cgi with this tutorial ( btw ...
0
votes
1
answer
38
views
Sending uploaded file from JS to Python CGI always results in ampty dictionary
I have an HTML form that has a file input element. When submitting the form, a JS function is executed which checks if the uploaded file is a PDF file and is less than 10MB. All of this works ...
0
votes
1
answer
74
views
ModuleNotFoundError when activating venv virtual environment in a python CGI script
I just started using the huggingface transformers library and have been experimenting with it via Pytorch and venv.
If I activate the venv virtual environment from a shell, it works just fine.
However,...
0
votes
0
answers
10
views
Why when I use print(type()) in cgi, it returns nothing in my webages?
#!/usr/bin/env python3
print('content-type: text/html\n')
print(type(True))
When I excute this code in teminal, it returned
<class 'bool'>
But when I excute this code in cgi, it returned ...
2
votes
2
answers
328
views
CGI::param called in list context and Undefined subroutine &CGI::Plus::randword called errors
I am trying to dockerize a web application which is in perl and at the end it connects with MariaDB via Apache.
I already have a database setup. My containers are running but the problem is with perl ...
1
vote
0
answers
56
views
CGI perl script can't write to file
I'm running Apache 2.4 on Centos 7. I've spent a week on this problem and it's getting stressful (this is a test file, I'm setting up access for a third party to be able to write to a file on the ...
0
votes
1
answer
163
views
Got [cgi:error] AH01215: (8)Exec format error: exec of '/cgi-bin/echarts.js' failed
Perl script use CGI to generate html with echarts.js. Error information like below:
[Fri Aug 25 10:07:17.488252 2023] [cgi:error] [pid xx] [client xxxx] AH01215: (8)Exec format error: exec of '/cgi-...
0
votes
0
answers
57
views
Why I don't need Content-type when my DirectoryIndex points to a Perl CGI script
I changed the file mods-available/dir.conf this way:
DirectoryIndex /cgi-bin/csv_auth
In csv_auth which is a Perl CGI script I have this:
#! /usr/bin/perl ...
1
vote
2
answers
324
views
Invisible files in /tmp directory
I have a CGI::Session script that writes the session id to the /tmp file. The script doesn't error out, but when I check the /tmp directory, I don't find the cgisess* file. This is the permission of /...
1
vote
3
answers
91
views
Why can't I interpolate the $cgi->param($key)?
I am debugging this script and the value of the CGI params are showing up like this:
username
CGI=HASH(0x55887d94d850)->param{username} <--- Why is that? It should show the value.
password
CGI=...
-3
votes
1
answer
82
views
Why my php and python files are not running in mac [duplicate]
I have installed php and python in my mac and made the changes required in httpd.conf file as well.
I have restarted the apache web server as well.
Here is my php webpage
Here is my python webpage
...
-1
votes
1
answer
39
views
New session created for each instance in Perl web app using CGI::Application::Plugin::Session
Caveat: similar to, but still different from this thread.
In a home-rolled ecomm app, a session with a param of order_id is created by a Perl module common to all instances when an item is added to ...
0
votes
1
answer
103
views
chpasswd.cgi - change password on web won't work with more than 8 chars
Good night!
I'm using a chpasswd.cgi to change password via web, the problem is that when I change the password to 123456789 it won't work. I'm migrating a proxy server to a new one, and I have more ...
0
votes
0
answers
21
views
Strange behavior of simple Python CGI script
For testing purposes, I created a very simple CGI script in Python 2.7, as shown below:
#!/usr/bin/env python
import os
import sys
version = sys.version.split('\n')[0]
print "Content-Type: text/...
1
vote
1
answer
150
views
Perl script not displaying properly within Apache web server (Mac)
So I have a Perl script that I want to run within an Apache web server and everything seems to be working correctly except for the formatting. The server displays the Perl script as plain text rather ...
1
vote
1
answer
64
views
sscanf ignoring "&" and scanning past where it is supposed to
I am using a .cpp file I compiled to run as a .cgi file on my website, receiving data from a web form, which it then runs sscanf() on to get the data extracted from the formatting that was sent in.
...
2
votes
0
answers
2k
views
Since the CGI module is slated to be deprecated in Python 3.13, what is a good substitution for cgi.FieldStorage?
I tried to use multipart, email.message, html.parse and requests but none seem to be doing what I need, which is getting the fields of an HTML form. Any suggestions?
0
votes
1
answer
65
views
Which permission for a directory when CGI code creates subdir?
In a CGI script, I execute a system call to make a directory, namely mkdir $dir. The parent directory under which this new directory is being created has a permission of 755. It doesn't allow me to ...
1
vote
0
answers
46
views
Display Warning Message if Any Form Fields are Blank - Python/CGI/HTML
I have a small application that displays a form with four fields. I'm trying to build in some validation so that a warning message is displayed if one or all of the fields are blank when a user clicks ...
0
votes
2
answers
49
views
CSS print shows white Bar
I'm trying to create an ticket width the dimensions (203mmx82mm). This is in HTML and CSS via python (cgi, jinja2, weasyprint) the template will be converted to an pdf, which the user can download via ...
1
vote
0
answers
76
views
Wampserver C++ CGI Script 500 Internal Server Error
I am using gcc compiler to compile both C and C++ CGI scripts. My C CGI script works just fine. However, I am getting a 500 Internal Server Error for running C++ CGI scripts. Here is my C++ code:
#...
1
vote
1
answer
113
views
How to pass perl $dbh objects between scripts
I have to maintain some Perl CGI scripts in our production codebase. The problem is that when the CGI job runs, it takes some time to instantiate the Perl DB's $dbh object before it could be used to ...