LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-18-2005, 07:59 AM   #1
shizzle
LQ Newbie
 
Registered: May 2005
Posts: 6

Rep: Reputation: 0
trying to add cgi-bin perl script.


Sorry for the newb question, but I'm trying to add a counter to my site. the file is counter.pl and its in my /public_html/counter directory.

This is what I've done in my httpd.conf so far

#
# AddHandler allows you to map certain file extensions to "handlers":
# actions unrelated to filetype. These can be either built into the server
# or added with the Action directive (see below)
#
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#
AddHandler cgi-script .cgi .pl



<Directory "/">
Options FollowSymLinks +ExecCGI

AllowOverride None



</Directory>

is there anything else that i need to do? when i visit my homepage it just comes up a empty.gif picture and the script isnt working. TIA
 
Old 05-18-2005, 08:15 AM   #2
ivanatora
Member
 
Registered: Sep 2003
Location: Bulgaria
Distribution: Ubuntu 9.10, FreeBSD 7.2
Posts: 459

Rep: Reputation: 31
How do you call that counter.pl from your html source?
 
Old 05-18-2005, 08:24 AM   #3
shizzle
LQ Newbie
 
Registered: May 2005
Posts: 6

Original Poster
Rep: Reputation: 0
adding counter cgi-bin perl script

I just used a reguler HTML link. This is what the www page that i got the script from said to do.

<img src="http://www.mysite.com/~user/counter/counter.pl">

is this wrong?
 
Old 05-18-2005, 09:13 AM   #4
shizzle
LQ Newbie
 
Registered: May 2005
Posts: 6

Original Poster
Rep: Reputation: 0
perl script woes

ok i know this is wrong.. because other scripts directions say to call the script in HTML like.. <!--#exec cgi="/cgi-bin/textcounter.pl"-->
but i have tried adding the script to my /var/www/cgi-gin but it wont display...

so im still not sure whats wrong.. any suggestions would be appreciated. TIA
 
Old 05-18-2005, 10:34 AM   #5
shizzle
LQ Newbie
 
Registered: May 2005
Posts: 6

Original Poster
Rep: Reputation: 0
perl script

i changed a few lines in the index.shtml so now the call to the perl script reads:

<script language="Perl">
<!--#exec cgi="scripts/cstat/cstat.pl"-->
</script>

still doesnt work.. any ideas?
 
Old 05-18-2005, 12:40 PM   #6
ivanatora
Member
 
Registered: Sep 2003
Location: Bulgaria
Distribution: Ubuntu 9.10, FreeBSD 7.2
Posts: 459

Rep: Reputation: 31
Try to run it from the command line and see if it works there.
[edit]
By the way what do you mean with 'works'? It's just a counter script, it isn't supposed to do any output. If it writes count to a file see if the Apache user ('nobody' maybe) has write access there.

Last edited by ivanatora; 05-18-2005 at 12:45 PM.
 
Old 05-18-2005, 06:58 PM   #7
shizzle
LQ Newbie
 
Registered: May 2005
Posts: 6

Original Poster
Rep: Reputation: 0
perl -c cstat.pl
cstat.pl syntax OK


so it seems to work from the command. OK I was wrong, i thought this would but a .gif couter on my website.
i read the readme and it says that the stats go to a stats.html file.. where is this file located.

running FC1

TIA
 
Old 05-19-2005, 02:24 AM   #8
ivanatora
Member
 
Registered: Sep 2003
Location: Bulgaria
Distribution: Ubuntu 9.10, FreeBSD 7.2
Posts: 459

Rep: Reputation: 31
Quote:
where is this file located
How could we know Try searching deaper in the README :P
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cgi-bin script: turn off computer hamish Linux - General 2 10-21-2005 10:46 AM
Running perl scripts outside of cgi-bin ylikone Programming 1 09-08-2005 05:34 AM
.CGI scripts enabled with #!/usr/bin/perl -i?? computerdaves Fedora 8 02-18-2005 05:03 PM
cgi-bin error regarding perl script hamish Linux - Software 11 12-09-2004 11:16 AM
REMOTE_HOST in a CGI-bin script trouble gary knott Linux - Networking 4 11-12-2003 06:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration