Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a static site.

I would like the simplest approach to password protecting a directory, with a basic admin UI for adding/removing users. I will have so few users that I don't care about performance.

I don't care if it's PHP or Django or whatever, I just want a complete software package.

  • Apache basic auth isn't good, because you can't log out. Nor is there a UI for adding users.

  • I tried throwing everything behind Django auth and serving the files through Django. However, Chrome treats all my text/css headers as text/plain, so I don't get any stylesheets showing.

  • I can't use mod_xsendfile on my server because I can't reconfigure Apache to add new modules. I think this approach is overkill anyway.

  • I can try configuring Nginx's X-Accel-Redirect, however that requires implementing all the Django code for auth myself, and I'd prefer an existing solution. However, this is my backup plan.

Is there a code package that implements authentication with basic admin for a static site?

share|improve this question
    
Have you tried WordPress then adding your pages into the blogging system? – endyourif Sep 24 '12 at 13:46
    
directorypass might be what your looking for. Unfortunately it still uses Apache's basic auth, so no logout. – user555 May 22 '13 at 13:22

Anything you do to handle authentication even if it is a static site will still become somewhat dynamic simply from the need to have a database backend for authentication, which in turn means more than likely the trade-off of using the database to power the page content as well. What would best suit your needs here is a content management system. There are a large number of them out there and the vast majority of them have user authentication built in. This has the advantage of providing a logout experience for the end user as well as being a pre-canned solution that has been tested and undergoes maintenance.

Some of the PHP-based solutions that I can think of would be...

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.