Unfortunately, we don't allow just anyone to install their own CGI programs or scripts. So this presents a little bit of a problem for people who want to learn how to write or test CGI programs.
Until we decide on what tack to take:
/usr/local/www/support/tinyhttpd.pl
and is only slightly different from
tinyhttpd.pl by Olaf Titz.
~/public_html
and
~/public_html/cgi-bin
directory.
mkdir ~/public_html mkdir ~/public_html/cgi-bin chmod 711 ~/public_html ~/public_html/cgi-bin
The ~/public_html
directory contains your standard
HTML files and is also accessible via
http://www.csi.uottawa.ca/~username
(substitute your username
for username
).
The ~public_html/cgi-bin
directory contains your CGI files
(programs and scripts) and (currently) will only be accessible via
your personal mini server.
You'll only need to do the chmod
line if you
also want your files
accessible by the departmental WWW server.
rsh -n grda /usr/local/www/support/tinyhttpd.pl 1234That's all there is to it! When you've finished testing,
The mini server appends accesses to the file httpd.log
in your home directory. You might want to clear out this file from
time to time.
Permission denied.The most likely cause for this error is that you don't have an entry in
~/.rhosts
Correct this by typing this:
echo `hostname` $user >> ~/.rhosts
bind: Address already in use at /usr/local/www/support/tinyhttpd.pl line 54.The most likely cause for this error is that another process is already using port 1234. Select another port and try again.
bind: Permission denied at /usr/local/www/support/tinyhttpd.pl line 54.You are most likely trying to use a port number less than 1024. Use a port number greater than 1024.
gateway.html
file in your ~/public_html
directory that contains the correct link for your mini server.
Probably, somewhere in your ~/public_html/index.html
file you'd
have a link something like this:
Access to <a href=gateway.html>my local server</a>.
#!/bin/sh # case $# in 2) host=$1; port=$2;; *) echo "format $0 <host> <port>"; exit 1;; esac errors=0 HOSTNAME=`hostname | cut -d. -f1` while [ $errors -lt 10 ]; do cat - <<EOF > $HOME/public_html/gateway.html <html><head><title>Mini server gateway</title></head> <body>click <a href=http://$host:$port/>here</a></body> for your <b>gatewayed</b> files. EOF chmod 644 $HOME/public_html/gateway.html echo "trying port $port on $host" case "`rsh -n $host /usr/local/www/support/tinyhttpd.pl $port 2>&1`" in [Pp]"ermission denied"*) echo not in $HOME/.rhosts mv $HOME/.rhosts $HOME/.rhosts.orig sed -e "/^$HOSTNAME\>/d" $HOME/.rhosts.orig > $HOME/.rhosts echo $HOSTNAME $LOGNAME >> $HOME/.rhosts echo $HOSTNAME.csi.uottawa.ca $LOGNAME >> $HOME/.rhosts echo $HOSTNAME.site.uottawa.ca $LOGNAME >> $HOME/.rhosts sync errors=`expr $errors + 1` ;; "bind: Permission denied"*) echo "invalid port $port" port=1234 errors=`expr $errors + 1` ;; "bind: Address already in use"*) echo "port $port already used" port=`expr $port + 1` errors=`expr $errors + 1` ;; *) echo "we're done $?" exit 0 ;; esac done echo "too many errors, exiting" exit 0
<a href=/cgi-bin/url>mycgi</a>
Then, perhaps, your only alternative is to run a real server. Here's how...
Last update 1999/06/18