首页 文章

无效的命令'RewriteEngine'但启用了mod_rewrite

提问于
浏览
2

我正在 Build 一个gitlab网站conf file

但是这个错误出现了:

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'

1 回答

  • 0

    我使用Vagrant设置VM时遇到同样的问题 .
    我终于通过在Vagrantfile配置中为客户端设置ip来解决这个问题:

    config.vm.network :private_network, ip: "192.168.68.8"
    

    然后添加到本地/ etc / hosts文件:

    192.168.68.8    namespace.dev
    

相关问题