Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

On one of the SLAC unix machines, create a .htpasswd file that will contain your login names and passwords.

Code Block

cpo@suncatls1 $ cd
cpo@suncatls1 $ htpasswd -c .htpasswd webtest

(use "-c" only for creating your first password)

htpasswd will prompt you (twice) to input the password for the login name "webtest".

Create a subdirectory that you want to protect under ~/public_html. Put two files there:

The .shtaccess should contain:

Code Block

AuthUserFile /afs/slac/u/if/cpo/.htpasswd
AuthName "Enter userid and password"
AuthType Basic

<LIMIT GET>
require user webtest
</LIMIT>

Edit two lines in .shtaccess: location of .htpasswd and the "require user" line with the username

The .htaccess should contain (this does not have to be editted):

Code Block

RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]