LinuxSA Mailing list archives
Index:
[thread]
[date]
[subject]
[author]
From: BlackAdder <daved@uq.net.au>
To : linuxsa@linuxsa.org.au
Date: Sun, 23 Apr 2000 10:38:07 +0930
cgi prob.
Hi guys,
Well I've puddled around with this problem for some hours now and I'm at my
wits end.
I'm probably just being a twonk or something, but here's the problem:
I have a cgi script on my webserver that checks the access-log for httpd and
reformats it a bit before displaying the results as an html file.
The problem is, although the script "loads" the webpage, it doesn't run the
script to build the webpage. Thus, I want to know is, why isn't it working?
What stupid thing have I done/overlooked?
(see scripts included below)
Thanks,
Dave.
[http_access.cgi]--------------------------------------------------
#!/bin/sh
rm -f /home/httpd/html/checkaccess.html
/bin/sh build_access
echo Location: http://eric.viking.org.au/checkaccess.html
echo
-------------------------------------------------------------------
[build_access]-----------------------------------------------------
#!/bin/sh
rm -f /home/httpd/html/checkaccess.html
touch /home/httpd/html/checkaccess.html
echo '<HTML><HEAD><META http-equiv="Pragma"
content="no-cache"></HEAD><BODY>' > /home/httpd/html/checkaccess.html
echo '<H1>Machine access to eric.viking.org.au</H1>' >>
/home/httpd/html/checkaccess.html
echo '<p>' >> /home/httpd/html/checkaccess.html
date >> /home/httpd/html/checkaccess.html
echo '<p>' >> /home/httpd/html/checkaccess.html
/bin/sh ./ha.sh
cat /tmp/ha.txt | awk -f ha.awk >> /home/httpd/html/checkaccess.html
-------------------------------------------------------------------
[ha.sh]------------------------------------------------------------
#!/bin/sh
cat /var/log/httpd/access_log | cut -d " " -f 1 | sort | uniq \
> /tmp/ha.txt
cat /tmp/ha.txt | nslookup > /tmp/hanames.txt
-------------------------------------------------------------------
[ha.awk]-----------------------------------------------------------
{ printf("%s <br>\n", $1) }
-------------------------------------------------------------------
--
LinuxSA WWW: http://www.linuxsa.org.au/ IRC: #linuxsa on irc.linux.org.au
To unsubscribe from the LinuxSA list:
mail linuxsa-request@linuxsa.org.au with "unsubscribe" as the subject
Index:
[thread]
[date]
[subject]
[author]
Return to the LinuxSA Mailing List Information Page