You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Michael Felt <ma...@gmail.com> on 2014/06/21 16:45:10 UTC

[users@httpd] Problem with Content-Type recognition

I have tried, in a vhost area, to set the DefaultType to
application/octet-stream, and I have tried to add a Type for .I (capital i)
endings. However, httpd-2.2.27 seems to be preferring the .php. in the
filename rather than the .I at the end of the file. When I link the file to
that it has the name *.php5.* then the ContentType: is as expected.

Wrong:
# wget -q -d http://dl.aixtools.net/php/aixtools.php.5.2.17.0.I
DEBUG output created by Wget 1.13.4 on aix5.3.0.0.

Caching dl.aixtools.net => 86.85.86.223
Created socket 3.
Releasing 0x200336b8 (new refcount 1).

---request begin---
GET /php/aixtools.php.5.2.17.0.I HTTP/1.1
User-Agent: Wget/1.13.4 (aix5.3.0.0)
Accept: */*
Host: dl.aixtools.net
Connection: Keep-Alive

---request end---

---response begin---
HTTP/1.1 200 OK
Date: Sat, 21 Jun 2014 14:37:40 GMT
Server: Apache/2.2.27 (Unix) PHP/5.2.17 mod_ssl/2.2.27 OpenSSL/1.0.1e DAV/2
X-Powered-By: PHP/5.2.17
Content-Length: 316
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html
Content-Encoding: x-binary

---response end---
Registered socket 3 for persistent reuse.

Correct:
# wget -q -d http://dl.aixtools.net/php/aixtools.php5.5.2.17.0.I
DEBUG output created by Wget 1.13.4 on aix5.3.0.0.

Caching dl.aixtools.net => 86.85.86.223
Created socket 3.
Releasing 0x200336c8 (new refcount 1).

---request begin---
GET /php/aixtools.php5.5.2.17.0.I HTTP/1.1
User-Agent: Wget/1.13.4 (aix5.3.0.0)
Accept: */*
Host: dl.aixtools.net
Connection: Keep-Alive

---request end---

---response begin---
HTTP/1.1 200 OK
Date: Sat, 21 Jun 2014 14:45:25 GMT
Server: Apache/2.2.27 (Unix) PHP/5.2.17 mod_ssl/2.2.27 OpenSSL/1.0.1e DAV/2
Last-Modified: Fri, 20 Jun 2014 19:36:29 GMT
ETag: "69c002e-22f2200-4fc499c200940"
Accept-Ranges: bytes
Content-Length: 36643328
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: application/octet-stream
Content-Encoding: x-binary

---response end---
Registered socket 3 for persistent reuse.

Question: what do I need to do to get httpd to recognize the .I endings
and/or ignore .php when in the middle of a filename?

Thanks!

Re: [users@httpd] Problem with Content-Type recognition

Posted by Michael Felt <ma...@gmail.com>.
Still hoping for some additional help with this. Many thanks for your
suggestion/correction.


On Mon, Jun 30, 2014 at 11:27 PM, Michael Felt <ma...@gmail.com> wrote:

