On 6/16/05, Brion Vibber <brion(a)pobox.com> wrote:
Rick DeNatale wrote:
<Directory /var/www/html/w>
AllowOverride FileInfo Options
php_flag register_globals off
</Directory>
Alias /wiki/skins "/var/www/html/w/skins"
Alias /wiki "/var/www/html/w"
The alias for /wiki/skins is redundant, as it's already covered by the
alias for /wiki.
You're right. Here's how I got there. I started with the two Aliases
in the quoted article, which has the second as"
Alias /wiki /var/www/html/w/index.php
The problem is that, because I'm stuck for the moment on RH9 and can't
update PHP I have to use rewrite which was already working, the urls
were getting rewritten as .../index.php/index.php I found that
changing the second alias fixed that.
$IP = "/var/www/html/w";
#without the following line script links come out as /wiki
$wgScriptPath = "/w";
$wgScript = "{$wgScriptPath}/index.php";
$wgRedirectScript = "{$wgScriptPath}/redirect.php";
Looks like standard config so far...
#$wgStylePath =
"{$wgScriptPath}/skins";
#Basing style on script hides skins???
$wgStylePath = "/wiki/skins";
I'm not sure I understand why this bit is done.
Because DefaultSettings.php says that If $wgScriptPath is localized
then anything based on it has to be localized. So I used grep to find
out all of the references to $wgScriptPath in DefaultSettings and
copied those to LocalSettings so that they would be based on the new
setting of $wgScriptPath set in LocalSettings after the include of
DefaultSettings. I did the transitive closure of this operation which
picked up a few more variables.
As I tried to explain in the comment, If I follow this pattern and set
$wgStylePath = "{$wgScriptPath}/skins"
where $wgScriptPath = "/w" for some reason, Apache doesn't seem to
serve up the css files, so I end up with no tabs, sidebar etc.
Not sure why, but that's what happens.
## If using PHP as a CGI module, use the ugly
URLs
#$wgArticlePath = "$wgScript/$1";
#$wgArticlePath = "$wgScript?title=$1";
$wgArticlePath = "/wiki/$1";
Unless you've made some other configuration on the web server, this
would appear to break all article URLs, because they'd be aliased to
files as /var/www/html/w/$1.
As I said I'm using rewrite, which was already working, here are the
rewrite rules, right now these are in /var/www/html/w/.htaccess:
--------
RewriteEngine on
# Don't rewrite requests for files in MediaWiki subdirectories,
# MediaWiki PHP files, HTTP error documents, favicon.ico, or robots.txt
RewriteCond %{REQUEST_URI} !^/wiki/(stylesheets|images|skins)/
RewriteCond %{REQUEST_URI} !^/wiki/(redirect|texvc|index).php
RewriteCond %{REQUEST_URI} !^/error/(40(1|3|4)|500).html
RewriteCond %{REQUEST_URI} !^/favicon.ico
RewriteCond %{REQUEST_URI} !^/robots.txt
# Rewrite any article as wiki/index.php/article and stop
RewriteRule ^(.*)$ /wiki/index.php?title=$1 [L,QSA]
-------
I've also got a rewrite rule in a virtual server directive to rewrite null uris
RewriteRule ^/$ "/var/www/html/w/"
I have to admit that I don't understand just how this works but it
does, it worked before the other changes, except tht the w was wiki.
This seems to be working, I can get articles I just can't get images
#Default has $wgUploadPath =
"{$wgScriptPath}/upload";
#But there is no upload directory and this seems to control where the
#Image object looks so.
$wgUploadPath = "{$wgScriptPath}/images";
#Ditto for $wgUploadDirectory DefaultSettings.php had this as "{$IP}/uploads"
$wgUploadDirectory = "{$IP}/images";
$wgMathPath = "{$wgUploadPath}/math";
$wgLogo = "$wgStylePath/common/images/merclogo.png";
Before I changed $wgUploadPath and $wgUploadDirectory i was getting
missingimage messages, I temporarily modified Skin.php to print the
imagePath instead of just the name and it seemed to be correct and the
files themselves existed. After the change I just get the alt text
and no images.
I'm not sure I understand what you changed it from or to. What did your
LocalSettings.php contain before this? If you used a standard
configuration it should have looked like:
$wgUploadPath = "$wgScriptPath/images";
$wgUploadDirectory = "$IP/images";
which appears to be exactly equivalent to what you changed it _to_. So
what was it before, and why was it different?
That is what it was before. Here's a diff of LocalSettings.php
between what it is now and a backup from last night
[rick@frodo rick]$ diff /var/www/html/w/LocalSettings.php
/snapshot/daily.1/var/www/html/wiki/LocalSettings.php
7c7
< $IP = "/var/www/html/w";
---
$IP = "/var/www/html/wiki";
25,31c25,27
< $wgScriptPath = "/w";
< $wgScript = "{$wgScriptPath}/index.php";
< $wgRedirectScript = "{$wgScriptPath}/redirect.php";
< #$wgStylePath = "{$wgScriptPath}/skins";
< #Basing style on script hides skins???
< $wgStylePath = "/wiki/skins";
< $wgStyleSheetPath = &$wgStylePath;
---
$wgScriptPath = "/wiki";
$wgScript = "$wgScriptPath/index.php";
$wgRedirectScript = "$wgScriptPath/redirect.php";
36,46c32,34
< $wgArticlePath = "/wiki/$1";
< $wgUploadPath = "{$wgScriptPath}/upload";
< #But there is no upload directory and this seems to control where the
< #Image object looks so.
< #$wgUploadPath = "{$wgScriptPath}/images";
< #Ditto for $wgUploadDirectory DefaultSettings.php had this as
"{$IP}/uploads"
< $wgUploadDirectory = "{$IP}/images";
<
< $wgMathPath = "{$wgUploadPath}/math";
<
<
---
$wgArticlePath = "$wgScriptPath/$1";
$wgStylePath = "$wgScriptPath/skins";
$wgStyleDirectory = "$IP/skins";
48a37,38
$wgUploadPath =
"$wgScriptPath/images";
$wgUploadDirectory = "$IP/images";
131c121
< "/var/www/html/w/extensions/SpamBlacklist/wikimedia_blacklist",
// Wikimedia's list
---
"/var/www/html/wiki/extensions/SpamBlacklist/wikimedia_blacklist", //
Wikimedia's list
Any help appreciated.