How can I enable an Apache module on ddev?

2019-08-05 06:48发布

问题:

I'm using webserver-type: apache-fpm with ddev and need to enable a module. How do I do that?

回答1:

You can use a2enmod in the web container and then apachectl graceful to restart apache to pick up the changes.

So ddev ssh and then a2enmod headers && apache2ctl graceful (if you were enabling the "headers" module)

Using ddev exec: ddev exec "a2enmod headers && apache2ctl graceful"

Using a post-start hook:

hooks:
  post-start:
  - exec: a2enmod headers && apache2ctl graceful


标签: ddev