User login

Apache access control the Agaric way

[Note, this is outdated, now using Kerberos.]

Clients don't like their test site competing with their live, production site for Google results. Therefore, we have put our entire set of test sites behind a pop-up requiring basic Apache authentication.

For ongoing maintenance — adding new people to access the test environment behind the authorization wall — the operative command is:

sudo htpasswd /etc/apache2/passwd/passwords sam

Where sam is replaced with whatever username you want the next user added to have.

The setup instructions follow below.


Roughly following the instructions here:

sudo mkdir /etc/apache2/passwd

sudo htpasswd -c /etc/apache2/passwd/passwords dan
New password:
Re-type new password:
Adding password for user dan

sudo htpasswd /etc/apache2/passwd/passwords benjamin
New password:
Re-type new password:
Adding password for user benjamin

sudo vi /etc/apache2/httpd.conf

<Directory /sites>
  AuthType Basic
  AuthName "Agaric Test Server"
  AuthBasicProvider file
  AuthUserFile /etc/apache2/passwd/passwords
  Require valid-user

sudo /etc/init.d/apache2 reload

You may also find your configuration files in the sites-enabled directory (symlinked from sites-available).

That works for all subdirectories of /sites thankfully

Searched words: 
http authentication require password authentication Apache authorization limiting access to test server control who can view development sites httpd auth


Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.