Miscellaneous > Programming & Networking

perl training wheels

(1/8) > >>

Calum:
i wrote the following into a file:
--- Code: ---
--- End code ---
as per a tutorial page i found online, now i have got perl installed on my computer in /usr/bin/perl and when i visit the file with mozilla, it displays it as text rather than getting perl to execute it and then display the html.

Why is this? is it because i am visiting it on the same machine? is there some config i have not set? is the perl i have installed somehow different from the perl i need to do this?

sorry, i know it is very newbish to ask, but what's going on (or not)?

voidmain:
What did you name the file? Usually Apache is configured to treat *.cgi files as executable programs such as Perl programs. Also Apache needs to be configured to recognize *.cgi files as executable programs which it usually doesn't come configured to do so by default. You also need to put "ExecCGI" in your Options in the Apache configuration file for the directory that you want to be able to execute CGI programs.  Also, the file needs to be set "executable" for the user that your Apache server runs under (usually user "apache" or "nobody" but as long as you do a "chmod a+rx file.cgi" that would cover it).

Do you need help with the Apache configuration? I gave m0r the same informtation in another thread...

Calum:
wow!   :confused:  yes i think i do, where's the thread? thanks, i never realised how much there was out there that i didn't know!

now as i say, there's no reason i shouldn't be able to test my file out on the same machine as it is hosted on is there?

voidmain:
Not at all. Just put it under your web root (as long as you have Apache configured with ExecCGI and the other configs I mentioned) and point your browser to http://localhost/file.cgi.

There actually should be an area that *is* configured by default to run CGI files and that would be under /var/www/cgi-bin on the local directory which would be http://localhost/cgi-bin/file.cgi in the browser.  I'll see if I can dig up the thread on configuring Apache to run CGI files in any directory under your web root.

Yes, here it is:
http://forum.fuckmicrosoft.com/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=5&t=000766

[ September 22, 2002: Message edited by: void main ]

Calum:
thank you very much, good to know you are around with this info when i need it!  :D

Navigation

[0] Message Index

[#] Next page

Go to full version