Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Cannot get media type from 'cgi-script'

Posted on 2006-04-14
5
Medium Priority
?
1,282 Views
Last Modified: 2008-01-09
Hi all.  I'm running Apache on both a Fedora Redhat Server, and a Windows PC (that I use for offline testing).  The following error is placed in the error log each time a CGI script is run on both the Fedora and Windows machine:

Cannot get media type from 'cgi-script'

The scripts execute correctly, but that error message shows up after every CGI script execution.

Here's the config section for this website:
<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot "C:\Design and Programming\current\gbcommerce\httpdocs"
    ServerName offline.gbcommerce.net
    ErrorLog "C:\Design and Programming\current\gbcommerce\error_log.txt"
 
    ScriptAlias /prgs "C:\Design and Programming\current\gbcommerce\httpdocs\prgs"  
   

    <Directory "C:\Design and Programming\current\gbcommerce\httpdocs">
    AddType cgi-script .cgi
    AddHandler cgi-script .cgi
    XBitHack Full
    Options Indexes FollowSymLinks ExecCGI
 
    </Directory>

</VirtualHost>

Incidentally, the error doesn't occur when I remove the AddType and AddHandler directives, such as in the following configuration (note that they're commented out):

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot "C:\Design and Programming\current\gbcommerce\httpdocs"
    ServerName offline.gbcommerce.net
    ErrorLog "C:\Design and Programming\current\gbcommerce\error_log.txt"
 
    ScriptAlias /prgs "C:\Design and Programming\current\gbcommerce\httpdocs\prgs"  
   

    <Directory "C:\Design and Programming\current\gbcommerce\httpdocs">
    #AddType cgi-script .cgi
    #AddHandler cgi-script .cgi
    XBitHack Full
    Options Indexes FollowSymLinks ExecCGI
 
    </Directory>

</VirtualHost>

The thing is that I need to be able to use those directives to allow CGI script execution outside of the actual defined script directory.  Don't ask me why, just trust me that I need to be able to do this.

So, the 164 point question is, how do I prevent this from happening.

Thanks,
Gregg

0
Comment
Question by:gboethin
  • 2
3 Comments
 
LVL 10

Accepted Solution

by:
sleep_furiously earned 656 total points
ID: 16458201
Maybe try using:

   AddType application/x-httpd-cgi   .cgi

Instead of:

   AddType cgi-script   .cgi

0
 

Author Comment

by:gboethin
ID: 16458296
Hey, that did it!  Thanks a lot.  

This is the first time I've created a post that was resolved here, so I'm not sure who I need to notify to let know this has been resolved.  Is that something that one of the moderators do?

Thanks again,

Gregg
0
 
LVL 10

Expert Comment

by:sleep_furiously
ID: 16458460
You should see an "Accept" button in the upper right of other's comments.  Click it to accept an answer.
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…
Suggested Courses
Course of the Month13 days, 12 hours left to enroll

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question