Configure the HTTPD
To configure the HTTPD, follow the steps below:
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
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" ) )
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.
Log in to Bweb.
Click Bweb –> Main –> Configuration –> Configure BWeb.
Choose the following options.
Log out and log in again as admin user.
Check if “User Management” button appears.
Add a new User.
Set administrator permissions.
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.