I'm running Ubuntu 11 and I must setup an easy webserver that responds for an http request by calling a nearby script using the GET or Publish parameters. This script (already written) does some stuff and produces personal files. This file ought to be provided in a URL, and also the webserver should make an http request to a different server telling it to download the produced file.

Wouldso would Time passes about setting this up? I am not really a total beginner with linux, however i wouldn't say Yes, it well either.

What webserver must i use? How do you give permission for that script to gain access to local assets to produce the file under consideration? I am much less worried about security or anything, to an individual experiment (I've treatments for all of the computer systems involved). I have used apache before, but I have never arrange it.

Any help could be appreciated..

This tutorial looks good, but it is a little brief.

I've apache installed. If you do not: sudo apt-get install apache2.

cd /usr/lib/cgi-bin

# Make a file and let everyone execute it
sudo touch test.sh && chmod a+x test.sh 

Then place the some code within the file. For instance:

#!/bin/bash
# get today's date
OUTPUT="$(date)"
# You must add following two lines before
# outputting data to the web browser from shell
# script
 echo "Content-type: text/html"
 echo ""
 echo "<html><head><title>Demo</title></head><body>"
 echo "Today is $OUTPUT <br>"
 echo "Current directory is $(pwd) <br>"
 echo "Shell Script name is $0"
 echo "</body></html>"

And lastly open your browser and kind http://localhost/cgi-bin/test.sh

If all goes well (because it did for me personally) you need to see...

Today is Sun 12 , 4 ...
Current directory is /usr/lib/cgi-bin Spend
Spend Script title is /usr/lib/cgi-bin/test.sh