LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-01-2004, 05:37 AM   #1
scuffell
Member
 
Registered: Jun 2004
Location: Reading, UK
Distribution: SUSE 9.1, SUSE 9.2, SUSE 9.3, Knoppix 3.8, Gentoo 2005.0, cygwn, colinux
Posts: 100

Rep: Reputation: 15
Quick Apache question


Hi,

Having a bit of a problem with CGI scripts without file extensions (eg. www.mydomain.com/cgi-bin/qmailadmin). When I go to the address of the cgi script, I am just prompted to download the file. I presume that I need to put an AddType directive into httpd.conf to map these files to the right mime type, but I'm not quite sure how to do it.

Any Ideas?

Thanks in advance
 
Old 09-01-2004, 07:14 AM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
For cgi scripts that need to be executed thru a browser, you'll need some kind of extension.
 
Old 09-01-2004, 07:21 AM   #3
Donboy
Member
 
Registered: Aug 2003
Location: Little Rock, Arkansas
Distribution: RH, Fedora, Suse, AIX
Posts: 736

Rep: Reputation: 31
qmailadmin is a binary file which need to be owned by the vpopmail user and needs to be in the vchkpw group.

chown vpopmail qmailadmin
chgrp vchkpw qmailadmin
chmod u+s,g+s qmailadmin

ls -l qmailadmin
-rwsr-sr-x 1 vpopmail vchkpw 379879 Nov 28 01:46 qmailadmin
 
Old 09-01-2004, 07:28 AM   #4
scuffell
Member
 
Registered: Jun 2004
Location: Reading, UK
Distribution: SUSE 9.1, SUSE 9.2, SUSE 9.3, Knoppix 3.8, Gentoo 2005.0, cygwn, colinux
Posts: 100

Original Poster
Rep: Reputation: 15
Thanks, but everyone else on the internet seems to have it working fine without an extension. The main thing I'm trying to get to work is qmailadmin following the tutorial on qmailrocks.org, and I've looked through all the documentation on it and it says nothing about editing your apache config.

When I type 'file qmailadmin' I get

qmailadmin: setuid setgid ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), stripped

which suggests that it is an executable rather than a bit of perl. I can put a .cgi file extension onto the end of qmailadmin to get qmailadmin.cgi, and it runs alright in a browser. But as soon as I try to submit something, it tries to find qmailadmin again and comes back with a 404 error. I also tried symlinking qmailadmin to qmailadmin.cgi and telling apache to follow symlinks in that directory, but to no avail.

Any more ideas?
 
Old 09-01-2004, 07:29 AM   #5
Donboy
Member
 
Registered: Aug 2003
Location: Little Rock, Arkansas
Distribution: RH, Fedora, Suse, AIX
Posts: 736

Rep: Reputation: 31
You dont need the extension. It will work without it. Your permissions/ownerships must be wrong.
 
Old 09-01-2004, 07:31 AM   #6
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Can't use symlinks thru a browser, not possible that I know of. Come to think of it you can most likely use it without extensions but you need to tell apache this and configure it properly. I unfortunately have never bothered to do this so I'd suggest reading up the docs over at httpd.apache.org for more information in configuring apache to know to execute without an extension.
 
Old 09-01-2004, 07:34 AM   #7
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Quote:
Originally posted by Donboy
You dont need the extension. It will work without it. Your permissions/ownerships must be wrong.
It can't be his permissions.. he changes the name with a .cgi at the end and it executes.. it just tries to go back to the original filename, my guess is it refers to that name in the script.

There is no extension and apache thinks its a binary file so its prompting to download. You have to get apache to execute this file instead of prompting to download since it has no extensions to define what kind of script it is.. a cgi or pl and so on.
 
Old 09-01-2004, 08:57 AM   #8
scuffell
Member
 
Registered: Jun 2004
Location: Reading, UK
Distribution: SUSE 9.1, SUSE 9.2, SUSE 9.3, Knoppix 3.8, Gentoo 2005.0, cygwn, colinux
Posts: 100

Original Poster
Rep: Reputation: 15
Sorted it, had to add a SetHandler directive into httpd.conf to tell apache that everything in /cgi-bin was a cgi-script.

Thanks for your help anyway
 
Old 09-01-2004, 10:41 AM   #9
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Quote:
Originally posted by scuffell
Sorted it, had to add a SetHandler directive into httpd.conf to tell apache that everything in /cgi-bin was a cgi-script.

Thanks for your help anyway
Glad it worked.. as I knew it wasn't a permissions issue
 
Old 09-01-2004, 11:52 AM   #10
Donboy
Member
 
Registered: Aug 2003
Location: Little Rock, Arkansas
Distribution: RH, Fedora, Suse, AIX
Posts: 736

Rep: Reputation: 31
Geez, nice of you to rub it in my face.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
quick apache 2 question eckertc1 Linux - Software 8 03-09-2005 12:38 AM
Quick question about apache The_Messiah Slackware 2 09-04-2004 04:39 PM
Quick Apache question karlan Linux - Software 2 07-03-2004 02:20 AM
A quick Apache question. slackMeUp Slackware 5 04-25-2004 03:19 PM
Quick apache question needforspeed Linux - Software 4 01-30-2004 04:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:59 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
Open Source Consulting | Domain Registration