| UNIX/Linux Forum Archives · Rules and Guidelines · Disclaimer |
Help
Search
Members
Calendar
|
| Welcome Guest ( Log In | Register ) | Resend Validation Email |
![]() ![]() ![]() |
| brian |
Posted: Nov 19 2004, 01:15 AM
|
|
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 |
| fishsponge |
Posted: Nov 20 2004, 01:25 PM
|
|
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 |
| brian |
Posted: Nov 21 2004, 01:46 AM
|
|
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 |
| azmathshaikh |
Posted: Nov 24 2004, 12:17 PM
|
|
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 |
| fishsponge |
Posted: Dec 1 2004, 10:27 AM
|
||
|
Administrator ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Admin Posts: 679 Member No.: 1 Joined: 13-February 03 |
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". |
||
| larryh |
Posted: Feb 1 2005, 05:59 AM
|
|
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. |
![]() |
![]() ![]() ![]() |