Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Using MediaWiki for browser access to /usr/share/doc

Share your HowTo, Documentation, Tips and Tricks. Not for support questions!.
Post Reply
Message
Author
User avatar
hudson
Posts: 56
Joined: 2015-07-07 17:00

Using MediaWiki for browser access to /usr/share/doc

#1 Post by hudson »

This really helps me out a lot...setting up mediawiki and then accessing /usr/share/doc through a web interface...it is especially convenient to deep link into documentation you use all the time. I'll run through the steps while I install myself from previous notes and hopefully it'll be pretty straightforward.

STEP ONE - INSTALL MEDIAWIKI FROM THE REPOS

Code: Select all

apt-get install mediawiki
...pulls in everything you need...apache, php, etc. You will need to set a password for mysql which you will use later. There are a few config things that need to be done to get mediawiki running. OK, still as root:

STEP TWO - EDIT MEDIAWIKI APACHE CONF

Code: Select all

vi /etc/apache2/conf-available/mediawiki.conf
and uncomment the third line:
Alias /mediawiki /var/lib/mediawiki

STEP THREE - EDIT APACHE CONF

Code: Select all

vi /etc/apache2/apache2.conf
around line 177 add:

Code: Select all

<Directory /var/lib/mediawiki/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>
STEP FOUR - RESTART APACHE

Code: Select all

a2enconf mediawiki; service apache2 restart
if all goes well, mediawiki should be accessible at http://localhost/mediawiki/

STEP FIVE - SET UP MEDIAWIKI

It's pretty straightforward to set up mediawiki. The database is mysql which you installed before. At the end of all the steps, you will be asked to download a file LocalSettings.php ...move this to the mediawiki's directory and chmod as such:

Code: Select all

mv LocalSettings.php /var/lib/mediawiki/
chmod +r /var/lib/mediawiki/LocalSettings.php
STEP SIX - ADD THE WIKIEDITOR EXTENSION

Code: Select all

vi /var/lib/mediawiki/LocalSettings.php
at the bottom add:

Code: Select all

require_once "$IP/extensions/WikiEditor/WikiEditor.php";

# Enables use of WikiEditor by default but still allow users to disable it in preferences
$wgDefaultUserOptions['usebetatoolbar'] = 1;
$wgDefaultUserOptions['usebetatoolbar-cgd'] = 1;

# Displays the Preview and Changes tabs
#$wgDefaultUserOptions['wikieditor-preview'] = 1;

# Displays the Publish and Cancel buttons on the top right side
#$wgDefaultUserOptions['wikieditor-publish'] = 1;
STEP SEVEN - CUSTOM LOGO

once you make a custom logo, copy it with this command:

Code: Select all

cp wiki.png /usr/share/mediawiki/skins/common/images/wiki.png
OK...hope that was easy...next post is accessing /usr/share/doc
Last edited by hudson on 2015-07-17 06:14, edited 1 time in total.

Bulkley
Posts: 6383
Joined: 2006-02-11 18:35
Has thanked: 2 times
Been thanked: 39 times

Re: Install mediawiki for web access to /usr/share/doc

#2 Post by Bulkley »

Sorry, but I'm missing something here. Why do you want Web access to /usr/share/doc? You can use any file manager or browser to view the documentation there. These days, most, if not all, of the documentation is on line as any search will show. The mediawiki site says it is for use on Wikipedia. So, what don't I understand?

User avatar
hudson
Posts: 56
Joined: 2015-07-07 17:00

Re: Install mediawiki for web access to /usr/share/doc

#3 Post by hudson »

STEP EIGHT - ACCESSING LOCAL DOCS

This is fairly easy...create an apache local-doc.conf file:

Code: Select all

vi /etc/apache2/conf-available/local-doc.conf
add the following:

Code: Select all

Alias "/doc/" "/usr/share/doc/"

<Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        IndexOptions FancyIndexing HTMLTable FoldersFirst VersionSort \
                IgnoreCase NameWidth=* SuppressLastModified \
                SuppressDescription SuppressSize \
                SuppressColumnSorting
        AllowOverride None
        Order allow,deny
        Allow from all
</Directory>
and run

Code: Select all

a2enconf local-doc; service apache2 reload
if all goes well, you can now link to your local docs with code like this:

Code: Select all

[http://localhost/doc/debian/FAQ/ Debian FAQ]
well, I must say it is a thing of beauty if you can get it working!! 8)

User avatar
hudson
Posts: 56
Joined: 2015-07-07 17:00

Re: Install mediawiki for web access to /usr/share/doc

#4 Post by hudson »

Bulkley wrote:Sorry, but I'm missing something here. Why do you want Web access to /usr/share/doc? You can use any file manager or browser to view the documentation there. These days, most, if not all, of the documentation is on line as any search will show. The mediawiki site says it is for use on Wikipedia. So, what don't I understand?
Hi Bulkley, sorry...I should of explained a bit more. The idea is to have a wiki as your homepage. A wiki is very easy to edit and allows you to take notes, organize stuff and link to different pages in the docs. Actually, just having a wiki on localhost is a great help.

Then, because it is a wiki, it's super easy to add links to different parts of your docs. It is a major, major hassle, in my mind, to keep opening a file manager to find docs. And it is worse to use a browser...because a browser will load all 1k+ directory links once you open /usr/share/doc/

This way, you can have a main page listing all your different topics, then subpages that link directly into your documentation. For example:

Python
- Library Reference
- Language Reference
- Objects
- Regular expression operations
- Generic Operating System Services
- Programming FAQ

etc...make it as beautiful as ArchWiki if you like. Anyway, it has been very useful for me.

EDIT: changed the title to "for browser access" meaning mediawiki is installed locally and the docs you are viewing are also installed locally (or on the net, if you wish)

User avatar
hudson
Posts: 56
Joined: 2015-07-07 17:00

Re: Using MediaWiki for browser access to /usr/share/doc

#5 Post by hudson »

This is a better example I just threw together.

Document packages

Code: Select all

apt-get install debian-policy debian-handbook xorg-docs
Code for the wiki

Code: Select all

'''Debian'''
{| class="wikitable" style="width: 60%;" border="1"
|-
| [http://localhost/doc/debian-handbook/html/ Debian Handbook]
| [http://localhost/doc/debian/FAQ/ Debian FAQ]
| [http://localhost/doc/debian-policy/policy.html/ Debian Policy]
|-
|}

'''Linux'''
{| class="wikitable" style="width: 20%;" border="1"
|-
| [http://localhost/doc/linux-doc-3.16/html/index.html Linux doc]
|-
|}

'''Fonts'''
{| class="wikitable" style="width: 80%;" border="1"
|-
| [http://localhost/doc/xorg-docs/fonts/fonts.html Fonts in X11R7.7]
| [http://localhost/doc/xorg-docs/xlfd/xlfd.html X Logical Font Description Conventions]
| [http://localhost/doc/fontconfig/fontconfig-user.html Fontconfig]
|-
|}

'''X11'''
{| class="wikitable" style="width: 60%;" border="1"
|-
| [http://localhost/doc//xorg-docs/icccm/icccm.html Inter-Client Communication Conventions Manual]
| [http://localhost/doc/xorg-docs/Xserver/analysis.html Analysis of the X Protocol for Security Concerns]
|-
|}
and screenshot

Image

8)

Post Reply