LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-25-2003, 06:36 PM   #16
ApacheMan252
Member
 
Registered: Feb 2003
Posts: 37

Original Poster
Rep: Reputation: 15

Yes, I do have the the AddHandler cgi-script .cgi .pl within the Directory and I also have the same permissions for the .pl files, -rwxr-xr-x.
 
Old 02-25-2003, 06:41 PM   #17
ApacheMan252
Member
 
Registered: Feb 2003
Posts: 37

Original Poster
Rep: Reputation: 15
The error log that Apache records is:

[error] [client 192.168.0.2] Premature end of script headers: /home/httpd/domain/cgi-bin/cgi-lib.pl

Is that an error with Apache or my script? I have used this script before and it has worked.

Thanks
 
Old 02-25-2003, 06:42 PM   #18
English Guy
LQ Newbie
 
Registered: Feb 2003
Posts: 6

Rep: Reputation: 0
rename the file .cgi & see if it will execute.
 
Old 02-25-2003, 07:30 PM   #19
ApacheMan252
Member
 
Registered: Feb 2003
Posts: 37

Original Poster
Rep: Reputation: 15
I just renamed the file, and I still get the same error.
 
Old 02-25-2003, 07:50 PM   #20
English Guy
LQ Newbie
 
Registered: Feb 2003
Posts: 6

Rep: Reputation: 0
The problem is with the script then. Paste the following into 2 files & name them test.cgi & test.pl, chmod 777 both of them, then execute both of them to see if they work.

#!/usr/bin/perl

print "Content-type: text/html\n\n";
print "<HTML><BODY><B>";
print "TESTING.....";
print "</BODY></HTML>";

# End of Script
 
Old 02-25-2003, 08:04 PM   #21
ApacheMan252
Member
 
Registered: Feb 2003
Posts: 37

Original Poster
Rep: Reputation: 15
I get an internal error also with the test scripts
 
Old 02-25-2003, 09:02 PM   #22
English Guy
LQ Newbie
 
Registered: Feb 2003
Posts: 6

Rep: Reputation: 0
1) From the command line, type 'whereis perl'. Does it say that perl is in /usr/bin/perl?
2) Add -w after #!/usr/bin/perl, so it reads #!/usr/bin/perl -w, Then type at the command line 'perl test.cgi'. Does it give an error message?
 
Old 02-25-2003, 09:07 PM   #23
ApacheMan252
Member
 
Registered: Feb 2003
Posts: 37

Original Poster
Rep: Reputation: 15
1. Yes, it does say that perl is in /usr/bin/perl. It has another directory after it though, it reads:

perl: /usr/bin/perl /usr/share/man/man1/perl.1.gz

2. No, it does not give me an error message.
 
Old 02-25-2003, 09:09 PM   #24
ApacheMan252
Member
 
Registered: Feb 2003
Posts: 37

Original Poster
Rep: Reputation: 15
I also tested my script, and I didnt get an error message either.
 
Old 02-26-2003, 02:36 PM   #25
ApacheMan252
Member
 
Registered: Feb 2003
Posts: 37

Original Poster
Rep: Reputation: 15
Do you think that it is a problem with a module or the way that I have it set up?

Thanks
 
Old 02-26-2003, 03:31 PM   #26
ApacheMan252
Member
 
Registered: Feb 2003
Posts: 37

Original Poster
Rep: Reputation: 15
Maybe it is something that I am doing wrong in the httpd.conf file. The following is of what I have for it that has anything to do directories or CGI. Remember, I have Apache 1.3.26:

ServerRoot "/usr/local/apache"

#Listen 80
#Listen 192.168.0.4:80

#BindAddress *

Port 80

User nobody
Group nobody

ServerAdmin Admin@domain.net

#ServerName domain.net

DocumentRoot "/home/httpd/domain"

<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>


<Directory "/home/httpd/domain">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>


<IfModule mod_dir.c>
DirectoryIndex index.html index.htm
</IfModule>
UseCanonicalName On

<IfModule mod_alias.c>

#
# Note that if you include a trailing / on fakename then the server will
# require it to be present in the URL. So "/icons" isn't aliased in this
# example, only "/icons/". If the fakename is slash-terminated, then the
# realname must also be slash terminated, and if the fakename omits the
# trailing slash, the realname must also omit it.
#
Alias /icons "/usr/local/apache/icons"

<Directory "/usr/local/apache/icons">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

# This Alias will project the on-line documentation tree under /manual/
# even if you change the DocumentRoot. Comment it if you don't want to
# provide access to the on-line documentation.
#
Alias /manual/ "/usr/local/apache/htdocs/manual/"

<Directory "/usr/local/apache/htdocs/manual">
Options Indexes FollowSymlinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

#
# 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/ "home/httpd/launchweb/cgi-bin/"

</IfModule>

# AddType allows you to tweak mime.types without actually editing it, or to
# make certain files to be certain types.
#
AddType application/x-tar .tgz
# To use CGI scripts:
AddHandler cgi-script .cgi .pl
#AddType text/html .shtml
#AddHandler server-parsed .shtml
#AddHandler send-as-is asis
#AddHandler imap-file map
#AddHandler type-map var

</IfModule>
# End of document types.


#<Location /cgi-bin/phf*>
# Deny from all
# ErrorDocument 403 http://phf.apache.org/phf_abuse_log.cgi
#</Location>

NameVirtualHost *

<Directory "/home/httpd/domainvh">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
DirectoryIndex index.html index.htm
</Directory>

<VirtualHost *>
UseCanonicalName Off
</VirtualHost>

<VirtualHost *>
UseCanonicalName Off
ServerName domainvh.com
DocumentRoot "/home/httpd/domainvh"
ServerAlias www.domainvh.com
</VirtualHost>

<Directory "/home/httpd/domain/cgi-bin">
AllowOverride None
Options +ExecCGI
Order allow,deny
Allow from all
AddHandler cgi-script .cgi .pl
</Directory>

Sorry for it being so long, hopefully this helps. I now know that I have the correct modules installed, if you want me to post the module list, I can.
 
Old 02-26-2003, 05:22 PM   #27
ApacheMan252
Member
 
Registered: Feb 2003
Posts: 37

Original Poster
Rep: Reputation: 15
If this helps any, if I take out the AddHandler cgi-script .cgi .pl command it works (which I dont know why it wouldnt, it would treat it like a regular file.) But as expected, when I went to try the script, I got a 405 Method Not Allowed error.

I dont know what else I can try... Any suggestions?

Thanks
 
Old 02-26-2003, 08:41 PM   #28
ApacheMan252
Member
 
Registered: Feb 2003
Posts: 37

Original Poster
Rep: Reputation: 15
Nevermind, it turns out that it was the scripts, after all of this...
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
CGI and Apache Sevoma Linux - Software 7 02-06-2005 06:55 PM
about Apache and CGI kpachopoulos General 1 11-17-2004 05:23 PM
apache v2.0.44 + cgi ; securing cgi-support in apache markus1982 Linux - General 0 01-20-2003 02:03 PM
apache-cgi j-ray Linux - Software 1 12-12-2002 04:31 PM
About cgi , pl. in apache.... raymond Linux - General 1 11-11-2002 10:22 AM


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