Powered by Invision Power Board


  Reply to this topicStart new topicStart Poll

> CGI-Scripts Will Not Run, Running root web with no virtual servers
brian
Posted: Nov 19 2004, 01:15 AM
Quote Post


Newbie
*

Group: Members
Posts: 6
Member No.: 647
Joined: 16-November 04



Now onto the next problem though! Namely:

Now that the scripts are in the cgi-bin they don't execute. I have them set at 755 and they check clean for syntax with perl -c at the command line. In fact, I use the same scripts on my existing commercial web site,

The one I am using as a test is merely a quick script designed to draw an HTML page and list all of the environment variables. But when I try to run this or a few other similar simple scripts I get a 500 internal service error.

I am running the FP site from the root web and I am not running any virtual servers. I only have myself and no people I am providing web service to.

Is this happening because this FP installation thinks it is owned by root and therefore will not let me execute scripts because I am not logging on as root through the FTP client?

I've read a little about changing group and user ownership permissions with chown and so forth but I'm a little unclear on how that works.

I've also read somewhere that FP maintains a separate table of users and authorities separate from that of the UNIX system tables, so I'm wondering if I'm even getting near the source of the problem!

Appreciate any insight anyone might have! Weekend is coming up and would like to get back on the subject and see if I can move this blasted thing forward!

Brian

PMEmail Poster
Top
fishsponge
Posted: Nov 20 2004, 01:25 PM
Quote Post


Administrator
********

Group: Admin
Posts: 679
Member No.: 1
Joined: 13-February 03



i think you meant "500 internal server error" which basically means your scripts are running fine. The error is generated because of a bug in your script. Check your "#!/bin/perl" line to see if it's pointing in the right place for your system, and then check your source code.

you can also check your logs for what went wrong. The are probably in one of the following locations, or something similar:

/var/log/httpd/error.log
/var/log/apache.log
PMEmail PosterUsers WebsiteICQAOLYahooMSN
Top
brian
Posted: Nov 21 2004, 01:46 AM
Quote Post


Newbie
*

Group: Members
Posts: 6
Member No.: 647
Joined: 16-November 04



It turns out that for some reason the CGI files which I FTP'ed out of my existing host onto the local PC and then uploaded to my local apache server went up with some end of file characters that were causing the apache server to have trouble recognizing the script and the result was an Internal Server Error #500.

I opened the scripts with NoteTab on my local PC and then saved them back using the UNIX text option and then FTPd them again to the apache server. Then the scripts work fine. Apparrently Windows text uses both a CR and LF at the end of each line while UNIX is looking for a LF only.

Seems like a pain in the neck...wherever I have used them before I have never had this happen before.

So I'm still doing a little more research to see if I can find out how to get this to work after merely uploading the scripts in ASCII format. This is all it has ever taken before.

If anyone has run across this one would appreciate the thoughts....

Brian
PMEmail Poster
Top
azmathshaikh
Posted: Nov 24 2004, 12:17 PM
Quote Post


Newbie
*

Group: Members
Posts: 4
Member No.: 666
Joined: 24-November 04



hi,

I am running SunOne Webserver on Solaris 9. Well I wrote a CGI script which takes some parameters from the user on the web and execute an application on the server with the parameters. At first, the script didnt execute due to library path variables. Then I set the variables manually in server.xml. Still the script dont execute. It doesnt give any errors too. when I try to run from the console with a user who is running SunOne Webserver, it runs properly. I feel the problem is with the Environment variables. Can anyone tell me how to set Application Specific Env Variables in SunOne Webserver???

Thanks in advance
azmath
PMEmail Poster
Top
fishsponge
Posted: Dec 1 2004, 10:27 AM
Quote Post


Administrator
********

Group: Admin
Posts: 679
Member No.: 1
Joined: 13-February 03



QUOTE (brian @ Nov 21 2004, 02:46 AM)
I opened the scripts with NoteTab on my local PC and then saved them back using the UNIX text option and then FTPd them again to the apache server. Then the scripts work fine. Apparrently Windows text uses both a CR and LF at the end of each line while UNIX is looking for a LF only.

Seems like a pain in the neck...wherever I have used them before I have never had this happen before.

this is normal, and has always been the case. I don't know why this wrecks CGI scripts some times and not others, but it's always something you should be aware of.

If you save a text file in Windows, and then open it up in Linux, you will probably see loads of ^M characters. These are the extra CR chars.

There is a "dos2unix" command for swapping these files over, to save re-uploading them. Do "man dos2unix".
PMEmail PosterUsers WebsiteICQAOLYahooMSN
Top
larryh
Posted: Feb 1 2005, 05:59 AM
Quote Post


Newbie
*

Group: Members
Posts: 1
Member No.: 787
Joined: 1-February 05



QUOTE (brian @ Nov 21 2004, 02:46 AM)
I opened the scripts with NoteTab on my local PC and then saved them back using the UNIX text option and then FTPd them again to the apache server. Then the scripts work fine. Apparrently Windows text uses both a CR and LF at the end of each line while UNIX is looking for a LF only.


NoteTab has the ability to convert text files from the Windows line endings to the Unix line endings and vice versa.

I believe many other Windows based text editors can do the same.

Most FTP programs can do this conversion as it sends the files to the server. I like FileZilla on Windows.
PMEmail Poster
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
« Next Oldest | Web Servers & FTP Servers | Next Newest »

Topic Options Reply to this topicStart new topicStart Poll

 



[ Script Execution time: 0.0728 ]   [ 12 queries used ]   [ GZIP Enabled ]




Partners: Cambridge Plus :: <Link Available> :: PIC Boot-loader Utility :: <Link Available>
Unix Man Pages / Linux Man Pages :: HiFi Forum :: SIP VoIP Phone & Provider Reviews :: UNIX/Linux Forum Archives

More info on advertising on Unix/Linux Forum