O'Reilly logo

Salt Cookbook by Anirban Saha

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Web server security with htpasswd

After the server has been configured and services have been started, the next step is to implement security for the server to perform access control. In this recipe, we will learn how to configure security for the Apache web server using Salt.

How to do it...

We will use the same minion as in the previous recipe.

  1. Edit /opt/salt-cookbook/development/apache/init.sls to have the following entries:
    apache_packages: pkg.installed: - pkgs: - apache2 - apache2-utils enable_rewrite_module: apache_module.enable: - name: rewrite - require: - pkg: apache_packages /etc/apache2/sites-enabled/salt-cookbook.conf: apache.configfile: - config: - VirtualHost: this: '*:80' ServerName: - salt-cookbook.com ServerAlias: - www.salt-cookbook.com ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required