Questions tagged [cgi]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
149 views

apache2: "AH01630: client denied by server configuration: ..." for ScriptAlias

(Maybe similar to WSGI application, "AH01630: client denied by server configuration" but client receives page anyway) I'm running some CGI for years, and it works as intended, but the Apache ...
  • 904
0 votes
1 answer
143 views

Disable CGI script buffering for web browsers

I have a tiny CGI script written in Perl which prints numbers from 1 to 10 with 1 second interval: root@debian-s-1vcpu-1gb-fra1-01:~# cat /usr/lib/cgi-bin/test #!/usr/bin/perl use strict; local $|=1; ...
  • 6,718
1 vote
2 answers
175 views

CGI (Commong Gateway Interface) program wont run from HTML page, getting "Forbidden" permission

I'm trying to run this example CGI program that is from this Wikipedia page https://en.wikipedia.org/wiki/Common_Gateway_Interface The HTML code is as follows, the file is named "add.html" &...
0 votes
1 answer
167 views

CGI (Commong Gateway Interface) program example wont run from HTML page [duplicate]

I'm trying to run this example CGI program that is from this Wikipedia page https://en.wikipedia.org/wiki/Common_Gateway_Interface The HTML code is as follows, the file is named "add.html" &...
0 votes
2 answers
438 views

Apache2 won't run cgi files based on shebang

