LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-04-2003, 12:24 PM   #1
RobbieRoy
LQ Newbie
 
Registered: Sep 2003
Posts: 1

Rep: Reputation: 0
Apache 2.0.43 will not run cgi scripts


I installed Mod_Perl 2.0 on Apache 2.0.43 without any problems.

I added the following lines to httpd.conf file to tell Apache to use the
Perl module I just installed:

LoadModule perl_module modules/mod_perl.so
PerlModule Apache2

The /usr/local/apache2/2.0.43/cgi-bin folder and files have 755 permissions. However Apache will not run my cgi scripts that are stored in usr/local/apache2/2.0.43/cgi-bin/ and I get an internal server error.
My error log says the following
[Thu Sep 04 13:42:50 2003] [error] [client 137.43.112.72] Premature end of script headers: test.html
[Thu Sep 04 13:43:04 2003] [error] [client 137.43.112.72] attempt to invoke directory as script: /usr/local/apache2/2.0.43/cgi-bin/
[Thu Sep 04 13:43:15 2003] [error] [client 137.43.112.72] Premature end of script headers: hello.cgi

Can anybody help me with this problem. Part of my httpd.conf file is below

Code:
Listen (My WebServer IP:80)

#
# Dynamic Shared Object (DSO) Support
#

 LoadModule perl_module modules/mod_perl.so
 PerlModule Apache2



# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the realname directory are treated as applications and
# run by the server when requested rather than as documents sent to the client.
# The same rules about trailing "/" apply to ScriptAlias directives as to
# Alias.
#
ScriptAlias /cgi-bin/ "/usr/local/apache2/2.0.43/cgi-bin/"

<IfModule mod_cgid.c>
#
# Additional to mod_cgid.c settings, mod_cgid has Scriptsock <path>
# for setting UNIX socket for communicating with cgid.
#
#Scriptsock            logs/cgisock
</IfModule>

#
# "/usr/local/apache2/2.0.43/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "/usr/local/apache2/2.0.43/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>
 
Old 09-04-2003, 12:54 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Welcome to LQ.

Try setting ExecCGI as an option:
Options ExecCGI

Rather than None:
Options None
 
Old 09-04-2003, 01:08 PM   #3
hakcenter
Member
 
Registered: Apr 2003
Location: Not to far from the computer screen
Distribution: RedHat 9.0
Posts: 324

Rep: Reputation: 30
Could be how the cgi is copied too... strangly enough if I don't send files over zipped... they error too.. heh

Have to zip em...

Never tried the dos2unix or whatever that command is, heh
 
Old 09-04-2003, 01:47 PM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
If you uplaod from windows then just make suer you transfer in ascii and not binary mode.
 
Old 09-04-2003, 02:45 PM   #5
hakcenter
Member
 
Registered: Apr 2003
Location: Not to far from the computer screen
Distribution: RedHat 9.0
Posts: 324

Rep: Reputation: 30
hehe, it bums on samba transfers... Dunno how to set the transfer correctly on samba
 
Old 09-04-2003, 02:56 PM   #6
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
That is liekly to be the end of line characters you are using. Try using NoteTab:
http://www.notetab.com

and select "Unix" as the Save Format.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
does apache support cgi scripts and how to run them abhis_mail2002 Fedora 3 03-15-2005 04:37 AM
Cant run CGI scripts on Apache! mylo2003 Linux - General 5 11-09-2004 09:22 AM
Can windows run CGI Scripts? mylo2003 Linux - General 5 08-28-2003 03:07 PM
Apache cgi scripts! boyinfrance Linux - Newbie 2 06-22-2002 10:33 PM
cant run cgi scripts jmdey Linux - Networking 1 01-07-2002 07:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:34 AM.

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
Open Source Consulting | Domain Registration