linux - my first simple cgi bash file -


i use internet browser display images/graphs created gnuplot. each picture have plot.gp file contains gnuplot commands. final goal open editor file plot.gp when click on picture.

the way found achieve use cgi run bash scripts. i'm not able make "hello word" code work... here did :

  • i installed on linux packaged cgi-mapserver
  • i saved in file hello.bash in /usr/lib/cgi-bin/ , gave correct permission (chmod 755 /usr/lib/cgi-bin/hello.bash).

but when firefox /usr/lib/cgi-bin/hello.bash browser display whole file instead of "hello world!"

my file /usr/lib/cgi-bin/hello.bash :

#!/bin/bash  echo "content-type: text/html" echo "" echo "<html><head><title>welcome</title></head>" echo "<body>" echo "hello world" echo "</body></html>"  

i'm sure forget basic... can't figure :-(

you should use browser's file associations use editor downloaded .gp files. web server, not browser, uses cgi-scripts.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -