Gossamer Forum
Home : Products : Others : Fileman :

I keep getting Internal Server Error

Quote Reply
I keep getting Internal Server Error
I installed fileman Single user version for a friend on their virtual server.
I set show_pass to 0
the url www.alandalus-school.edu/cgi-bin/fileman/fileman.cgi

the script is chmod 755

The paths are giving me trouble though:
The virtual server provider says that cgi scripts run in the virtual environment, so paths should look like /usr/local/etc/httpd/cgi-bin/fileman/fileman.cgi

but when I type pwd, iget:
/usr/home/andalus/usr/local/etc/httpd/cgi-bin/fileman/fileman.cgi

This ofcourse applies to all paths

The document root is ..as above../httpd/htdocs/

Here is the configs:
%config = (
root_dir => "/usr/home/andalus/usr/local/etc/httpd/htdocs",
logfile => "/usr/home/andalus/usr/local/etc/httpd/cgi-bin/fileman
/fileman.log",
password_dir => "/usr/home/andalus/usr/local/etc/httpd/cgi-bin/fileman
/pass",
root_url => "http://www.alandalus-school.edu",
script_url => "http://www.alandalus-school.edu/cgi-bin/fileman/filem
an.cgi",
icondir_url => 'http://www.alandalus-school.edu/images/icons',

use_flock => 1,
allowed_space => 150000,
max_upload => 75,
show_size => 1,
show_date => 1,
show_perm => 1,
show_icon => 1,
show_pass => 0,
);
I also tryed with the virtual paths

No luck at all. It just gives me Internal Server Error.

I tried to run the script from the command line, but it asks for "name=vale"
I just typed ^D
and it printed the html come OK!!!! (when using paths in config above)

It gave errors when using virtual paths (which is what the Vserver vendors say we must use)

Its all very confusing, and I don't understand what is going on!

Why is it working from command line but not browser with the paths wrongly addressed (ie actual rather han virtual)

Any aswers please

Quote Reply
Re: I keep getting Internal Server Error In reply to
sami,


The best way to debug a script that is failing is to run it in a console. You can do this by executing the script via 'perl <scriptname>'

Also. You need to make sure that the script is executable under unix. To do this all you need to do is run 'chmod 755 <scriptname>' assuming that your header is correct in the script. '#!/usr/local/perl'



------------------
Ryan Brown
fpsn.net, Inc.
rbrown@fpsn.net
Quote Reply
Re: I keep getting Internal Server Error In reply to
Hi,

I have already done that!

The script is 755 already

The web server is Apache.

The header is correct path of my perl5 interpretor, and I tried to debug by running
>perl5 fileman.cgi

Here it asks me to enter some input! "something about name=vale"

I did not get any Errors, but from the browser it still says Internal Server Error

Sami
Quote Reply
Re: I keep getting Internal Server Error In reply to
How are you uploading your files? You must transfer in ASCII format or you can get some formating problems. This may be something you already know, if so sorry. But it is a very common problem with 500 errors.
Quote Reply
Re: I keep getting Internal Server Error In reply to
sami,


wierd. well it sounds to me that your script isn't posting the print "Content-type html/text\n\n\n"; value correctly. thats the only time i've ever gotten that with everything else working.

------------------
Ryan Brown
fpsn.net, Inc.
rbrown@fpsn.net
Quote Reply
Re: I keep getting Internal Server Error In reply to
Hello Sami:

I think there are a couple of possible problems.
1) The path to perl might be incorrect
(I know you said that you got the path correct) try this: ./fileman.cgi This will check whether the path is correct for sure
2) the perl version you are using is not perl5
to check this if your path to perl is #!/usr/bin/perl then type in /usr/bin/perl -v on the command line and check to make sure that the version number is correct should be 5 or later
3) the other thing I can think of is that like Ryan said: print "Content-type: text/html\n\n"; is not being printed out.
4) I do not think that there is a problem with uploading in ASCII or binary since you said that you ran perl on the cgi file
5) the other thing I can think of is that when you type in perl <filename> the perl you are using is Perl5 and not the one you specified in your perl path. Basically if your path to perl is /usr/bin/perl then try running the program using /usr/bin/perl <filename> and not perl <filename> because they might be referring to different versions of Perl

Please give this a try and if you are still encountering problems then post another message
Quote Reply
Re: I keep getting Internal Server Error In reply to
sami:

You may not have all perl modules installed on you virtual server (vserver.com) I had similar problems with that host until I reinstalled perl.

telnet: vinstall perl5

good luck
Quote Reply
Re: I keep getting Internal Server Error In reply to
I tried several times changing Perl and CGI.pm version but fileman.cgi still won't work!!!:(

Now my system is:
Operating System Linux RedHAt 6.0;
WEB Server APACHE 1.3.6;
PERL 5.6.0;
CGI.pm 3.1;
ALL File permissions are OK;
ALL Paths are correct;
Fileman.cgi points to correct Perl path;
The line above the line saying use CGI qw(:cgi); points to correct CGI.pm lib path (use lib 'path/to/CGI.pm';) as Luciano suggested in "CGI.pm Work-around (if your provider won't install it)" post;
Others CGI scripts (i.e. dbman/db.cgi), works all correctly!

All seems configurated great, but fileman.cgi does't work!

Now...excecuting the script fileman.cgi by the prompt fileman>/urs/local/bin/perl fileman.cgi
the script seems work good and it returns the correct html code.

When I call the fileman.cgi script via the browser (Netscape 1.47) instead it returns an error 500 Internal Server Error:(

I suppose have a problem on the Apache configuration...Any suggest?
Is it a Javascript configuration problem on the server?
Please answer me as soon as possible: i'm getting mad!:)



Quote Reply
Re: I keep getting Internal Server Error In reply to
I've solved!!!
For some reasons ( I still don't understand what...)the file fileman.cgi MUST be modified by Notepad supply with Linux; once you've modified all you need (all path,perl path, etc..), you have to reopen it with vi editor and you'll see a lot of ^M at the end of each line of the code. Now cut this sign after the #!usr/bin/perl line and all will work correctly.
Good Luck
Stefano

Any other idea ?