我有一个CentOS 7 VPS,在这里我试图按照https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-centos-7的指示安装虚拟主机。
我已经完成了本教程的第五步。然后,当我试图重新启动apache时,失败了:
$ sudo apachectl restart
[sudo] password for student01:
Job for httpd.service failed because the control process exited with error
我试图设置正在运行的Shopware 6实例的分期。当我像Shopware的医生所说的那样做的时候,当我像一样访问阶段时,我得到了一个403被禁止的错误--我得到了一个403错误。错误日志如下所示:
Cannot serve directory /home/user/xx/staging/public/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
我抄袭了.htaccess。
为什么我没有匹配的目录,但我有一个前几天起作用的目录,但现在没有了。我在使用Codeigniter。
Sun Feb 19 11:43:03.077759 2017 pid 5204:tid 1864年AH01276:无法服务于目录C:/xampp/htdocs/Groupie/assets/ DirectoryIndex /: No matching (index.php、index.pl、index.cgi、index.asp、index.shtml、index.html、index.htm、default.php、default.pl、default.cgi、default.asp、d
当我打开 (我的起始页)时,我想执行而不是apache重写的。
我想保留我的重写规则,只想绕过index.html。
我的文件index.html是正确的主机,并返回给我良好的文件结果:
我不明白为什么如果我试图改变DirectoryIndex,仍然调用app.php (我默认的php路由):
DirectoryIndex index.html
是因为重写规则吗?或者我的主人忽略了DirectoryIndex?我的网站是由OVH在托管的。
这是我的.htaccess ( symfony的原版.htaccess )
预先感谢您的帮助
# Use the front controller as i
是否可以在发生404事件时更改.htaccess中的DirectoryIndex?我有一个场景,如果有一个404,我希望将DirectoryIndex更改为index.htm而不是index.php。但是,默认情况下,我必须在.htaccess中声明DirectoryIndex,所以我要寻找类似于if else语句的语句。
if 404
then DirectoryIndex=index.htm
else
then DirectoryIndex=index.php
这个是可能的吗?谢谢。
Oracle Linux 7.3 (RHEL衍生产品)
Apache 2.4.6
我正在/srv/www中为yum、脚本和kickstart文件设置一个存储库,通过httpd提供服务。我想要一个自动索引,这样我就没有index.html了.这是这个内部服务器唯一要做的事。所以,httpd.conf:
DocumentRoot "/srv/www"
<Directory "/srv/www">
AllowOverride all
Options Indexes FollowSymLinks
Require all gran
在中,我有以下内容:
AliasMatch "^/projects/(.+)" "/var/www/domain.name/$1/public"
它应该只匹配像../projects/project1这样的URL,而不是只匹配../projects/本身。
当我说,http://example.org/projects/project1/返回一个403 Forbidden.The日志,因为:
No matching DirectoryIndex found, and server-generated directory index forbidden by Op
我的托管公司最近将我从Apache 1升级到Apache 2,我开始看到一些与我的mod_rewrite完全不同的行为。
这是我的.htaccess文件:
DirectoryIndex blog.html
# Various rewrite rules.
<IfModule mod_rewrite.c>
RewriteEngine on
# Rewrite current-style URLs of the form 'showpage.php?url=x'.
RewriteRule ^(.*\.html)$ showpage.php?url=$1
部署到生产环境是失败的,我看到一个空白页,没有登录到app/ log /prod.log。
我预热了prod缓存,并将cahce目录的所有权授予www-data,也没有php日志记录,但这可能是管理错误,我要求检查它,因为我没有访问它的权限。
我将htaccess更改为省略app_dev.php,并考虑app.php,这是我的.htaccess:
# Use the front controller as index file. It serves as fallback solution when
# every other rewrite/redirect fails (e.g. in a
我试过其他的帖子,但它们不是为我工作的。
我正在使用Apache 2.4。
当ErrorDocument收到一个403错误时,我会尝试加载它,但是由于某种原因,它不会加载页面,只会给出一个不同的错误。
site.com/folder:
Forbidden
You don't have permission to access this resource.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
site
我编写了一个脚本来检查最后10分钟的httpd错误日志,但是我得到了一个错误,它保持循环:问题是,在日志文件结束之前,脚本的输出是一个错误循环,我试着通过运行cmd date -- date =‘-10 min获得日期- 10分钟,然后逐行解析日志文件,然后检查日志文件中的每一行是否大于或等于日期的小时和分钟--这里的10分钟是输出的一部分:
./test2.sh: line 26: [: -ge: unary operator expected
./test2.sh: line 26: [Mon: command not found
./test2.sh: line 26: [: -ge:
我想试验一下布局,看看什么行得通,什么不管用。我不想对所有的流量都这么做,以防有什么东西不起作用。为此,我想将部分流量重定向到一个单独的文件。我想用.htaccess来做这件事。我的第一次尝试是重定向IP地址以1或2结尾的人,以获得新的布局。我想动态地设置DirectoryIndex来完成这个任务。
这就是我所拥有的:
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
#split 20% of the traffic to go to the alternative layout
RewriteCond %{REMOTE_ADDR