Enabling basic authentication
- Run the following command:apt -y install apache2-utilsCreate a user account that has access to the server. Enter the following details:htpasswd -c /etc/apache2/.htpasswd <username> New password: Re-type new password: Adding password for user <username>Go to directorycd /etc/apache2/sites-enabled/.Innano openxpki.conf, add the following lines in<VirtualHost *: 443 block>:#HTTPS BASIC AUTH FOR LABELS Location /.well-known/est/*/simpleenroll AuthType Basic AuthName "estrealm" AuthUserFile /etc/apache2/.htpasswd require valid-user </Location> #HTTPS BASIC AUTH FOR NO LABEL <Location /.well-known/est/simpleenroll> AuthType Basic AuthName "estrealm" AuthUserFile /etc/apache2/.htpasswd require valid-user </Location>AddErrorDocument 401 %{unescape:%00}beforeSSLEnginein the same virtual Host block.ExampleServerAlias * DocumentRoot /var/www/ ErrorDocument 401 %{unescape:%00} SSLEngine OnRestart theapache2 serviceusingservice apache2 restart.Basic authentication works using the above user name and password.