You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

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

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:

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):

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