If you want to limit access to one of your apps, you can place password protection on it using a .htaccess file.

First, open your text editor and create a file named .htaccess that contains the following (where APPNAME is the name of your app):

AuthType Basic
AuthName "Authentication Required"
AuthUserFile /srv/users/sellcloud/apps/APPNAME/public/.htpasswd
Require valid-user

Place that file in your app's public folder.

Next, SSH in to your server as the sellcloud user (or the system user the app belongs to). Run the following command to create your .htpasswd file. (Remember to replace APPNAME with the actual name of your app.)

touch ~/apps/APPNAME/public/.htpasswd

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 app through your browser, you’ll now be prompted for a username and password.
cyberduck

Protecting a Subdirectory

You can also use these same steps to limit access to a subdirectory of your app.

Create a .htaccess file that contains the following (where DIRECTORY is the name of your subdirectory):

AuthType Basic
AuthName "Authentication Required"
AuthUserFile /srv/users/sellcloud/apps/APPNAME/public/DIRECTORY/.htpasswd
Require valid-user

Place that file that directory's folder.

SSH in to your server as the sellcloud user. Run the following command to create your .htpasswd file. (Remember to replace DIRECTORY with the actual name of your subdirectory.)

touch ~/apps/APPNAME/public/DIRECTORY/.htpasswd

Then, 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/DIRECTORY/.htpasswd yourname

Follow the prompts in the command line to add the new password.

When you visit the subdirectory through your browser, you’ll now be prompted for a username and password.

Alert: For Control Panel Help & Tutorials, click here: Panel Tutorials
Was this answer helpful? 0 Users Found This Useful (0 Votes)