# enable SSL encryption cat <> ${TARGET}/.htaccess RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} EOF # restrict access cat <> ${TARGET}/.htaccess AuthName "Authorized Users Only." AuthType Basic AuthUserFile /etc/apache2/htpasswd Require user YOUR_USER EOF # create password file touch /etc/apache2/htpasswd htpasswd -b /etc/apache2/htpasswd YOUR_USER YOUR_PASS # restart apache /etc/init.d/apache2 restart