> I did not figure out how to get extra info from the "maintainer" and
> "debug" enabled version, and it was not as stable (may need to also rebuild
> the php module against the "debug" version. I hoped syslog and .debug level
> would be very verbose.
>
> So, call me "anything you like", but I am not coming up with the right
> combination of directives to get httpd to ignore the .php in the filename
> (e.g., removeEncoding had no effect).
>
> What directive should I be using instead?
>
> Many thanks for assistance!
>
> Michael
>
>
> On Mon, Jun 23, 2014 at 2:51 PM, Michael Felt <ma...@gmail.com> wrote:
>
>> I have recompiled httpd-2.2.27 with --enable-maintainer-mode and
>> --enable--debugger-mode, and set, to be sure, optimization to -O0
>>
>> Some help with what needs to be done to get more debug info into the logs
>> is appreciated.
>>
>> (Note: going on a short vacation, so I might not respond again real soon).
>>
>>
>> On Mon, Jun 23, 2014 at 10:48 AM, Michael Felt <ma...@gmail.com> wrote:
>>
>>> Good Idea, and I was hoping that using
>>>
>>>     RemoveEncoding .php
>>>
>>> was doing that.
>>>
>>> As this is a vhost, and other vhosts are using php I do not see removing
>>> PHP from the server as a solution. So, RemoveEncoding may be the wrong
>>> solution. (I was glad I even figured out that the embedded .php. in the
>>> filename is what was triggering this?)
>>>
>>> Should I "change" the encoding - will that override the effect you
>>> describe?
>>>
>>> I tried experimenting with this: still not getting the effect I am
>>> looking for. I am assuming I am using the wrong directive. (I removed the
>>> RemoveEncoding because I changed the Type - and it did not seem to be doing
>>> anything anyway).
>>>
>>> <Directory "/aixtools/dl.aixtools">
>>>     DefaultType application/octet-stream
>>>     AddType application/octet-stream .php
>>>
>>>     <Files *.I>
>>> #   RemoveEncoding .php
>>>
>>>     ForceType application/octet-stream
>>>     </Files>
>>>     Options Indexes FollowSymLinks
>>>         IndexOptions FancyIndexing Namewidth=* FoldersFirst
>>> SuppressDescription
>>>         IndexOrderDefault Descending Date
>>>     AllowOverride None
>>>     Order allow,deny
>>>     Allow from all
>>> </Directory>
>>>
>>>
>>>
>>> On Sun, Jun 22, 2014 at 11:45 PM, Nick Kew <ni...@webthing.com> wrote:
>>>
>>>> On Sat, 21 Jun 2014 16:45:10 +0200
>>>> Michael Felt <ma...@gmail.com> wrote:
>>>>
>>>> > I have tried, in a vhost area, to set the DefaultType to
>>>> > application/octet-stream, and I have tried to add a Type for .I
>>>> (capital i)
>>>> > endings. However, httpd-2.2.27 seems to be preferring the .php. in the
>>>> > filename rather than the .I at the end of the file. When I link the
>>>> file to
>>>> > that it has the name *.php5.* then the ContentType: is as expected.
>>>>
>>>> If you have PHP handling .php requests, then PHP sets the Content-Type
>>>> (and other) headers, overriding your config.
>>>>
>>>> Turn off PHP (in the scope of the URL in question) if you want
>>>> to use Apache configuration to control content-type.
>>>>
>>>>
>>>> --
>>>> Nick Kew
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>>> For additional commands, e-mail: users-help@httpd.apache.org
>>>>
>>>>
>>>
>>
>

Re: [users@httpd] Problem with Content-Type recognition

Posted by Michael Felt <ma...@gmail.com>.
I did not figure out how to get extra info from the "maintainer" and
"debug" enabled version, and it was not as stable (may need to also rebuild
the php module against the "debug" version. I hoped syslog and .debug level
would be very verbose.

So, call me "anything you like", but I am not coming up with the right
combination of directives to get httpd to ignore the .php in the filename
(e.g., removeEncoding had no effect).

What directive should I be using instead?

Many thanks for assistance!

Michael


On Mon, Jun 23, 2014 at 2:51 PM, Michael Felt <ma...@gmail.com> wrote:

> I have recompiled httpd-2.2.27 with --enable-maintainer-mode and
> --enable--debugger-mode, and set, to be sure, optimization to -O0
>
> Some help with what needs to be done to get more debug info into the logs
> is appreciated.
>
> (Note: going on a short vacation, so I might not respond again real soon).
>
>
> On Mon, Jun 23, 2014 at 10:48 AM, Michael Felt <ma...@gmail.com> wrote:
>
>> Good Idea, and I was hoping that using
>>
>>     RemoveEncoding .php
>>
>> was doing that.
>>
>> As this is a vhost, and other vhosts are using php I do not see removing
>> PHP from the server as a solution. So, RemoveEncoding may be the wrong
>> solution. (I was glad I even figured out that the embedded .php. in the
>> filename is what was triggering this?)
>>
>> Should I "change" the encoding - will that override the effect you
>> describe?
>>
>> I tried experimenting with this: still not getting the effect I am
>> looking for. I am assuming I am using the wrong directive. (I removed the
>> RemoveEncoding because I changed the Type - and it did not seem to be doing
>> anything anyway).
>>
>> <Directory "/aixtools/dl.aixtools">
>>     DefaultType application/octet-stream
>>     AddType application/octet-stream .php
>>
>>     <Files *.I>
>> #   RemoveEncoding .php
>>
>>     ForceType application/octet-stream
>>     </Files>
>>     Options Indexes FollowSymLinks
>>         IndexOptions FancyIndexing Namewidth=* FoldersFirst
>> SuppressDescription
>>         IndexOrderDefault Descending Date
>>     AllowOverride None
>>     Order allow,deny
>>     Allow from all
>> </Directory>
>>
>>
>>
>> On Sun, Jun 22, 2014 at 11:45 PM, Nick Kew <ni...@webthing.com> wrote:
>>
>>> On Sat, 21 Jun 2014 16:45:10 +0200
>>> Michael Felt <ma...@gmail.com> wrote:
>>>
>>> > I have tried, in a vhost area, to set the DefaultType to
>>> > application/octet-stream, and I have tried to add a Type for .I
>>> (capital i)
>>> > endings. However, httpd-2.2.27 seems to be preferring the .php. in the
>>> > filename rather than the .I at the end of the file. When I link the
>>> file to
>>> > that it has the name *.php5.* then the ContentType: is as expected.
>>>
>>> If you have PHP handling .php requests, then PHP sets the Content-Type
>>> (and other) headers, overriding your config.
>>>
>>> Turn off PHP (in the scope of the URL in question) if you want
>>> to use Apache configuration to control content-type.
>>>
>>>
>>> --
>>> Nick Kew
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>> For additional commands, e-mail: users-help@httpd.apache.org
>>>
>>>
>>
>

Re: [users@httpd] Problem with Content-Type recognition

Posted by Michael Felt <ma...@gmail.com>.
I have recompiled httpd-2.2.27 with --enable-maintainer-mode and
--enable--debugger-mode, and set, to be sure, optimization to -O0

Some help with what needs to be done to get more debug info into the logs
is appreciated.

(Note: going on a short vacation, so I might not respond again real soon).


On Mon, Jun 23, 2014 at 10:48 AM, Michael Felt <ma...@gmail.com> wrote:

> Good Idea, and I was hoping that using
>
>     RemoveEncoding .php
>
> was doing that.
>
> As this is a vhost, and other vhosts are using php I do not see removing
> PHP from the server as a solution. So, RemoveEncoding may be the wrong
> solution. (I was glad I even figured out that the embedded .php. in the
> filename is what was triggering this?)
>
> Should I "change" the encoding - will that override the effect you
> describe?
>
> I tried experimenting with this: still not getting the effect I am looking
> for. I am assuming I am using the wrong directive. (I removed the
> RemoveEncoding because I changed the Type - and it did not seem to be doing
> anything anyway).
>
> <Directory "/aixtools/dl.aixtools">
>     DefaultType application/octet-stream
>     AddType application/octet-stream .php
>
>     <Files *.I>
> #   RemoveEncoding .php
>
>     ForceType application/octet-stream
>     </Files>
>     Options Indexes FollowSymLinks
>         IndexOptions FancyIndexing Namewidth=* FoldersFirst
> SuppressDescription
>         IndexOrderDefault Descending Date
>     AllowOverride None
>     Order allow,deny
>     Allow from all
> </Directory>
>
>
>
> On Sun, Jun 22, 2014 at 11:45 PM, Nick Kew <ni...@webthing.com> wrote:
>
>> On Sat, 21 Jun 2014 16:45:10 +0200
>> Michael Felt <ma...@gmail.com> wrote:
>>
>> > I have tried, in a vhost area, to set the DefaultType to
>> > application/octet-stream, and I have tried to add a Type for .I
>> (capital i)
>> > endings. However, httpd-2.2.27 seems to be preferring the .php. in the
>> > filename rather than the .I at the end of the file. When I link the
>> file to
>> > that it has the name *.php5.* then the ContentType: is as expected.
>>
>> If you have PHP handling .php requests, then PHP sets the Content-Type
>> (and other) headers, overriding your config.
>>
>> Turn off PHP (in the scope of the URL in question) if you want
>> to use Apache configuration to control content-type.
>>
>>
>> --
>> Nick Kew
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>>
>

Re: [users@httpd] Problem with Content-Type recognition

Posted by Michael Felt <ma...@gmail.com>.
Good Idea, and I was hoping that using

    RemoveEncoding .php

was doing that.

As this is a vhost, and other vhosts are using php I do not see removing
PHP from the server as a solution. So, RemoveEncoding may be the wrong
solution. (I was glad I even figured out that the embedded .php. in the
filename is what was triggering this?)

Should I "change" the encoding - will that override the effect you describe?

I tried experimenting with this: still not getting the effect I am looking
for. I am assuming I am using the wrong directive. (I removed the
RemoveEncoding because I changed the Type - and it did not seem to be doing
anything anyway).

<Directory "/aixtools/dl.aixtools">
    DefaultType application/octet-stream
    AddType application/octet-stream .php

    <Files *.I>
#   RemoveEncoding .php
    ForceType application/octet-stream
    </Files>
    Options Indexes FollowSymLinks
        IndexOptions FancyIndexing Namewidth=* FoldersFirst
SuppressDescription
        IndexOrderDefault Descending Date
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>


On Sun, Jun 22, 2014 at 11:45 PM, Nick Kew <ni...@webthing.com> wrote:

> On Sat, 21 Jun 2014 16:45:10 +0200
> Michael Felt <ma...@gmail.com> wrote:
>
> > I have tried, in a vhost area, to set the DefaultType to
> > application/octet-stream, and I have tried to add a Type for .I (capital
> i)
> > endings. However, httpd-2.2.27 seems to be preferring the .php. in the
> > filename rather than the .I at the end of the file. When I link the file
> to
> > that it has the name *.php5.* then the ContentType: is as expected.
>
> If you have PHP handling .php requests, then PHP sets the Content-Type
> (and other) headers, overriding your config.
>
> Turn off PHP (in the scope of the URL in question) if you want
> to use Apache configuration to control content-type.
>
>
> --
> Nick Kew
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

Re: [users@httpd] Problem with Content-Type recognition

Posted by Nick Kew <ni...@webthing.com>.
On Sat, 21 Jun 2014 16:45:10 +0200
Michael Felt <ma...@gmail.com> wrote:

> I have tried, in a vhost area, to set the DefaultType to
> application/octet-stream, and I have tried to add a Type for .I (capital i)
> endings. However, httpd-2.2.27 seems to be preferring the .php. in the
> filename rather than the .I at the end of the file. When I link the file to
> that it has the name *.php5.* then the ContentType: is as expected.

If you have PHP handling .php requests, then PHP sets the Content-Type
(and other) headers, overriding your config.

Turn off PHP (in the scope of the URL in question) if you want
to use Apache configuration to control content-type.


-- 
Nick Kew

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Problem with Content-Type recognition

Posted by Michael Felt <ma...@gmail.com>.
Maybe I need to put it somewhere else?

...
<Directory "/aixtools/dl.aixtools">
    DefaultType application/octet-stream
    <Files *.I>
    RemoveEncoding .php
    ForceType application/octet-stream
    </Files>
    Options Indexes FollowSymLinks
        IndexOptions FancyIndexing Namewidth=* FoldersFirst
SuppressDescription
## VersionSort
        IndexOrderDefault Descending Date
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
</VirtualHost>

Still getting Content-Type: text/html when .php is in the filename.


On Sat, Jun 21, 2014 at 6:05 PM, Eric Covener <co...@gmail.com> wrote:

> On Sat, Jun 21, 2014 at 10:45 AM, Michael Felt <ma...@gmail.com> wrote:
> > Question: what do I need to do to get httpd to recognize the .I endings
> > and/or ignore .php when in the middle of a filename?
>
>
> <Files *.I>
> ForceType  foo/bar
> </Files>
>
> --
> Eric Covener
> covener@gmail.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

Re: [users@httpd] Problem with Content-Type recognition

Posted by Eric Covener <co...@gmail.com>.
On Sat, Jun 21, 2014 at 10:45 AM, Michael Felt <ma...@gmail.com> wrote:
> Question: what do I need to do to get httpd to recognize the .I endings
> and/or ignore .php when in the middle of a filename?


<Files *.I>
ForceType  foo/bar
</Files>

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org