Questions tagged [cgi]
Cgi is the common gateway interface, used for interactive webpages.
277
questions
0
votes
2
answers
67
views
Why is my browser displaying the Content-Type line?
Following what's described here --- https://httpd.apache.org/docs/2.4/howto/cgi.html --- I've created a tiny Perl document:
#!/usr/bin/perl
print "Content-Type: text/html; charset=utf-8\n\n";...
0
votes
1
answer
116
views
Lighttpd CGI downloads .py instead of running it
I have two CGI test scripts in lighttpd.
When I open Bash http://host/cgi-bin/test.sh URL I get a valid response from the script.
But when I open Python http://host/cgi-bin/test.py the file is ...
0
votes
1
answer
235
views
lighttpd: ajax request prints the content of cgi script instead of running it
I am using lighttpd version 1.4.55 within an ARM environment. I created an HTML pages in which there is a button used to download some json data. This button trigger a submit form that calls a cgi ...
0
votes
0
answers
617
views
python.exe - The FastCGI process exceeded configured activity timeout
I'm trying to host a Flask (Python) application on a Windows server, but it was giving me
request timeout error, then I changed it to 300 seconds (5 minutes), and after that, it's giving me an ...
0
votes
3
answers
713
views
CGI scripts: when can you return a document, instead of an HTTP response?
Script 1 below is bash, and is at https://example.com/cgi-bin/test. It produces the output 'Under construction' when fetched. It echos Status and Content-type headers, and some HTML. If I instead try ...
2
votes
1
answer
535
views
Accessing TP-LINK TL-SG1016PE switch behind reverse proxy
I am trying to access my switch through my Nginx reverse proxy. I can access the switch fine using the local ip over http, but when I try with the domain name through my reverse proxy with over https, ...
0
votes
2
answers
792
views
Run a perl script in a browser via a link
I'm attempting to get a perl script up and running on Oracle Linux 8.5.
My Apache server and virtual hosts work with static html.
My test virtual host, fnu, has a very basic perl script named hw.pl in ...
0
votes
1
answer
355
views
Prevent Apache2 from executing CGI in Static Directory
I am running an Apache 2 web server running on Ubuntu 20.04 LTS. I have a Python CGI handler enabled for the /var/www/html directory, which is the DocumentRoot. I am wondering how to exclude a certain ...
1
vote
1
answer
394
views
Permission denied for gitweb.cgi on CentOS
I've set up gitweb on my web server. I have created projects on the server. I can add commits to them and also clone them remotely.
The gitweb "homepage" does display and the static files ...
0
votes
1
answer
316
views
Failed to set up Apache for executing PERL file in FreeBSD
I've successfully installed perl5 and apache24 in FreeBSD 12. Then I enabled apache24 in /etc/rc.conf and see index.html placed in the path /usr/local/www/apache24/data. Then in the file /usr/local/...
0
votes
1
answer
271
views
SCGI vs FastCGI - Which one is faster? [closed]
I want to use one of servers - libscgi and libfcgi - with dynamic content. Which one seems to be faster?
1
vote
1
answer
160
views
Random Internal Server Error
We are receiving random internal server errors on one of our website.
These internal server errors can sometimes appear only on some users but other users are not receiving it (at the very same time) ...
0
votes
2
answers
1k
views
How to prevent users from executing cgi scripts directly?
Apache server. There is a python script in http/cgi-bin which is used to display some content on a page. But a user can then do \<website>/cgi-bin/<script_name> to access it directly, ...
1
vote
0
answers
106
views
`baseurl` when hosting fossil as CGI
I'm self-hosting a repository on https://example.com/, running Apache. I've created a CGI script named index.cgi under DOCUMENT_ROOT as described in https://www.fossil-scm.org/fossil/doc/trunk/www/...
0
votes
1
answer
1k
views
CGI binary does not execute, instead gets downloaded
I have an apache 2.4.46-3 server, which serves out of /srv/http. I have a folder /srv/http/bin with 2 files:
.htacces (mode 644):
AddHandler cgi-script .exe
Options +ExecCGI
main.exe (mode 755): ...
0
votes
1
answer
804
views
How to Enable Immediate CGI Line Outputs With Nginx, Without Waiting for a CGI Script to Finish?
I have a perl and shell script that process a bunch of data and output results as they happen, like:
5 processed in 0.58 seconds.
10 processed in 0.79 seconds.
...
150 processed in 0.65 seconds. DONE!
...
0
votes
1
answer
441
views
Webmin shows plain Perl script when try to open login page
when I try to open webmin login page "https://192.168.1.13:10000" it shows plain Perl script like below, what is problem?
I'm running Ubuntu 18.04 and latest version of webmin.
#!/usr/bin/perl
#
# ...
1
vote
0
answers
4k
views
nginx site shows blank page. No errors
Background
I'm trying to get an nginx /php-fpm7 site up and running on an alpine linux server.
Problem
No errors appear when i navigate to it. Cert is good. And the in the /var/log/access.log ...
1
vote
1
answer
790
views
SELinux, Nginx and fcgiWrap: how to allow access to fcgiWrap socket?
I am under Fedora 31 (linux kernel 5.4.13, Nginx 1.16.1, fcgiwrap 1.1.0) running with SELinux in enforcing mode (policy: targeted 3.14.4-44.fc31).
My box hosts a server driven by Nginx. Part of it ...
0
votes
0
answers
2k
views
Python CGI script not displaying on the website at all. Apache 2 Debian 10
me and my friend have started up a server on Debian 10 and its running Apache2. I have written a very simple website and a python script just to test the cgi scripts. So basicly after a user completes ...
0
votes
2
answers
435
views
How to implement multiple sites using same code on a single apache server?
I have a mod_cgi code "site.py" which is used to serve a website. I'm running several instances of this website on a single apache server, each instance has its own config file.
Currently my apache ...
0
votes
1
answer
724
views
How's hacker used cgi script on Apache2 server to hack and delete database
Today one of my server has been hacked and hacker deleted my app database. And to restore back they are asking to pay money in BTC.
Well, I started investigating to Apache2 logs and found many ...
1
vote
1
answer
949
views
Loading css from cgit on nginx in a subdirectory
before I start I should note that I have absolutely no experience with nginx or networking, so what I have done was thanks to searching and trying different solutions.
I have a problem I struggle ...
5
votes
2
answers
15k
views
What is the difference between a proxy server and a gateway server?
From Proxy server on Wikipedia:
A proxy server may reside on the user's local computer, or at any
point between the user's computer and destination servers on the
Internet. A proxy server that passes ...
0
votes
0
answers
246
views
Apache misconfiguration - config works on apache 2.2 but not 2.4
I have a set of cgi scripts which run on a RHEL 6.x (with Apache 2.2) box fine.
There is a cgi-bin directory containing the scripts, plus an index.html (pure html) which serves as a front end to the ...
0
votes
1
answer
723
views
Enable a single CGI script for Apache within the document root?
Is it possible to enable a single CGI script stored within the Apache 2.4 document root ?
I was hoping something like the following might be possible :
<VirtualHost *:80>
DocumentRoot "...
0
votes
1
answer
666
views
Pin point 500 Error which seems to orginating from FastCGI Module
I have a php application which I have been hosting on IIS that has suddenly stopped working and returns a server 500 error.
In an attempt to troubleshoot it I have added a Failed Request Tracing Rule ...
1
vote
1
answer
293
views
Trace httpd when using cgi
I have configured httpd (apache2.4.6) cgi to run /bin/bash scripts.
I would like to trace httpd calls of /bin/bash and see the actual command that is run.
So far I have tried to use strace -p but for ...
0
votes
1
answer
487
views
Protecting access to CGI programs via reverse proxy
I am still a noob and autodidact in the network field, so please forgive me if what I am going to ask is just wrong.
I have a web application based on JavaScript and PHP and served from my Apache web ...
3
votes
2
answers
152
views
Force all Perl scripts to run with `use strict`
I just went through a large legacy Perl web application (built using cgi-lib.pl and running as CGI with Apache HTTPD) and updated every script to use strict;, fixing a lot of small bugs along the way. ...
1
vote
0
answers
1k
views
Apache 2.4.29: cgi scripts load as text, even though cgi is enabled and .conf set up
I spent a few days searching for answers on serverfault and elsewhere, and tried them all to no avail. I'm trying to serve dynamic content using perl cgi scripts (Apache 2.4.29 on Ubuntu 18.04.2). The ...
1
vote
1
answer
199
views
What can be a FastCGI client?
fcgiweb is a server based on FastCGI protocol.
What can be a FastCGI client? Is a CGI script a FastCGI client, or is a web server (e.g. Nginx) a FastCGI client?
Thanks.
0
votes
0
answers
453
views
How can I configure Nginx to use PHP in CGI-mode?
The Nginx tutorial shows PHP 5 being used in FastCGI mode on Windows, but PHP 4 doesn't support php-cgi.exe so it must be run in traditional cgi mode,
There are two ways to set up PHP to work with ...
0
votes
0
answers
924
views
SetEnvIf doesnt work from htaccess
I'm trying to overcome the infamous missing Auth header problem with Apache, PHP and CGI.
If I set this in a virtual host, I can successfully read the Bearer token from the Authorization header.
...
0
votes
1
answer
776
views
ERROR: (gcloud.app.deploy) - python script
I am trying to deploy a python application and I am receiving the following error message:
ERROR: (gcloud.app.deploy) Error Response: [4] Your deployment has failed to become healthy in the ...
0
votes
0
answers
761
views
How does apache choose the executable for a cgi script?
I've been doing some experiments, and trying to understand the results.
In my apache conf I have:
balter@balterbox:/etc/apache2$ cat sites-enabled/000-default.conf
.
.
.
<Directory /var/...
1
vote
1
answer
4k
views
APACHE SetEnv directive (from .htaccess) not send to CGI process
I don't understand Apache2 mecanism in this scenario :
1/ In this location : var/www/cgi-bin/ (user's group rights : www-data)
i've a CGI script (php-cgi) who will execute PHP app + VAR environement ...
1
vote
1
answer
284
views
how to disable a spcific cgi page in apache?
I have an Apache server that hosts multiple sites, one of them use CGI, one of them does not. While security scanning this non-CGI site was flagged in the tool for security review for a CGI page.
I ...
0
votes
0
answers
146
views
A script runs via localhost but not via 127.0.0.1
I am trying to migrate some software from apache 2.2 to 2.4. I have it working - almost. When accessing the server via address localhost things work, but when trying to access via 127.0.0.1 some ...
0
votes
1
answer
514
views
Different PHP modes for Apache Virtual Hosts
I got LAMP stack installed on Centos 7. Also I have three CMS up and running on httpd virtual hosts: WordPress, Joomla and OpenCart.
The question: how to configure different PHP modes, CGI and FCGI ...
0
votes
1
answer
2k
views
How to configure .htaccess to run JavaScript with node as CGI
I'm testing this on my linux localhost.
This is what I'm trying:
balter@spectre:/var/www/html$ cat .htaccess
Action cgi-node "/usr/bin/env node"
AddHandler cgi-node .js
balter@spectre:/var/www/html$...
-1
votes
2
answers
2k
views
.htaccess vs php.ini in mod_php and CGI
As far as I know, mod_php can be configured either by means of php.ini or .htaccess files while, for CGI, .htaccess files cannot be used.
Does the fact that mod_php can use .htaccess files makes it ...
5
votes
1
answer
1k
views
Nginx and fcgiwrap, incremental output problems
When I run a cgi script under Apache any output is rapidly sent to the client. However when I run it under nginx with fcgiwrap it seems nothing is sent to the client until the script either finishes ...
-3
votes
1
answer
77
views
Issue with high server load centos
I'm having some major issues with one of my servers.
Server load is extremely high: load average: 142.28, 144.80, 139.6
The server is running Centos 6 and has a Perl image sharing script running on ...
1
vote
0
answers
299
views
Unable to run cgi script
I've installed backuppc on a fresh Xubuntu. Everything went fine except that when I try to access the web interface, instead of running the CGI script I'm prompted to download a bin file.
I'm no ...
0
votes
2
answers
133
views
Why is Apache returning characters "MZ" for any .lc URLs
I have just installed Apache 2.4 on Windows Server 2016 Datacenter (AWS EC2 instance). Web server seems to be working fine, I can access 'http://localhost/' and get the 'It Works!' page.
Location: C:\...
0
votes
1
answer
2k
views
CGI stopped working on setting Nginx as reverse proxy for apache
So I am running a site www.example.com. Initially, I was using apache and any hit to my site would be redirected to www.example.com/path.
Now this redirection is defined in my httpd.conf like:
...
1
vote
0
answers
561
views
Apache:How to config for php-cgi.exe
I have configured apache for using php-cgi as follows:
<Directory "c:/wamp64/cgi-bin">
AllowOverride All
Options +ExecCGI
AddHandler cgi-handler .php
Action cgi-handler /local-...
-1
votes
1
answer
1k
views
How does Apache spool STDOUT from a CGI script?
As part of a content management system I'm developing I have a script which retrieves image files (JPEG, GIF, PNG etc) in response to the browser GETing a URL like http://myserver/getimage.cgi/virtual/...
1
vote
1
answer
1k
views
Apache 2.4 separate error log file for CGI scripts?
I am using Apache 2.4 on my server and I want to be able to have a separate error log file for CGI scripts, similar to how I have a separate log file for PHP errors.
Currently, I am using the ...