I'm trying to use Python as the server-scripting language instead of PHP. I've configured localhost and php files run fine under it. If I create a file .../localhost/temp/test.cgi (making it ...
  • 1,052
0 votes
1 answer
882 views

Curl command in bash CGI script not displaying the XML output [data not shown]

if I run this command in linux shell. curl=`curl --connect-timeout 4 -k -X POST -H "Content-type: text/xml" --data "<MyRequest><HeartBeat timestamp=\"1311157780201\"></HeartBeat><...
0 votes
1 answer
270 views

Why might a perl CGI script fail to connect to MySQL, when it works from console?

I'm migrating to new server hardware, which also means learning the idiosyncrasies of a new Linux distribution (Debian buster). I've got a Perl CGI script which when run from the console runs, but ...
0 votes
1 answer
175 views

Perl.cgi soap request HTTP ERROR 411

I'm trying to learn SoapUI, but when running the code below I'm getting HTTP ERROR 411 all files are in /var/www/html/ not sure what's the issue. #!/usr/bin/perl use SOAP::Transport::HTTP; SOAP::...
  • 11
0 votes
1 answer
1k views

Print the output of an interactive command in a shell script

I am writing a CGI script to monitor the system state, so the information must be outputted to the terminal with echo or cat. The problem is, systat is an interactive command, so it doesn't print ...
  • 369
1 vote
1 answer
195 views

How to get php-cgi with phpbrew (PHP5.3.x)

I installed php-5.6.40 php-7.1.14 with phpbrew and I've got php-cgi binaries on these both version. I used this command for get php-cgi 5.6.40 phpbrew install 5.6.40 +default+fpm+mysql+sqlite+mb+...
  • 1,340
1 vote
0 answers
631 views

How to execute a cgi pointed to by a symlink?

My website has several cgi's (executable binaries compiled from C source, in case that matters) that work fine when run from a browser as, e.g.,       http://mydomain.com/cgi-bin/...
2 votes
1 answer
344 views

Nginx version agnostic php-fpm configuration

When I create a new webapp conf in Nginx I use the following template: server { root /var/www/html/${domain}; server_name ${domain} www.${domain}; location ~* \.(jpg|jpeg|png|gif|ico|css|...
  • 1,510
0 votes
1 answer
355 views

Perl CGI, using system() to launch ssh and pass sanitized variables

I'm looking for a way to have perl launch a program with variables taken from the previous webpage. Here's my horrible perl code: #!/usr/bin/perl -w use CGI qw(:standard); use CGI::Carp qw(...
0 votes
1 answer
688 views

Scipts cgi and suexec

I have a httpd server SuexecUserGroup netmet netmet DocumentRoot /home/netmet/html ServerName ServerAdmin ErrorLog /var/log/httpd/netmet.error TransferLog ...
  • 303
1 vote
1 answer
444 views

Unable to run a .py file in cgi-bin by using ajax call from my .php file

Hi guys:) I am using a Beagle Bone Black with Debian Wheezy to make a project. I have a small problem:I have my index.php in /var/www from there I call a python file called send_email.php using ajax: ...
2 votes
0 answers
393 views

Stream audio from bash cgi script

I have a bash script which I would like to call as cgi to stream audio. The script looks like this: #!/bin/bash echo "Content-type: audio/wav" echo "" rtl_fm -f 89.9M -M fm -s 170k -A std -l 0 -E ...
  • 273
4 votes
1 answer
974 views

CGI with Shell Script

I'm having trouble running a CGI example with Shell Script, I'm not able to access the directory created in the example I'm following "/tmp/shell". By accessing the address "http://localhost/shell" ...
  • 765
2 votes
1 answer
989 views

How to Configure CGI in Ubuntu?

I recently installed Apache2 on Ubuntu and I am trying to configure CGI. I added the following lines in apache2.conf file: ScriptAlias /cgi-bin/ /home/router/cgi-bin/ <Directory /home/router/cgi-...
1 vote
2 answers
349 views

Apache CGI Workflow

I am trying to understand the workflow for CGI. So for example, say I use a unix shell script with CGI, what will be the sequence of steps executed to run this script when a client sends a request to ...
  • 1,293
0 votes
2 answers
425 views

Apache 2.4.10 page not displayed

I'm not a big expert in Apache and I facing with a particular problem. I have 2 server where in the first I run Debian 7.9 with Apache/2.2.22, in the other one I have Debian Apache/2.4.10. In both ...
  • 963
1 vote
1 answer
476 views

CGI error while trying to retrieve from sqlite3

I am trying to build a very simple login page, which asks the user for his register_no, username and password. And when he presses the submit button. I am trying to check whether it is an existing ...
0 votes
1 answer
111 views

Does Basic "hello world" run as CGI.?

My question is simple. I install apache on centos and create a file as index.html and just add the content of "hello world". Now, when I access my web it display the "hello world" quote. My question ...
1 vote
1 answer
637 views

Verbose output missing when executing a script as CGI

This is my shell script #!/bin/bash echo "Content-type: text/plain" echo "" sshpass -p $pass ssh -v -p $port -t -o StrictHostKeyChecking=no root@$ip "cd / && ls && exit" It can be ...
  • 11
3 votes
1 answer
21k views

Configuring Apache 2.4 to permit CGI on Debian Jessie

I’m new to Sysadmin and Apache configuration. Trying to get AWStats running, but in troubleshooting have gotten to trying to run a simple Hello World (html output) script on port 8888 and have been ...
  • 247
1 vote
1 answer
743 views

chroot cannot find cgi file

I am unable to serve or execute a cgi file, and the cause seems to be that chroot is unable to find the cgi file when the permission is set to executable. $>ls -l /var/www/my/dir/test.cgi -rwxr-xr-...
  • 339
0 votes
1 answer
320 views

How to pass parameters in a cgi-perl on Fedora 20?

I'm using Apache server on Fedora-20. I'm trying to run a perl-cgi program on my local server, but it's not working, I have attached my html and perl code. html program: <html> <head><...
0 votes
1 answer
518 views

lighttpd2 and php under fast-cgi returns 403 "Permission denied"

lighttpd2 is under development but it's faar enough to where i want to start using it. I've overcome the hurdle of installing it and getting vhost etc working. PHP 5.6.6 (cgi-fcgi) (built: Feb 20 ...
  • 3,440
0 votes
3 answers
3k views

Cannot run Perl code as CGI script

I am using Arch Linux with httpd web server and webpage works ok. I had to add "Reboot" button on webpage and now I want to run a Perl CGI script, reboot.cgi, which so far only contains "Hello world" ...
  • 1,086
0 votes
0 answers
468 views

How to grant sudo permission for a .py script on a apache folder?

I've exemplo.py in an folder /opt/lampp/htdocs/cgi-local/exemplo.py folder. The script creates a socket that needs super user permissions. My question was a little confusing? I need to access ...
  • 63
2 votes
0 answers
161 views

Execute CGI scripts on custom OMAP4 board as root

I have a Ubuntu 12.04 Custom Board running Apache2. I have a web page which calls a CGI script which is responsible for starting and stopping ipsec service. I access the web page from another machine ...
1 vote
1 answer
1k views

Shell script equivalent to PHP $_POST

For example and learning purposes, I have a webpage that uses POST method to submit a text field. I have a server running script (bash) that I want to display what the "Query_string" is. I'm not ...
  • 113
1 vote
1 answer
105 views

www server restart after upgrading bash regarding the shell shock bug?

If a webserver uses CGI with bash, does it calls bash every time when there is a request regarding CGI or does it caches (bash and related libraries) it when starting the webserver? Q: So is a ...
-4 votes
1 answer
230 views

Reboot shortcut

I need to haved a shortcut on my desktop to a URL which reboots my debian server and then says "reboot successfull" in the browser, if that was the case. I do not want a putty reboot shortcut or ...
  • 111
1 vote
1 answer
3k views

How to ensure a bash script is executable via web without being in /cgi-bin directory?

My document root is /0/ i do not have any cgi-bin directories. this is my virtual host with apache: Listen *:80 DirectoryIndex 1 <VirtualHost *:80> DocumentRoot /0 ServerName domain.tld ...
2 votes
0 answers
9k views

Apache install on Debian: configuring CGI [closed]

I installed CGI via the package manager and enabled the mod, but two hours later I still cant get it to work. My /etc/apache2/sites-available/default is: <VirtualHost *:80> ServerAdmin ...
0 votes
1 answer
751 views

Automatic login for mysql used in CGI script

I have written a CGI script using bash which executes a MySQL query. For MySQL authentication , automatic login is used by supplying the credentials in .my.cnf file as shown below . # the following ...
  • 2,796
2 votes
1 answer
1k views

redirection failing for CGI program

I'm trying to redirect the contents of command output to a file in a CGI program. The issue for me is that the output file is not getting created. The CGI Code snippet is as follows: #!/bin/bash ...
  • 2,796
3 votes
1 answer
22k views

500:Internal Server Error from CGI program

I am trying to write a CGI Program which is invoked from a HTML page . The CGI code snippet is as follows: #!/bin/bash echo "Content-type: text/html" echo "<html>" echo "<body>" ...
  • 2,796
3 votes
2 answers
5k views

Unable to launch the requested CGI program: /www/cgi-bin/first.cgi: Text file busy

I'm trying to make a very simple shell script to run as a CGI on a uhttpd server running on an OpenWRT install. The file is called /www/cgi-bin/first.cgi and looks like... #!/bin/sh echo "Content-...
  • 549
2 votes
1 answer
324 views

GoAccess won't redirect its output as a CGI script

I've been pulling my hair with this script: #!/bin/bash echo Content-type: text/html echo "" goaccess -f /var/www/log/access.log -a | tee Which runs perfectly on the command line (generates HTML ...
-1 votes
2 answers
15k views

how to run perl cgi script on apache [closed]

I Successfully installed Apache web server in my local machine. My question is how to run perl cgi script on this server Actully I don't have any Idea that's why posted question here. my sample cgi ...
  • 14.8k
2 votes
2 answers
5k views

Configuring Apache 2.4 for CGI on FreeBSD

I am trying to run CGI on FreeBSD 9.2. I installed Apache 2.4 (pkg install apache24) Configured it to load CGI module. Also, I did chmod a+x on files in cgi-bin directory. And when I connect to ...
  • 4,377
2 votes
1 answer
3k views

How to enable CGI in OpenBSD?

I installed an OpenBSD 5.3 in Virtualbox. Webserver is apache: httpd_flags="" in rc.conf. httpd.conf # cat /var/www/conf/httpd.conf ...
  • 5,324
2 votes
1 answer
1k views

How to give variable to a KSH script with a CGI?

index.sh is in the cgi-bin directory: #!/usr/bin/ksh echo 'Content-type: text/html <html><body> <form action=FOO.KSH method=POST> <input type=submit value=fgrep style=width:...
  • 5,324
1 vote
1 answer
614 views

Why wouldn't Perl CGI script run

I'm using Apache on CentOS and am trying to run a Perl CGI script as directory index so it will run automatically as a subdomain. I added DirectoryIndex script.cgi and added a Directory stanza noting ...
  • 11