Quantcast
Viewing all articles
Browse latest Browse all 11

Answer by Mohammad for Password protect a specific URL

  1. First of all, you need to create a new user/password:

This command:

htpasswd -c /etc/apache2/.htpasswd myuser1

If you are using Bitnami Apps (Open edx, for example), you need follow this instruction:

htpasswd -c /opt/bitnami/apps/edx/conf/.htpasswd myuser1
  1. Then if you have defined a virtual host, you need to add the following lines to your apache config file.

This config:

<VirtualHost *:80>...<Location />    Deny from all    #Allow from (Set IP to allow access without password)    AuthUserFile /etc/apache2/.htpasswd    AuthName "Restricted Area"    AuthType Basic    Satisfy Any    require valid-user</Location>...</VirtualHost>
  1. In the case of Bitnami Apps, you need to add these configs inside ‘/opt/bitnami/apps/edx/conf/httpd-lms.conf’:

This config to protect all URLs.:

<Location />    Deny from all    #Allow from (Set IP to allow access without password)    AuthUserFile /opt/bitnami/apps/edx/conf/.htpasswd    AuthName "Restricted Area"    AuthType Basic    Satisfy Any    require valid-user</Location>
  1. Finally, you need to restart the Apache server.

In Bitnami Apps:

/opt/bitnami/ctlscript.sh restart apache

Viewing all articles
Browse latest Browse all 11

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>