Install
mod_ssl on your Apache webserver. Configure the directory that your script is in to use SSL with the SSLRequireSSL directive. Here is a sample block from my server:
<Directory "/var/www/perl">
Options FollowSymLinks
AllowOverride All
SSLRequireSSL
Order allow,deny
Allow from all
AuthType Basic
AuthName "Sample encrypted stuff"
AuthUserFile conf/users
Require valid-user
</Directory>
As you can see, I'm using basic (plaintext) authentication using the htpasswd utility and password file. Hope this helps.
-fp