[Discuss] Having trouble browsing a backed-up MediaWiki (PHP) site.

Alan W. Irwin irwin at beluga.phys.uvic.ca
Tue Sep 26 19:04:01 PDT 2006


Thanks for the discussion so far from Deryk and Lionel. Note, at the end I
have most of the problem solved, but there is still one question to be
resolved. More below where I respond to both Deryk's and Lionel's
remarks....Alan

On 2006-09-26 15:11-0700 Deryk Barker wrote:

> Alan W. Irwin wrote:
>> [...]When I browse the localhost URL above corresponding to the downloaded 
>> file,
>> I simply get a view of the source code for the page, and it is not 
>> rendered.
>> How can I fix that?

> Do you have the Apache PHP module enabled? (Assuming you're running Apache)
>
> I have both php4.conf and php4.load in the /etc/apache2/mods-available and 
> mods-enabled directories.
>
> I also have (in /etc/apache2/apache2.conf) the line:
>
>   DirectoryIndex index.html index.cgi index.pl index.php index.xhtml
>
> I don't recall if there's anything else you need - it's been a while since I 
> set it up.

For what it is worth, I do run apache2, and I do have everything you
mentioned above, but now that I have thought a bit more about it, I think
php is irrelevant to this issue (except that it may be messing me up, see
the remarks at the end).  Here is the reasoning:

The source (originally generated by php, but now only a file) is simply a
file on the local directory which is just an html file with a peculiar name.
In fact, to confirm that mental model I looked through the file for anything
related to php and there was nothing.  Also, I did a symlink;

irwin at chickadee> ls -l index.html
lrwxrwxrwx  1 irwin irwin 25 Sep 26 13:25 index.html ->
index.php?title=Main_Page

and my browser can view that index.html symlink as the URL

http://localhost/~irwin/plplot_wiki/index.html

without any problems, but that still leaves the issue of all the other local
index.php?title* files that particular file links to.

BTW, on the browser side of things I have tried setting up a mime type for
*.php* to match index.php?title=Main_Page and many other files like it, but
konqueror (at least) doesn't appear to pay attention to wild cards on
extensions.

My last apache configuration experience was many years ago, but following what
is done in /etc/apache2/mods-enabled/userdir.conf and also generalizing the
DefaultType text/plain in /etc/apache2/apache2.conf

I put the following stanza in the (otherwise empty) /etc/apache2/httpd.conf

UserDir public_html
UserDir disabled root

<Directory /home/irwin/public_html/plplot_wiki>
   DefaultType text/html
   AllowOverride FileInfo AuthConfig Limit
   Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
</Directory>

Note the text/html type which did seem to work; after restarting apache, all
the files in /home/irwin/public_html/plplot_wiki were rendered properly by
my browser as html which answers my question above.

So almost done, but there is one final question; how can I get local links
done with href to work to file names with a question mark in the file name?
(I worked around the issue by hand-editing the location bar URL to replace
the question mark in all local URLS by %3F, but that is tiresome.)

And now what Lionel said becomes important:

> 1) these pages are preprocessed so ALL the internal references are broken.

Actually, that is not correct.  wget is pretty smart about that now and
re-references all internal links if you use the --convert-links option
(which I did).

> 2) Apache will use mimetypes to determine from the file extension that these
> pages are "what"

> PATH=~irwin/plplot_wiki
> FILE=index.php
> QUERY=title=Main_Page

I think this is the source of the final difficulty with the question marks
in the file name.  It is just a file with a peculiar name so apache should
simply deliver the contents of the file with the requested peculiar name

e.g.,

PATH=~irwin/plplot_wiki
FILE=index.php?QUERY=title=Main_Page
QUERY=

and mark it as text/html (that part done above).  Instead, probably because
I have php enabled (automatically due to some software on my system that
requires it), it is interpreting that file name as a php request, and
looking for the file index.php in ~irwin/plplot_wiki which of course does
not exist.  How do I turn off the php interpretation of the file name for
all files in /home/irwin/public_html/plplot_wiki ?  Is there some apache
directive I can add to the above /etc/apache2/httpd.conf stanza to force
no interpretation of file names?

Thanks in advance to anybody who can answer that question.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the Yorick front-end to PLplot (yplot.sf.net); the
Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the Discuss mailing list