我们的DEV服务器使用apache的.htpasswd来保护每个站点,但我们的CMS要求排除文件目录或多个文件上传不起作用。
搜索完毕后,我们会在虚拟主机文件中尝试以下操作,但它似乎无法正常工作:
<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>
任何人都可以看到我们做错了吗?
非常感谢任何正确方向的帮助或指示。