Vagrant 如何确保使用SALT资源调配启用mod_rewrite

Vagrant 如何确保使用SALT资源调配启用mod_rewrite,vagrant,provisioning,salt-stack,Vagrant,Provisioning,Salt Stack,我正在使用食盐供应来创建我的流浪者箱 在我的apache2.sls中 apache2: pkg: - installed service: - running 如何确保已启用mod_rewrite 非常感谢您的宝贵时间。如果您只是想启用mod_rewrite,请尝试以下操作: sudo a2enmod rewrite: cmd.run: - unless: test -f /etc/apache2/mods-enabled/rewrite.load

我正在使用食盐供应来创建我的流浪者箱

在我的apache2.sls中

apache2:
  pkg:
    - installed
  service:
    - running
如何确保已启用mod_rewrite


非常感谢您的宝贵时间。

如果您只是想启用mod_rewrite,请尝试以下操作:

sudo a2enmod rewrite:
  cmd.run:
    - unless: test -f /etc/apache2/mods-enabled/rewrite.load
    - require:
      - pkg: apache2

apache2:
  pkg.installed:
    - name: apache2
  service.running:
    - name: apache2
    - require:
      - pkg: apache2
    - watch:
      - cmd: sudo a2enmod rewrite
这应该安装软件包,然后运行脚本(因为服务需要cmd和pkg),然后在脚本运行后,它将监视重新启动服务。如果这对你不起作用,欢迎加入我们的#salt irc,我们会解决它的