Solution to the Problem of uploading images through mediawiki

Source: Internet
Author: User
Tags mediawiki

Reprinted from: http://hi.baidu.com/chenshake/blog/item/25d08f4565a9fb3787947399.html

The following figure shows the mediawiki configuration. The version is 1.14. After I get familiar with wiki, I will use wiki to write these documents for convenience.

1: images can be uploaded.

By default, Images cannot be uploaded. You need to modify localsettings. php

81 $ wgenableuploads = false;

Change false to true.

However, when you upload files, you will still be prompted that the upload directory (public) has no permission. How can you set this directory. Different Versions of mediawiki seem to be different. Many documents are different.

79 ## to enable image uploads, make sure the 'images' directory
80 ## is writable, then set this to true:
81 $ wgenableuploads = true;

After reading the annotations, you can simply set the image directory to be readable and written.

Chmod 777 images/

At this time, you can upload attachments.

$ Wguploadpath is no longer available. It should be a version upgrade and canceled.

Set

94 # $ wghasheduploaddirectory = false;

If it is set to true, all your images will be in different directories of the image. Depending on your needs, if you have a lot of images. It is estimated that it must be enabled.

Ii. Anonymous editing not allowed

Edit the defaultsettings. php file.

1168 # $ wggrouppermissions ['*'] ['edit'] = true;
1169 $ wggrouppermissions ['*'] ['edit'] = false;
1170 $ wggrouppermissions ['user'] ['edit'] = true;

3. Close the registration page

$ Wggrouppermissions ['*'] ['createaccount'] = false;
At this time, you cannot register. It should be enough.

Modify short URL

To be honest, I don't know the principles of pseudo-static and rewrite, but I only know the reference documentation. The following process is really stupid, but you can do it.

/Var/www/mediawiki-1.14.0

Originally my directory was a mediawiki-1.14.0, and I changed folder to W in order to do it as an example.

Modify the localsettings. php. file in the/W directory:
$ Wgscriptpath = "/W ";
$ Wgarticlepath = "/wiki/$1 ";
$ Wgusepathinfo = true;

Modify the. htaccess file in the root directory:
Rewriteengine on
Rewriterule ^ wiki/(. *) $/W/index. php? Title = $1 [PT, L, QSA]
Rewriterule ^ wiki/* $/W/index. php [L, QSA]
# Rewriterule ^/* $/W/index. php [L, QSA]

Remarks

Assume that mediawiki is installed in a directory such as/W (the/wiki directory cannot be used; otherwise, conflict occurs)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.