Basic Authentication is provided by auth plugin. In order to protect your virtual hosts you have to do the following steps:
- Enable Auth plugin: make sure the auth plugin is enabled in the /etc/monkey/plugins.load configuration file
- Create the users list file: # /usr/sbin/mkpasswd -c -b /etc/monkey/plugins/auth/users.mk myuser mypassword
- Edit your virtual host file and set the authentication rules, e.g: edit /etc/monkey/sites/default and append:
[AUTH] Location / Title "Let's protect our content..." Users /etc/monkey/plugins/auth/users.mk
Now restart Monkey and reload your web page, you will get the authentication box for the specific virtual host. If you add/delete users you will need to restart the service to make the changes take effect, we are working in a smart way to fix this behavior without affect performance or extra I/O.