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

Compare with Current View Page History

« Previous Version 4 Next »

Public Files

Any files that you want visible publicly can be placed on unix under ~/public_html (create the directory if it doesn't exist). This will be visible as a URL like http://www.slac.stanford.edu/~cpo.

Password Protected Files

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>

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

The .htaccess file 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