2010年12月3日金曜日

media wiki install in Ubuntu Desktop

英語の読める人は、ここを参考にすればよい

http://www.mediawiki.org/wiki/Manual:Installing_MediaWiki_on_Ubuntu_via_GUI_and_Synaptic

以下のMediaWikiのインストール方法は、Ubuntu Karmic (9.10)用に作成されていいるそうだ。
この時の、UbuntuのSynapticに入っているバージョンは MediaWiki 1.15. だったそうだ。

ちなみに僕がインストールした時はこんな感じ。
MediaWiki 1.15.1
Ubuntu 10.10 (wubi経由)
PHP 5.3.2-1ubuntu4.5 installed
Connected to mysql 5.1.41-3ubuntu12.7; enabling MySQL 4.1/5.0 charset mode

サーバー版へのインストール方を知りたい人は、こっちをよんでくれ。

んじゃ、インストールを始めよう。

1. メニュー:システム/システム管理/Synaptic パッケージ・マネージャー(もちろん自分の(sudoの)パスワードを入れて入る)
2. mediawiki と mysql-admin を検索してチェックを入れてくれ(Apache & PHP はmediawiki に入っているから気にするな)
3. 適用をクリック
4. MySQLがrootパスワードを求めてきたら入れてやってくれ

[edit] Set URL alias of MediaWiki and server name for Apache

This section assumes you want your wiki's URL to be http://localhost/mediawiki. If this is not what you want, change "localhost" to your preferred server name and "mediawiki" to your preferred URL alias in the following instructions.

First we have to set the server name for your new Apache server.

1. アプリケーション/アクセサリ/端末 を開いて次のコマンドを入れてくれ:

gksudo gedit /etc/apache2/httpd.conf
オマセチャンはgedit を gvim か emacs にすると楽しいぞ。(楽しくなかった奴は身の程を知れ)

gksudo を使う理由:GUI に対する sudo
http://www.psychocats.net/ubuntu/graphicalsudo
http://wat-ubuntu-game.blogspot.com/2010/08/guigksudo.html

2. どうだ頭が真っ白になったか?大丈夫。元々何にも入ってない。次の文字(スクリプト)を入力してくれ:

ServerName localhost
localhost の所は、omaehaahoka でも何でもいいぞ。俺はそんなの知らんから、以下のlocalhostの所を自分で書き換えといてくれ。

3. もちろん、記録してから閉ろよな。

(more here)

Next you have to set the URL alias of the MediaWiki installation.

1. Menu: Applications → Accessories → Terminal
2. Run the following command to open Apache configuration file:

gksudo gedit /etc/mediawiki/apache.conf

3. Remove the '#' on the third line so that line reads:

Alias /mediawiki /var/lib/mediawiki

(You can replace /mediawiki with any alias you want, such as /mywiki)
[edit] Restart Apache service

Apache has to be restarted to read the changed configuration files.

Run in Terminal:

sudo /etc/init.d/apache2 restart

そしたらこんな事言い返してくるので、華麗にスルーしてくれ
* Restarting web server apache2 ... waiting [ OK ]

Or from Gnome Desktop GUI:

1. Menu: System → Administration → Services
2. Uncheck and re-check the checkbox next to Web server (Apache2)

Configure your wiki

1. Open web browser and navigate to: http://localhost/mediawiki (if you changed the server name or URL alias in previous section, change the URL accordingly)
2. Click "set up the wiki" link.
3. For "Wiki name", you can choose any name (but not "MediaWiki") unless this installation is for a pre-existing MediaWiki instance, in which case use the same 'Wiki name' as the previous installation.
4. "Contact e-mail", "Language", "Copyright/license", "Admin username" can be left unchanged.
5. You will have to enter a password for the wiki administrator (default username 'WikiSysop'), and enter it again to confirm.
6. "Shared memory cacheing", "Memcached servers": leave unchanged.
7. "E-mail features (global)" - set to "Disabled" unless you plan to use MediaWiki's e-mail features.
8. "User-to-user e-mail", "E-mail notification about changes", "E-mail address authentication", "Database type", "Database host": leave unchanged.
9. "Database name", "DB username": leave unchanged to allow MediaWiki to create a user for accessing the wiki database, unless you have already used MySQL Administrator to create a database and user for MediaWiki.
10. "DB password", "DB password confirm": Enter password for the wiki database user twice. Warning: This password will be stored in plain text in LocalSettings.php!
11. To let MediaWiki create the wiki database and database user, click the "Use superuser account" checkbox and enter the MySQL superuser name and password.
12. Click 'Install MediaWiki!' button.

Move LocalSettings.php
Run in Terminal:
sudo mv /var/lib/mediawiki/config/LocalSettings.php /etc/mediawiki/


math パッケージがインストールできていないらしい。
Synaptic から後付けでmediawiki-mathをインストールした。

インストールした後で、LocalSettings.php(デフォルトでは/etc/mediawiki)でインラインのLaTeX数式を有効にします:

$wgUseTeX = true;

詳しくはここ

もう一度
localhost/mediawiki
に行くと、自動的にメインページに転送される。