【发布时间】:2014-01-30 19:58:19
【问题描述】:
我需要从我的 Web 服务器中删除 Apache 身份验证。有人只是把它交给我,而我真的是 apache 和 PHP 的菜鸟。这里是配置文件:
- /etc/apache2/site-available/testing.local.conf
块引用 ServerAdmin admin@domain.com
ServerName testing.local DocumentRoot /var/www/testing ServerAlias www.testing.local AcceptPathInfo On AddOutputFilterByType DEFLATE text/html text/plain text/xml <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/testing> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> ErrorLog /var/log/apache2/testing.local_error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /var/log/apache2/testing.local_access.log combined ServerSignature On </VirtualHost>
- .htaccess
RewriteEngine On RewriteRule ^([^.]+)$ index.php/$1 AuthType Digest AuthName "ggdev" AuthDigestDomain /testing AuthDigestProvider file AuthUserFile /var/www/env/htpasswd.dav Require valid-user php_value short_open_tag off
在 apache 上启用了 2 个模块:
- 重写
- auth_digest
我想不输入用户名/密码直接进入主页。
【问题讨论】:
-
从 htaccess 中删除所有以
Auth…和Require …开头的行。然后开始阅读 Apache 文档,这样您至少可以大致了解自己在做什么……