LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-28-2002, 11:29 AM   #1
Mithrilhall
Member
 
Registered: Feb 2002
Location: Massachusetts
Distribution: Debian (Lenny)
Posts: 286

Rep: Reputation: 30
Question Perl/CGI question


I downloaded a free message board the other day and installed it just like the readme file said. I put the messageboard .pl file in my cgi-bin directory and configured all the files. For some reason it isn't working and I can't figure out why. I thought that I might not have Perl/cgi working but I don't know how to test it.

Also, if it was working how would I access the messageboard I installed? Lets say my site url is http://yoursite.dns.net

I tried:

http://yoursite.dns.net/messageboard.html
http://yoursite.dns.net/cgi-bin/messageboard.html

but neither come up with anything.
 
Old 03-28-2002, 12:42 PM   #2
vector
Member
 
Registered: Jan 2002
Location: Corvallis
Distribution: Slackware 10.0
Posts: 48

Rep: Reputation: 15
if you want to check that your PERL is working, try this:

perl -v -or-
perl -V

if you have perl something will come up and give you general information. you can also try this:

create a file "file.pl" and make just a simple script:

Code:
#!/usr/bin/perl
Code:
print "PERL Test";
then run it:

Code:
perl file.pl
the outcome should look like this:
PERL Test
if it works, then you know perl works, and there might be something wrong with your code you downloaded/configured.

good luck, keep us informed if you need more help or figured it out.
 
Old 03-28-2002, 12:44 PM   #3
vector
Member
 
Registered: Jan 2002
Location: Corvallis
Distribution: Slackware 10.0
Posts: 48

Rep: Reputation: 15
woop . . . well i guess i screwed up the coding of that post, oh well, you will get the picture hopefully. sorry bout that!
 
Old 03-28-2002, 01:40 PM   #4
Mithrilhall
Member
 
Registered: Feb 2002
Location: Massachusetts
Distribution: Debian (Lenny)
Posts: 286

Original Poster
Rep: Reputation: 30
Re:

[root@Mithrilhall cgi-bin]# perl -v

This is perl, v5.6.1 built for i386-linux

Copyright 1987-2001, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'. If you have access to the
Internet, point your browser at http://www.perl.com/, the Perl Home Page.


Also, I created a cgi file and placed it in my cgi-bin directory and I ran the command:

perl test.cgi and go the correct output:

[root@Mithrilhall cgi-bin]# perl test.cgi
Content-type: text/html

<HTML><HEAD><TITLE>CGI Test</TITLE></HEAD><BODY><H2>I just wrote a web page using Perl!</H2></BODY></HTML>[root@Mithrilhall cgi-bin]#


For some reason when I try it from my website, such as:

http://mithrilhall.redirectme.net/cgi-bin/test.cgi

it doesn't work.
 
Old 03-28-2002, 01:43 PM   #5
nixadm
LQ Newbie
 
Registered: Mar 2002
Location: florida, usa
Distribution: RH mostly
Posts: 16

Rep: Reputation: 0
What does it do then

Your saying "It doesn't work", well what does it do?

any error messages, did you chmod it? are you getting a 404, 500? etc.

I think apache has a path to cgi bin, etc did you check those settings
 
Old 03-28-2002, 01:47 PM   #6
Mithrilhall
Member
 
Registered: Feb 2002
Location: Massachusetts
Distribution: Debian (Lenny)
Posts: 286

Original Poster
Rep: Reputation: 30
Here's the error, sorry about not posting it (I'll check my httpd.conf file):

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.



--------------------------------------------------------------------------------

Apache-AdvancedExtranetServer/1.3.22 Server at Mithrilhall.LinuxServer Port 80
 
Old 03-28-2002, 01:50 PM   #7
nixadm
LQ Newbie
 
Registered: Mar 2002
Location: florida, usa
Distribution: RH mostly
Posts: 16

Rep: Reputation: 0
Whats the error log say..

the file might need to be chmod'd... whats the permissions on it.

also, the script readme file should walk thru setting it up...
 
Old 03-28-2002, 01:54 PM   #8
Mithrilhall
Member
 
Registered: Feb 2002
Location: Massachusetts
Distribution: Debian (Lenny)
Posts: 286

Original Poster
Rep: Reputation: 30
Here are the permissions on the file:

