Configure the HTTPD

To configure the HTTPD, follow the steps below:

  1. Create an admin user password.

    Use the following command to configure /opt/bweb/etc/htpasswd.bweb - create a password for the user: admin:

    [root@nasabacula etc]#  htpasswd -c /opt/bweb/etc/htpasswd.bweb admin
    New password:
    Re-type new password:
    Adding password for user admin
    
  2. Configure Lighttpd configuration.

    # vi /opt/bweb/etc/httpd.conf
    ...
    server.modules += ( "mod_auth") # if not already done
    auth.backend = "htpasswd"
    auth.backend.htpasswd.userfile = "/opt/bweb/etc/htpasswd.bweb"
    auth.require = ( "/" =>
    (
    "method" => "basic",
    "realm" => "Password protected area",
    "require" => "valid-user"
    )
    )
    
  3. Restart Bweb and check if it runs.

    [root@nasabacula etc]# service bweb restart
    Redirecting to /bin/systemctl restart bweb.service
    
    [root@nasabacula etc]# service bweb status
    
    Redirecting to /bin/systemctl status bweb.service
    * bweb.service - Bacula Enterprise Bweb
    Loaded: loaded (/usr/lib/systemd/system/bweb.service; enabled; vendor preset: disabled)
    Active: active (running) since Fri 2020-10-30 13:31:59 WET; 3s ago
    Process: 12826 ExecStart=/usr/sbin/lighttpd -f /opt/bweb/etc/httpd.conf (code=exited, status=0/SUCCESS)
    Main PID: 12828 (lighttpd)
    Tasks: 1 (limit: 49777)
    Memory: 800.0K
    CGroup: /system.slice/bweb.service
    └─12828 /usr/sbin/lighttpd -f /opt/bweb/etc/httpd.conf
    
    out 30 13:31:59 nasabacula systemd[1]: Stopped Bacula Enterprise Bweb.
    out 30 13:31:59 nasabacula systemd[1]: Starting Bacula Enterprise Bweb...
    out 30 13:31:59 nasabacula lighttpd[12826]: 2020-10-30 13:31:59: (server.c.1521) server started (lighttpd/1.4.54)
    out 30 13:31:59 nasabacula systemd[1]: Started Bacula Enterprise Bweb.
    
  4. Log in to Bweb.

    ../../../../_images/loginbweb01.png
  5. Click Bweb –> Main –> Configuration –> Configure BWeb.

    ../../../../_images/bwebconfig01.png
  6. Choose the following options.

    ../../../../_images/bwebconfig02.png
  7. Log out and log in again as admin user.

    ../../../../_images/bwebconfig03.png
  8. Check if “User Management” button appears.

    ../../../../_images/manageusersbutton.png
  9. Add a new User.

  10. Set administrator permissions.

../../../../_images/adminpermissions.png
  1. Log out and log in with the other administrator user.

Note

Remember to create an htpasswd password for this user.

# htpasswd /opt/bweb/etc/htpasswd.bweb pedro
New password:
Re-type new password:
Updating password for user pedro

Important

To test the login and logout, you need to refresh the page or clean cache files.

Possible Next Step

LDAP/Active Directory - Authentication