If you haven't already done so, first, open your text editor and create a file named .htaccess.
Add the following lines into the .htaccess file where MYFILE.html is the name of the file you want to protect and APPNAME is the name of your app.
<Files MYFILE.html> AuthType Basic AuthName "Authentication Required" AuthUserFile /srv/users/SYSUSER/apps/APPNAME/public/.htpasswd Require valid-user </Files>
Next, SSH in to your server as the the system user the app belongs to. Run the following command to create your .htpasswd file, replacing APPNAME with the name of your app.)
Now, use the htpasswd-sp command to add or change a password for a user yourname. (You can substitute any username for yourname).
htpasswd-sp ~/apps/APPNAME/public/.htpasswd yourname
Follow the prompts in the command line to add the new password.
When you visit the file through your browser, you'll now be prompted for a username and password.