配置apache mod_别名时出现内部服务器错误
我的虚拟主机有以下配置配置apache mod_别名时出现内部服务器错误,apache,.htaccess,mod-alias,Apache,.htaccess,Mod Alias,我的虚拟主机有以下配置 <VirtualHost 127.0.0.1:80> ServerAdmin admins@example.com DocumentRoot /home/mydir ServerName mydir.domain.com ErrorLog /home/mydir
<VirtualHost 127.0.0.1:80>
ServerAdmin admins@example.com
DocumentRoot /home/mydir
ServerName mydir.domain.com
ErrorLog /home/mydir/logs/apache-local-error_log
CustomLog /home/mydir/logs/apache-local-access_log common
RewriteEngine on
RewriteLog /home/mydir/logs/rewrite.log
RewriteLogLevel 3
Alias /proj /home/mydir/proj/public_html
<Directory /home/mydir>
Options +Indexes
AllowOverride ALL
</Directory>
</VirtualHost>
apache-local-error\u日志:
[Fri Nov 28 13:16:58 2014] [error] [client IP Address] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
在/home/mydir/proj/public_html中,我可以访问laravel的标准.htaccess:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.*$ index.php [L]
RewriteCond %{HTTP:Authorization} ^(.+)$
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>
选项-多视图
重新启动发动机
#重定向尾部斜杠。。。
重写规则^(.*)/$/$1[L,R=301]
#处理前控制器。。。
重写cond%{REQUEST_FILENAME}-D
重写cond%{REQUEST_FILENAME}-F
重写规则^.*$index.php[L]
重写条件%{HTTP:Authorization}^(+)$
重写规则。*-[E=HTTP\U授权:%{HTTP:AUTHORIZATION}]
任何关于我做错了什么的建议都将不胜感激 更新配置文件
<VirtualHost 127.0.0.1:80>
ServerAdmin admins@example.com
DocumentRoot /home/mydir
ServerName mydir.domain.com
ErrorLog /home/mydir/logs/apache-local-error_log
CustomLog /home/mydir/logs/apache-local-access_log common
RewriteEngine on
RewriteLog /home/mydir/logs/rewrite.log
RewriteLogLevel 3
Alias /proj /home/mydir/proj/public_html
<Directory /home/mydir>
Options +Indexes
AllowOverride all
Require all granted
</Directory>
</VirtualHost>
服务器管理员admins@example.com
DocumentRoot/home/mydir
ServerName mydir.domain.com
ErrorLog/home/mydir/logs/apache-local-error\u log
CustomLog/home/mydir/logs/apache-local-access\u log common
重新启动发动机
RewriteLog/home/mydir/logs/rewrite.log
重写日志级别3
别名/proj/home/mydir/proj/public\u html
选项+索引
允许超越所有
要求所有授权
index.php在它搜索的位置不存在?index.php在/home/mydir/proj/public_html@Sumurai8I中,我想你的别名就是罪魁祸首。但是我没有足够的经验来确定。请尝试对此进行注释,重新启动Apache(必选步骤!),然后重试。@Sumurai8 yes别名是问题所在,我需要修复它,而不是删除它。我已经删除了,如果我转到,它可以工作,但我不想在url中编写public\u html,我不想通过http访问public\u html上面的文件为什么不更改文档的根目录呢?如果您不想访问低于该级别的文件,则应将文档根目录移到/proj/public_html目录。我有apache 2.2,并且Reuire all授予了我以下错误:“配置错误:无法执行身份验证。未设置AuthType!”我已经搜索了这个解决方案,但大多数时候我发现我需要删除它或使用“allow from all”。我试过了,但运气不好。
<VirtualHost 127.0.0.1:80>
ServerAdmin admins@example.com
DocumentRoot /home/mydir
ServerName mydir.domain.com
ErrorLog /home/mydir/logs/apache-local-error_log
CustomLog /home/mydir/logs/apache-local-access_log common
RewriteEngine on
RewriteLog /home/mydir/logs/rewrite.log
RewriteLogLevel 3
Alias /proj /home/mydir/proj/public_html
<Directory /home/mydir>
Options +Indexes
AllowOverride all
Require all granted
</Directory>
</VirtualHost>