【发布时间】:2016-08-29 04:57:30
【问题描述】:
我正在用这个 conf file 建立一个 gitlab 站点
但是出现了这个错误:
Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
我已经从源代码安装了 apache 2.4.20。忘了我已经用apt-get 安装了2.4.7。现在apache -v 显示2.4.7。
我遵循了很多解决方案,但它们都不起作用:
在 httpd.conf 文件中取消注释 LoadModule rewrite_module modules/mod_rewrite.so 行(从行前删除井号'#')
Apache2 ProxyPass for Rails App Gitlab
我检查了重写模块,它就在那里; a2enmod rewrite 已启用,service apache2 restart 在没有 gitlab.conf 文件的情况下工作。
但是用gitlab.conf,会出现这个错误Invalid command 'RewriteEngine'?
【问题讨论】:
-
条件和规则应该用在
Directory上下文中,而不是VirtualHost上下文中。我从未在Location上下文中尝试过,所以我不知道会产生什么结果。