0

Our DEV server uses apache's .htpasswd to protect each site but our CMS requires the file directory to be excluded or multiple file uploads won't work.

After searching, we're trying the following in the virtual host file but it doesn't seem to work:

<VirtualHost *:80>

  ServerName website.dev.com
  DocumentRoot /home/website/public_html/
  Alias /robots.txt /home/robots.txt

  <Directory /home/website/public_html/ >
    Options -Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    Allow from all

    # PASSWORD PROTECT WEBSITE ON DEV SERVER
    # Requires the .htpasswd file created during dev server setup
    # -----------------------------------------------------------------------
    AuthUserFile /home/.htpasswd
    AuthType Basic
    AuthName "This website is in development, enter your credentials to view"
    Require valid-user
  </Directory>

  <Directory /home/website/public_html/files/>
    Allow from all
    Satisfy any
  </Directory>

  LogLevel warn
  CustomLog /var/log/apache2/website.dev.com.log combined
  ErrorLog /var/log/apache2/website.dev.com-error.log
</VirtualHost>

Can anyone see what we're doing wrong?

Any help or pointers in the right direction would be much appreciated.

CMSCSS
  • 2,076
  • 9
  • 28
  • 49
  • Describe `doesn't seem to work`. What are you expecting when you go to `http://website.dev.com/files/`? – kums Oct 29 '14 at 04:24
  • Thanks for that but we've finally figured it out - we were restarting apache but that doesn't reload the virtual host files. After reloading apache, the CMS now has proper access to the /files directory. Cheers – CMSCSS Oct 29 '14 at 17:53
  • Hmmm... weirdly, this doesn't work in Safari or Firefox which still block access to the ````/files```` url. No biggie as we'll just use Webkit for the dev server. – CMSCSS Oct 29 '14 at 21:03

0 Answers0