1 = use config file, 0 = do not look for config
The config file is at $DataDir/config
Used by DoWikiRequest
Thanks,
Jennifer
DUH! Thanks for the quick shakkabukku.
Jennifer
In your Apache configuration file (found at /etc/httpd/httpd.conf on Mac & several unix systems), you need to make sure that the AllowOverride? variable is set to allow the .htaccess file to control your website's access options.
The default setting is to not allow the .htaccess file to control any access options. In the http.conf file, the first Directory configuration ruleset probably looks like this:
# First, we configure the "default" to be a very restrictive set of # permissions. <Directory /> Options FollowSymLinks AllowOverride None </Directory>
The "AllowOverride? None" line causes Apache to ignore the .htaccess file for all sites hosted on your server.
After the first Directory ruleset (pasted above), you should find configuration options for your site. For example, if your website lives in a directory called /www, look for the following line:
<Directory "/www">
This marks the beginning of the set of rules that Apache uses to govern the site found in /www. Be sure that AllowOverride? is set to "Limit" for this directory. My rules are pasted below (minus comments).
<Directory "/www"> Options Indexes FollowSymLinks MultiViews ExecCGI AllowOverride Limit Order allow,deny Allow from all </Directory>
Cool. Now you need to make a .htaccess file in your DataDir. Mine looks like this.
<limit GET> order deny,allow deny from all </limit>
The only thing left to do is restart Apache. You can do this by typing in the following line:
sudo apachectl restart
These instructions assume you are running the Apache webserver on some kind of Unix system. Hope this helps! -raj
I had some trouble with this, too. The docs may have mentioned that I shold put the config file in the data dir, and I'd missed it... anyway, I think it would be good to raise an error if the config file cannot be found--otherwise, there's no way of knowing... Here is a patch to do that:
if ($UseConfig) { if (-f $ConfigFile?) { $ConfigError? = ''; if (!do $ConfigFile?) { # Some error occurred $ConfigError? = $@; if ($ConfigError? eq '') { # Unfortunately, if the last expr returns 0, one will get a false # error above. To remain compatible with existing installs the # wiki must not report an error unless there is error text in $@. # (Errors in "use strict" may not have error text.) # Uncomment the line below if you want to catch use strict errors. #$ConfigError? = T('Unknown Error (no error text)'); } } }
else { require Carp; croak("I could not find config file '$ConfigFile?'"); } }
This is in the DoWikiRequest subroutine. The only thing I'm changing is that in the original, there was one if statement, "if ($UseConfig &&-f $ConfigFile?)"... and I am nesting one condition within another... and in this way allowing for the else statement if it simply cannot be found.