Running Shell Script from html webpage

Keith Fernie me at
Tue Nov 8 14:13:03 UTC 2011

I'am doing this with Debian Squeeze & fcgiwrap installed. I've seen  
fcgiwrap present in Ubuntu.

Example script (Must be executable)

# -*- coding: utf-8 -*-
echo "Content-type:text/html\r\n"
echo "<html><head>"
echo "<title>$NAME</title>"
echo '<meta name="description" content="'$NAME'">'
echo '<meta name="keywords" content="'$NAME'">'
echo '<meta http-equiv="Content-type" content="text/html;charset=UTF-8">'
echo '<meta name="ROBOTS" content="noindex">'
echo "</head><body><pre>"
echo "\nuname -a"
uname -a
echo "\ncpuinfo"
cat /proc/cpuinfo
echo "</pre></body></html>"

Run it here

Also using this as an include file, not restricted to only shell scripts.

location ~ (\.cgi|\.py|\.sh|\.pl|\.lua)$ {
gzip off;
root /var/www/$server_name;
autoindex on;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
include /etc/nginx/fastcgi_params;
fastcgi_param DOCUMENT_ROOT /var/www/$server_name;
fastcgi_param SCRIPT_FILENAME /var/www/$server_name$fastcgi_script_name;

On Tue, 08 Nov 2011 10:01:07 -0000, etrader <nginx-forum at> wrote:

> I have a Nginx installed on Linux (Ubuntu or Centos) without any
> scripting language such as PHP or Python (connected to the webserver).
> Can I run Shell commands from a webpage (e.g. html)?
> I mean is it possible to use nginx without script languages by shell
> scripts?
> Posted at Nginx Forum: 
> _______________________________________________
> nginx mailing list
> nginx at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list