特殊:Badtitle/NS100:MediaWiki:修订间差异
小无编辑摘要 |
小无编辑摘要 |
||
第1行: | 第1行: | ||
{{From|https://help.ubuntu.com/community/MediaWiki}} | {{From|https://help.ubuntu.com/community/MediaWiki}} | ||
{{Languages|UbuntuHelp:MediaWiki}} | {{Languages|UbuntuHelp:MediaWiki}} | ||
MediaWiki is the engine that is used for Wikipedia | MediaWiki is the engine that is used for Wikipedia. See [http://www.mediawiki.org/ MediaWiki] for more information. | ||
=== Install === | === Install pre-requisites === | ||
The easiest method is to first install a full LAMP (Linux, Apache2, MySQL, PHP) server: | |||
sudo | <pre><nowiki> | ||
sudo tasksel install lamp-server | |||
</nowiki></pre> | </nowiki></pre> | ||
Make sure you record your MySQL root superuser name and superuser password that you will create at installation. You will need it later. | |||
sudo nano /etc/ | (Each of the components (Apache2, MySQL5, and PHP) can also be installed individually, if you wish.) | ||
=== Install MediaWiki === | |||
Install the package: | |||
<pre><nowiki> | |||
sudo apt-get install mediawiki | |||
</nowiki></pre> | |||
Optionally install add-ons: | |||
<pre><nowiki> | |||
sudo apt-get install imagemagick mediawiki-math php5-gd | |||
</nowiki></pre> | |||
Enable MediaWiki by editing the following file and remove the '#' from the third line so that it reads 'Alias /mediawiki /var/lib/mediawiki': <pre><nowiki> | |||
sudo nano /etc/mediawiki/apache.conf | |||
</nowiki></pre> | </nowiki></pre> | ||
Then restart apache: <pre><nowiki> | Then restart apache: <pre><nowiki> | ||
sudo /etc/init.d/apache2 restart | sudo /etc/init.d/apache2 restart | ||
</nowiki></pre> | </nowiki></pre> | ||
==== Start your MediaWiki ==== | |||
http://localhost/mediawiki | |||
Follow the setup instructions. | |||
==== Start Mediawiki from a remote location ==== | |||
This method regards starting your website from a remote location. Since you will be entering passwords, you don't want to make an unsecured connection. Either set up a ssl server] ( see [[UbuntuHelp:forum/server/apache2/SSL|forum/server/apache2/SSL]]) and connect with https://yoursite.example.com/mediawiki, or visit from the server itself (using [[UbuntuHelp:elinks|elinks]] or lynx, two excellent text-based web browsers): <pre><nowiki> | |||
elinks localhost/mediawiki | elinks localhost/mediawiki | ||
</nowiki></pre> | </nowiki></pre> | ||
You could also use ssh to port forward your http traffic from your local machine to the remote server. ssh -C -L 9999:localhost:80 [email protected], edit your /etc/hosts to point the webserver's name to your localhost, then open a web browser to the config page: http://wiki.skippybob.com:9999/config. More detailed instructions [[UbuntuHelp: http://technonick.livejournal.com/96173.html | here. ]] | |||
fill out the forms, noting that the final form is NOT your root or user password, but the password for the root mysql account (blank by default) | fill out the forms, noting that the final form is NOT your root or user password, but the password for the root mysql account (blank by default) | ||
Lastly, move the config files as requested to prevent anyone else from changing these settings: | Lastly, move the config files as requested to prevent anyone else from changing these settings: | ||
第25行: | 第42行: | ||
You are done! you should see a wiki page at: http://yoursite.example.com/mediawiki | You are done! you should see a wiki page at: http://yoursite.example.com/mediawiki | ||
=== Customize === | === Customize === | ||
You might want to customize the look of your wiki. | You might want to customize the look of your wiki. | ||
To change the icon make a 135x135 pixel logo in PNG format and move it to the right place: <pre><nowiki> | To change the icon make a 135x135 pixel logo in PNG format and move it to the right place: <pre><nowiki> | ||
sudo cp my_new_logo.png /var/lib/mediawiki/skins/common/images/wiki.png | sudo cp my_new_logo.png /var/lib/mediawiki/skins/common/images/wiki.png | ||
</nowiki></pre> | </nowiki></pre> | ||
To get rid of the | To get rid of the default sunburst logo in the background, edit /var/lib/mediawiki/skins/monobook/main.css and change: | ||
background: #f9f9f9 url(headbg.jpg) 0 0 no-repeat; | background: #f9f9f9 url(headbg.jpg) 0 0 no-repeat; | ||
to | to | ||
background: #f9f9f9; | background: #f9f9f9; | ||
=== Email Support === | |||
MediaWiki can be configured to send email messages for various functions. You will need to install some additional packages: | |||
<pre><nowiki> | |||
sudo apt-get install php-pear | |||
sudo pear install mail | |||
sudo pear install Net_SMTP | |||
</nowiki></pre> | |||
Also, you'll need to configure the <code><nowiki>LocalSettings.php</nowiki></code> file to use your SMTP server to send out the messages, for example: | |||
<pre><nowiki> | |||
$wgEnableEmail = true; | |||
$wgEnableUserEmail = true; | |||
$wgEmergencyContact = "[email protected]"; | |||
$wgPasswordSender = "[email protected]"; | |||
$wgNoReplyAddress = "[email protected]"; | |||
$wgPasswordSender = "[email protected]"; | |||
$wgSMTP = array( | |||
'host' => "ssl://smtp.gmail.com", | |||
'IDhost' => "gmail.com", | |||
'port' => 465, | |||
'auth' => true, | |||
'username' => "[email protected]", | |||
'password' => "user_password" | |||
); | |||
</nowiki></pre> | |||
=== Extensions === | === Extensions === | ||
Mediawiki extensions are stored in the /etc/mediawiki-extensions/extensions-available folder. You can enable an extension using | Mediawiki extensions are stored in the /etc/mediawiki-extensions/extensions-available folder. You can enable an extension using | ||
第43行: | 第85行: | ||
==== More ==== | ==== More ==== | ||
It is possible to run multiple parallel instances of Mediawiki on a single server: | It is possible to run multiple parallel instances of Mediawiki on a single server: | ||
* http://www.jirp.nl/2008/ | * http://www.jirp.nl/2008/07/27/mediawiki-farm-administer-multiple-wiki-environments/ | ||
* [http://ubuntuguide.org/wiki/MediaWiki_tips] -- Ubuntuguide.org MediaWiki Tips | |||
=== See also === | === See also === | ||
* [http://www.mediawiki.org/wiki/Manual:Running_MediaWiki_on_Ubuntu] | * [http://www.mediawiki.org/wiki/Manual:Running_MediaWiki_on_Ubuntu] | ||
* [http://wiki.debian.org/MediaWiki] | |||
[[category:UbuntuHelp]] | [[category:UbuntuHelp]] |
2009年11月17日 (二) 19:55的版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/MediaWiki }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/af | • {{#if: UbuntuHelp:MediaWiki|Afrikaans| [[::MediaWiki/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/ar | • {{#if: UbuntuHelp:MediaWiki|العربية| [[::MediaWiki/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/az | • {{#if: UbuntuHelp:MediaWiki|azərbaycanca| [[::MediaWiki/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/bcc | • {{#if: UbuntuHelp:MediaWiki|جهلسری بلوچی| [[::MediaWiki/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/bg | • {{#if: UbuntuHelp:MediaWiki|български| [[::MediaWiki/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/br | • {{#if: UbuntuHelp:MediaWiki|brezhoneg| [[::MediaWiki/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/ca | • {{#if: UbuntuHelp:MediaWiki|català| [[::MediaWiki/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/cs | • {{#if: UbuntuHelp:MediaWiki|čeština| [[::MediaWiki/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/de | • {{#if: UbuntuHelp:MediaWiki|Deutsch| [[::MediaWiki/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/el | • {{#if: UbuntuHelp:MediaWiki|Ελληνικά| [[::MediaWiki/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/es | • {{#if: UbuntuHelp:MediaWiki|español| [[::MediaWiki/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/fa | • {{#if: UbuntuHelp:MediaWiki|فارسی| [[::MediaWiki/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/fi | • {{#if: UbuntuHelp:MediaWiki|suomi| [[::MediaWiki/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/fr | • {{#if: UbuntuHelp:MediaWiki|français| [[::MediaWiki/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/gu | • {{#if: UbuntuHelp:MediaWiki|ગુજરાતી| [[::MediaWiki/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/he | • {{#if: UbuntuHelp:MediaWiki|עברית| [[::MediaWiki/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/hu | • {{#if: UbuntuHelp:MediaWiki|magyar| [[::MediaWiki/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/id | • {{#if: UbuntuHelp:MediaWiki|Bahasa Indonesia| [[::MediaWiki/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/it | • {{#if: UbuntuHelp:MediaWiki|italiano| [[::MediaWiki/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/ja | • {{#if: UbuntuHelp:MediaWiki|日本語| [[::MediaWiki/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/ko | • {{#if: UbuntuHelp:MediaWiki|한국어| [[::MediaWiki/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/ksh | • {{#if: UbuntuHelp:MediaWiki|Ripoarisch| [[::MediaWiki/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/mr | • {{#if: UbuntuHelp:MediaWiki|मराठी| [[::MediaWiki/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/ms | • {{#if: UbuntuHelp:MediaWiki|Bahasa Melayu| [[::MediaWiki/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/nl | • {{#if: UbuntuHelp:MediaWiki|Nederlands| [[::MediaWiki/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/no | • {{#if: UbuntuHelp:MediaWiki|norsk| [[::MediaWiki/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/oc | • {{#if: UbuntuHelp:MediaWiki|occitan| [[::MediaWiki/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/pl | • {{#if: UbuntuHelp:MediaWiki|polski| [[::MediaWiki/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/pt | • {{#if: UbuntuHelp:MediaWiki|português| [[::MediaWiki/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/ro | • {{#if: UbuntuHelp:MediaWiki|română| [[::MediaWiki/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/ru | • {{#if: UbuntuHelp:MediaWiki|русский| [[::MediaWiki/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/si | • {{#if: UbuntuHelp:MediaWiki|සිංහල| [[::MediaWiki/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/sq | • {{#if: UbuntuHelp:MediaWiki|shqip| [[::MediaWiki/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/sr | • {{#if: UbuntuHelp:MediaWiki|српски / srpski| [[::MediaWiki/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/sv | • {{#if: UbuntuHelp:MediaWiki|svenska| [[::MediaWiki/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/th | • {{#if: UbuntuHelp:MediaWiki|ไทย| [[::MediaWiki/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/tr | • {{#if: UbuntuHelp:MediaWiki|Türkçe| [[::MediaWiki/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/vi | • {{#if: UbuntuHelp:MediaWiki|Tiếng Việt| [[::MediaWiki/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/yue | • {{#if: UbuntuHelp:MediaWiki|粵語| [[::MediaWiki/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/zh | • {{#if: UbuntuHelp:MediaWiki|中文| [[::MediaWiki/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/zh-hans | • {{#if: UbuntuHelp:MediaWiki|中文(简体)| [[::MediaWiki/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MediaWiki | UbuntuHelp:MediaWiki | {{#if: | :}}MediaWiki}}/zh-hant | • {{#if: UbuntuHelp:MediaWiki|中文(繁體)| [[::MediaWiki/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:MediaWiki|:MediaWiki|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :MediaWiki/zh | | {{#ifexist: MediaWiki/zh | | {{#ifeq: {{#titleparts:MediaWiki|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:MediaWiki|1|-1|}} | zh | | }}
MediaWiki is the engine that is used for Wikipedia. See MediaWiki for more information.
Install pre-requisites
The easiest method is to first install a full LAMP (Linux, Apache2, MySQL, PHP) server:
sudo tasksel install lamp-server
Make sure you record your MySQL root superuser name and superuser password that you will create at installation. You will need it later. (Each of the components (Apache2, MySQL5, and PHP) can also be installed individually, if you wish.)
Install MediaWiki
Install the package:
sudo apt-get install mediawiki
Optionally install add-ons:
sudo apt-get install imagemagick mediawiki-math php5-gd
Enable MediaWiki by editing the following file and remove the '#' from the third line so that it reads 'Alias /mediawiki /var/lib/mediawiki':
sudo nano /etc/mediawiki/apache.conf
Then restart apache:
sudo /etc/init.d/apache2 restart
Start your MediaWiki
http://localhost/mediawiki Follow the setup instructions.
Start Mediawiki from a remote location
This method regards starting your website from a remote location. Since you will be entering passwords, you don't want to make an unsecured connection. Either set up a ssl server] ( see forum/server/apache2/SSL) and connect with https://yoursite.example.com/mediawiki, or visit from the server itself (using elinks or lynx, two excellent text-based web browsers):
elinks localhost/mediawiki
You could also use ssh to port forward your http traffic from your local machine to the remote server. ssh -C -L 9999:localhost:80 [email protected], edit your /etc/hosts to point the webserver's name to your localhost, then open a web browser to the config page: http://wiki.skippybob.com:9999/config. More detailed instructions here. fill out the forms, noting that the final form is NOT your root or user password, but the password for the root mysql account (blank by default) Lastly, move the config files as requested to prevent anyone else from changing these settings: NOTE: Check the output in your web browser: if its instructions differ from below, follow them.
sudo mv /var/lib/mediawiki/config/LocalSettings.php /etc/mediawiki/LocalSettings.php sudo chmod 600 /etc/mediawiki/LocalSettings.php sudo rm -Rf /var/lib/mediawiki/config
You are done! you should see a wiki page at: http://yoursite.example.com/mediawiki
Customize
You might want to customize the look of your wiki.
To change the icon make a 135x135 pixel logo in PNG format and move it to the right place:
sudo cp my_new_logo.png /var/lib/mediawiki/skins/common/images/wiki.png
To get rid of the default sunburst logo in the background, edit /var/lib/mediawiki/skins/monobook/main.css and change: background: #f9f9f9 url(headbg.jpg) 0 0 no-repeat; to background: #f9f9f9;
Email Support
MediaWiki can be configured to send email messages for various functions. You will need to install some additional packages:
sudo apt-get install php-pear sudo pear install mail sudo pear install Net_SMTP
Also, you'll need to configure the LocalSettings.php
file to use your SMTP server to send out the messages, for example:
$wgEnableEmail = true; $wgEnableUserEmail = true; $wgEmergencyContact = "[email protected]"; $wgPasswordSender = "[email protected]"; $wgNoReplyAddress = "[email protected]"; $wgPasswordSender = "[email protected]"; $wgSMTP = array( 'host' => "ssl://smtp.gmail.com", 'IDhost' => "gmail.com", 'port' => 465, 'auth' => true, 'username' => "[email protected]", 'password' => "user_password" );
Extensions
Mediawiki extensions are stored in the /etc/mediawiki-extensions/extensions-available folder. You can enable an extension using
sudo mwenext <extension.php>
Tab/autocomplete shows a list of extensions. Similarly use mwdisext to disable an extension.
More
It is possible to run multiple parallel instances of Mediawiki on a single server:
- http://www.jirp.nl/2008/07/27/mediawiki-farm-administer-multiple-wiki-environments/
- [1] -- Ubuntuguide.org MediaWiki Tips