3

I've set up a Ubuntu server with Apache 2. Instead of FTP, I'm using WebDAV to upload/download files and it works great. However, it's not possible to upload/download or modify .htaccess files, because the Apache server returns an 404 (forbidden) error.

How is it possible to enable working with .htaccess files like with any other file?

By the way: don't worry. The WebDAV access run over a WebDAV-only host to avoid security issues.

4 Answers 4

4

You can't access .htaccess or .htpasswd from a normal apache because it protects them. They have sensitive information inside (usernames, special commands, etc) and it correctly does not allow you to see them.

(s)ftp is the way to do it...

If you still want to edit them...try changing this config part inside your /etc/apache2/apache2.conf:

AccessFileName .htaccess

<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
</Files>

Change

Deny from all

to

Allow from 192.168.1.0/24 
Deny from all

to allow your internal network clients to access these files...

0
1

what about disabling .htaccess files with

  <Directory DocumentRoot>
      # disable the .htaccess redirect in /var/www/.htaccess
      # AllowOv. only valid in <Dir > tag!
      AllowOverride None
      Order allow,deny
      allow from all                        
    </Directory>
0

For completeness, one possible resolution would be switching to svnserve, Subversion's native server, if it's practical to do such a thing.

0

We had the same annoying issue with apache 2.4 and it remained a showstopper for our approach to replace FTP with WebDAV until we decided to use a dedicated webdav server.

Our choice was wsgidav which does a pretty good job.

You must log in to answer this question.