« Police Squad! GTA4 Edition | Home | Crime is Out of Control!!! »

Individual Entry With Comments


June 8, 2008

Password Protecting A Blog

Filed under Blogging

image I did some digging over the past week to figure out how to password protect a section of my blog.

My blog is hosted with an Apache server.

I read this article about how Apache supports access control of files on a server.

There are two parts:

  1. An .htaccess file that contains all the settings for access control. This file also points to a password file.
  2. A password file

The .htaccess file impacts everything at the same level as .htaccess and below. The documentation page for .htaccess is here.

A sample .htaccess file looks like this:

AuthType Basic
AuthName "Password Required"
AuthUserFile /www/passwords/password.file
AuthGroupFile /www/passwords/group.file
Require Group admins

I found that I had to start .htaccess with "<Files DIRNAME>" and end with "</Files>" in order to make it work for me...not sure why. I only learned about this after I called my hosting company (1&1) for help. It may be particular 1&1.

Then I had to create a password file (password.file in the above example).

This page explains how to set up a password file with the command "htpasswd."

I used PuTTY to login to the server and vi to edit the .htaccess file.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)


About

This page contains a single entry from the blog posted on June 8, 2008 10:23 AM.

The previous post in this blog was Police Squad! GTA4 Edition.

The next post in this blog is Crime is Out of Control!!!.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.34