php files on webdav (SetHandler)

Mark Dokter dokter at icg.tugraz.at
Tue Mar 27 09:26:03 UTC 2012


On 3/22/12 7:24 PM, Clint Byrum wrote:
> Excerpts from Mark Dokter's message of Tue Mar 20 04:06:27 -0700 2012:
>> Hi!
>>
>> I just noticed that the usual way to edit php files through webdav does
>> not work on my ubuntu server 11.10. The ForceType text/plain is ignored
>> as is the RemoveHandler .php or RemoveType .php.
>> After a little trial and error I found out, that a SetHandler None and
>> ForceType text/plain combination in the DAV location works now the same
>> way the single ForceType text/plain used to work.
>> Is it a new apache behaviour, ubuntu specialty or just my installation?
>>
> 
> On what version did it "used to work" ? This is most likely an apache
> behavior change, but its hard to determine that if we don't know at what
> point it did work.
> 

It used to work on an ubuntu 9.04 installation with apache 2.2.11 and
does not on 11.10 with apache 2.2.20. The workaround to access php files
via webdav with ForceType text/plain is documented in
http://httpd.apache.org/docs/2.2/mod/mod_dav.html. This *should* be
valid for both versons?!

> Given the documentation seen here:
> 
> http://httpd.apache.org/docs/2.2/mod/mod_mime.html#removehandler
> 
> I would expect "RemoveHandler .php" to do the same thing as SetHandler
> None, though I do notice that ForceType and SetHandler are both in core,
> while RemoveHandler and RemoveType are in mime.. so is it possible you
> don't have the mime module enabled (should be on by default)?
> 

The mime module is enabled (was by default). The desired behaviour (read
php code through webdav) is only achieved by the combination of
"ForceType text/plain" and "SetHandler None"

Here's the working config on the ubuntu 11.10 system (generalized):

  Alias /dav /srv/data/www/<...site-name...>
  <Location /dav>
    SetHandler None
    ForceType text/plain
    Dav On
    AuthName "<...site-name...> WebDAV access"
    AuthType Basic
    AuthBasicProvider ldap
    AuthzLDAPAuthoritative on
    AuthLDAPURL <...ldap-url...>
    require ldap-user <...user-names...>
  </Location>

This is what the config looked like on the old ubuntu 9.04 system:

  Alias /dav /srv/data/www/<...site-name...>
  <Location /dav>
    Dav On
    AuthName "<...site-name...> WebDAV access"
    AuthType Basic
    AuthBasicProvider ldap
    AuthzLDAPAuthoritative on
    AuthLDAPURL <...ldap-url...>
    require ldap-user <...user-names...>
    ForceType text/plain
  </Location>

As you can see, there's not much difference. The sad thing is, that I
had to find that out using trial and error, since all documentation I
found did not solve my problem.
The question now is: is my installation messed up? is it a ubuntu
special behaviour or is it a change in the apache software.




More information about the ubuntu-server mailing list