-rwxr-xr-x 1 root root 216 Mar 28 14:34 test.cgi*


There is really no readme other than a website I was reading from. I was a tutorial for newbies in perl/cgi. I put the file in my /var/www/cgi-bin/ directory like it said but it just doesn't work. Is there something I need to change in the httpd.conf file?
 
Old 03-28-2002, 02:01 PM   #9
nixadm
LQ Newbie
 
Registered: Mar 2002
Location: florida, usa
Distribution: RH mostly
Posts: 16

Rep: Reputation: 0
I think by default it should work in /cgi-bin

what msg board is it..

try chmoding 755, or 777 temporarily.
 
Old 03-28-2002, 02:06 PM   #10
Mithrilhall
Member
 
Registered: Feb 2002
Location: Massachusetts
Distribution: Debian (Lenny)
Posts: 286

Original Poster
Rep: Reputation: 30
I chmoded to 755 and 777 and it still didn't run. The messageboard I downloaded is wwwboard.
 
Old 03-28-2002, 02:10 PM   #11
nixadm
LQ Newbie
 
Registered: Mar 2002
Location: florida, usa
Distribution: RH mostly
Posts: 16

Rep: Reputation: 0
did you set the variables?

did you change it to cgi without changing the variables..

did you create the messages directory and chmod it 777

http://worldwidemart.com/scripts/readme/wwwboard.shtml
 
Old 03-28-2002, 02:11 PM   #12
nixadm
LQ Newbie
 
Registered: Mar 2002
Location: florida, usa
Distribution: RH mostly
Posts: 16

Rep: Reputation: 0
where is your wwwboard.html at..


i tried
http://mithrilhall.redirectme.net/wwwboard.html

http://mithrilhall.redirectme.net/wwwboard/

etc
 
Old 03-28-2002, 02:14 PM   #13
nixadm
LQ Newbie
 
Registered: Mar 2002
Location: florida, usa
Distribution: RH mostly
Posts: 16

Rep: Reputation: 0
it looks like some files still need to be uploaded n chmoded..

ALPHA-2
Special information about the 2.1 ALPHA 2 release.
README
Includes installation instructions and a detailed description of how to set it up to work on your server.
ADMIN_README
The README file for WWWAdmin.
wwwboard.pl
The main WWWBoard perl script which runs everything.
wwwadmin.pl
The admin perl script which helps you maintain WWWBoard.
wwwboard.html
The html file with the post form and entry spots. All message links will be posted here.
faq.html
A Frequently Asked Questions HTML file which you can post for your users.
data.txt
The data file which keeps an incremented log of numbers for messages.
passwd.txt
A password file for WWWAdmin.
messages/
The directory where messages posted will be stored.



if the script calls these files and their not there, or the permissions deny the script from opening/writing to them its gonna error out.
 
Old 03-28-2002, 02:15 PM   #14
Mithrilhall
Member
 
Registered: Feb 2002
Location: Massachusetts
Distribution: Debian (Lenny)
Posts: 286

Original Poster
Rep: Reputation: 30
http://mithrilhall.redirectme.net

I didn't put the wwwboard directory in the /var/www/html/ directory since the the wwwboard.pl file points to were ever you want to put the wwwboard directory.
 
Old 03-28-2002, 02:17 PM   #15
Mithrilhall
Member
 
Registered: Feb 2002
Location: Massachusetts
Distribution: Debian (Lenny)
Posts: 286

Original Poster
Rep: Reputation: 30
At this point I would be happy getting my little test script to run.
This is the test script I ran in shell and it worked but from my browser I can't seem to get it to work:

#!/usr/bin/perl

print "Content-type: text/html\n\n";
print "<HTML><HEAD>";
print "<TITLE>CGI Test</TITLE>";
print "</HEAD>";
print "<BODY><H2>I just wrote a web page using Perl!</H2>";
print "</BODY></HTML>";
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl CGI:Can't locate CGI.pm supermyself Programming 13 09-10-2007 06:22 AM
perl cgi neil Programming 3 07-07-2004 04:52 AM
cgi perl : I cant get perl to append my html file... the_y_man Programming 3 03-22-2004 05:07 AM
Perl/CGI question jacksmash Linux - Software 3 11-06-2003 02:23 PM
cgi+perl barbanero General 0 04-07-2002 12:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:10 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