• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Writing perl/cgi scripts

reicherb

Platinum Member
I am an extreme newbie.

I have perl installed on a FreeBSD 4.1 server and can't figure out how to get the scripts to run.

I am typing xxx.xxx.xxx.xxx/"location of the script".

What am I doing wrong?

Thank.
 
Are you using Apache as your webserver? If so put the cgi-script in your cgi-bin directory. Should be next to your html root directory.

Cgi scripts won't necessarily run anywhere. You either have to set up a specific directory ( cgi-bin is usually default ) and/or map a certain extension like .cgi as a script file.

Try this site Apache RTFM!
 
I put the file in "/usr/local/www/cgi-bin/reicherb"

so I type xxx.xxx.xxx.xxx/usr/local/www/cgi-bin/reicherb/wscript.pl

Is it ok to put it in a directory inside the cgi-bin directory?
 
More then likely you'll want the .cgi to be put in the cgi-bin directory. That way you access it by going to xx.xx.xx.xx/cgi-bin/mycgi.cgi
 
reicherb

sub dirs are fine as long as your apache config supports it (most do). Its a easy way to seperate scripts per project
 


<< I put the file in &quot;/usr/local/www/cgi-bin/reicherb&quot;

so I type xxx.xxx.xxx.xxx/usr/local/www/cgi-bin/reicherb/wscript.pl

Is it ok to put it in a directory inside the cgi-bin directory?
>>



That will probably end up as xxx.xxx.xxx.xxx/cgi-bin/reicherb/wscript.pl when loaded in httpd. The directory usr/local/www/html is the / folder of the website, and /cgi-bin is /usr/local/www/cgi-bin/ normally.
 
You'll also need to check permissions on the .cgi script, and you may have to set the web server up to allow cgi script execution.

Finally, make sure you have the Perl location in the head of the script so that the script engine knows what it's running. (#!/perl/ or something similar, depending on your system. You can find specific references for most Linux and Windows installations online)

Z.
 
No problem, it's my job to know. Now all you have to do to pay me back is buy hosting from me.

Okay just kidding.. 🙂
 
Back
Top