Question
I am trying to set up Apache authentication for one of my TWiki installs. I have the .htaccess file, and the .htpasswd files set up. I have made the changes to the .htaccess file to point the various variables to the correct directories. The authentication settings from /bin/configure are set to Apache authentication.
When I try to view a page, I get the following error in the Apache error log:
/var/www/twikis/usims/bin/.htaccess: Invalid command '{DataDir}', perhaps mis-spelled or defined by a module not included in the server configuration
I have tried removing the braces and placing a percent (%) in front of the braces but that only changes the error.
I figure I am missing something rather simple here.
Any ideas?
Environment
--
ShawnDevlin - 04 Mar 2006
Answer
If you answer a question - or have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list below the edit box.
The
.htaccess file is an Apache configuration file, whereas you seem to feed it a TWiki configuration.
Usually you run
bin/configure from your Browser to set TWiki's directories (like
$cfg{DataDir}), which writes the paths to
lib/LocalSite.cfg.
In
.htaccess, all you need to point to is your
.htpasswd file, like:
<Directory "whereever/you/installed/bin">
AuthType Basic
AuthName "Authenticated TWiki"
AuthUserFile /home/haj/public_html/htpasswd.twiki
<Files viewauth>
Require valid-user
</Files>
<Files edit>
Require valid-user
</Files>
...etc
</Directory>
You usually define the
.htaccess file for both TWiki and Apache so that while Apache is using it for authentication, TWiki allows changing password from a web interface.
--
HaraldJoerg - 05 Mar 2006