httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boyle Owen" <Owen.Bo...@swx.com>
Subject RE: [users@httpd] Content Type
Date Tue, 05 Nov 2002 15:02:33 GMT
Apache changes the mime-type because you tell it to. The mime.type file
is authoritative.

My understanding is that you should not specify a mime.type for a
resource which generates its own content-type header. You can use CGIs
to generate image/gif or video/mpeg or anything so you shouldn't make
the content-type dependent on the filename.

If you remove "pl" from mime.types do you still have the problem?

Rgds,

Owen Boyle

-----Original Message-----
From: Greg Sidelinger [mailto:gate@ilive4code.net]
Sent: Dienstag, 5. November 2002 15:23
To: users@httpd.apache.org
Subject: Re: [users@httpd] Content Type


On Tuesday 05 November 2002 03:36 am, Boyle Owen wrote:
> The mime.types file is normally only used for static files. Since a
CGI
> produces dynamic output, its output is fed to the client as-is. A
> reprequisite is that the program produces a valid CGI header,
otherwise
> you get the famous "Premature end of script header" error.
>
> You are doing this with your CGI print_header() call and as you see in
> Lynx, you get "Content-Type: text/html" which should lead to the
browser
> parsing the data as HTML. So I'm a bit perplexed...
>
You should be becuase I was stupid and ment to say "lynx says it is 
application/x-perl.  Now my problem may make some more sense.

>
> Try *removing* the extension "pl" from mime.types. Then apache will
not
> try to generate a mime-type for it and will simply echo the script
> output to the client - I guess...
>
Sorry, BIG ass, mistake on my part.  lynx is saying that the files are 
application/x-perl when I use the default setup the came with the debian
package.  Now if I do remove pl from the mine type it sends it as
plain/text 
which is the default in the apapche config. 

Now that I have the correct info stated someone could tell my why apache
is 
chaning my content type.  I don't beleive editing the mime file is the 
correct path to be taking. 

>
> Rgds,
>
> Owen Boyle
>
>
>
> -----Original Message-----
> From: Greg Sidelinger [mailto:gate@ilive4code.net]
> Sent: Dienstag, 5. November 2002 03:11
> To: users@httpd.apache.org
> Subject: [users@httpd] Content Type
>
>
> Ok I'm trying to set up apache on my main debian desktop.  I can't see
> to
> get apache to work with some perl cgi scripts.  When I try to access
> them
> in any broswer it sends the output of the script as the name of the
> script
> and wants to know if I want to open or save it.  I can't seem to
figure
> out why after diging through the apache config file and logs.  Here is
> an
> example of the code and the output.  I do know that apache is changing
> the
> content to what is in the mine file for pl files. I can tell this by
> looking at lynx --source -head script_url If I say that pl files are
> text/html then it works fine but then a perl script can't output
> anything
> else.  Could someone please help me.
>
>
> ***********************************************
> Code ex:  This is the code that actually prints the html.  I am using
> the
> CGI pm for the print header, start_html and end html
> ***********************************************
>
> print header();
> print start_html(-title=>"SQL Page");
> print '<form name="" method="get" action="'.$script_name.'">
>         Enter SQL statement:<br>
>         <textarea name="statement" cols="80"
> rows="5">'.$statement.'</textarea>
>         <br><input type="submit">
> </form>
> <br>
> Statement Executed: '.param('statement').'
> <br><br>
> '.$html;
> print end_html();
>
> ***********************************************
> command line output when I run the script
> ***********************************************
>
> Content-Type: text/html; charset=ISO-8859-1
>
> <?xml version="1.0" encoding="iso-8859-1"?>
> <!DOCTYPE html
>         PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml"
lang="en-US"><head><title>SQL
> Page</title>
> </head><body><form name="" method="get" action="/./select.pl">
>         Enter SQL statement:<br>
>         <textarea name="statement" cols="80" rows="5"></textarea>
>         <br><input type="submit">
> </form>
> <br>
> Statement Executed:
> <br><br>
> </body></html>
>
>
>
> ***********************************************
> And finally what is sent to the browser:  This is what shows up when I
> open it with a text editor
> ***********************************************
>
>
>                 <html>
>                 <head>
>                 <title>Untitled Document</title>
>                 <meta http-equiv="Content-Type" content="text/html;
> charset=iso-8859-1">
>                 </head>
>                 <body>
>                 Something went wrong and the page can not be
> displayed<br>
>                 Error Msg:<br>Could not connect to the database.
>                 </body>
>                 </html>
>
>
>
> If anyone can tell me what may be causing this I would be very
> thankfull.
> It works fine under apache for windows.  The scripts work just fine
> under
> orlder version of apache too.
>
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server
> Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
> This message is for the named person's use only. It may contain
> confidential, proprietary or legally privileged information. No
> confidentiality or privilege is waived or lost by any mistransmission.
> If you receive this message in error, please notify the sender
urgently
> and then immediately delete the message and any copies of it from your
> system. Please also immediately destroy any hardcopies of the message.
> You must not, directly or indirectly, use, disclose, distribute,
print,
> or copy any part of this message if you are not the intended
recipient.
> The sender's company reserves the right to monitor all e-mail
> communications through their networks. Any views expressed in this
> message are those of the individual sender, except where the message
> states otherwise and the sender is authorised to state them to be the
> views of the sender's company.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server
Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server
Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

This message is for the named person's use only. It may contain
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or lost by any mistransmission.
If you receive this message in error, please notify the sender urgently
and then immediately delete the message and any copies of it from your
system. Please also immediately destroy any hardcopies of the message.
You must not, directly or indirectly, use, disclose, distribute, print,
or copy any part of this message if you are not the intended recipient.
The sender's company reserves the right to monitor all e-mail
communications through their networks. Any views expressed in this
message are those of the individual sender, except where the message
states otherwise and the sender is authorised to state them to be the
views of the sender's company. 

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message