Rabu, 31 Desember 2008

Tambahkan favicon.ico

Dengan cara yang hampir sama menambah logo, berikut adalah cara menambah favicon.ico. Buat gambar favicon.ico-nya dulu dengan ukuran 32 x 32 piksel atau 16 x 16 piksel. Bisa dibuat menggunakan pengolah gambar GIMP.

Lalu salin ke direktori (direktori sistem operasi) /var/lib/mediawiki/skins/common/images/favicon.ico

Tambahkan baris berikut pada berkas /etc/mediawiki/LocalSettings.php

$wgFavicon = "/wiki/skins/common/images/favicon.ico";

Grr Ganti Logo Mediawiki

Grr... akhirnya bisa juga. Setelah kutak-katik, akhirnya aku bisa juga ganti logo mediawiki. Sederhana harusnya. Cuma jadi rumit saat konsep path bercampur baur dengan konfigurasi dan direktori di sistem operasi

Berikut konfigurasi /etc/apache2/sites-available/wiki
# more /etc/apache2/sites-available/wiki

ServerAdmin za@design.paume.itb.ac.id
ServerName ***.****.itb.ac.id
DocumentRoot /var/lib/mediawiki

ErrorLog /var/log/apache2/error-wiki.log
LogLevel warn
CustomLog /var/log/apache2/access-wiki.log common

ServerSignature Off


Lalu petunjuk pencerahan saya dapat saat membaca cuplikan log
# vim /var/log/access-wiki.log
...
*** - - [24/Dec/2008:02:20:54 -0600] "GET /wiki/skins/monobook/bullet.gif HTTP/1.1" 304 -
*** - - [24/Dec/2008:02:20:54 -0600] "GET /wiki/skins/common/images/poweredby_mediawiki_88x31.png HTTP/1.1" 304 -
*** - - [24/Dec/2008:02:20:54 -0600] "GET /wiki/skins/monobook/user.gif HTTP/1.1" 304 -
...


Ternyata direktori /wiki masih diperlukan sebagai path untuk memanggil gambar. Logo baru yang ingin saya masukkan, saya salin ke (ini path sistem operasi) /var/lib/mediawiki/skins/common/images/logo.png

Lalu tambahkan baris berikut pada /etc/mediawiki/LocalSettings.php

...
$wgLogo = "/wiki/skins/common/images/logo.png"
...


Taraaa!!!!

Senin, 22 Desember 2008

Install MediaWiki

Hari ini saya eksperimen install mediawiki. Awalnya saya install dengan database postgresql. Namun gagal. Akhirnya, saya gunakan mysql. Di bawah ini adalah catatan-catatan kegagalan saat instalasi sebagai bahan pelajaran dan dokumentasi.

Gagal pertama
Checking environment...

Please include all of the lines below when reporting installation problems.

* PHP 5.2.6-5 installed
* Found database drivers for: PostgreSQL
* PHP server API is apache2handler; ok, using pretty URLs (index.php/Page_Title)
* Have XML / Latin1-UTF-8 conversion support.
* Session save path (/var/lib/php5) appears to be valid.
* PHP's memory_limit is 128M.
* Couldn't find Turck MMCache, eAccelerator, APC or XCache; cannot use these for object caching.
* Found GNU diff3: /usr/bin/diff3.
* Found ImageMagick: /usr/bin/convert; image thumbnailing will be enabled if you enable uploads.
* Installation directory: /var/lib/mediawiki
* Script URI path: /mediawiki
* Installing MediaWiki with php file extensions
* Environment checked. You can install MediaWiki.
*

Generating configuration file...

Notice: Constant MW_INSTALL_PATH already defined in /var/lib/mediawiki/config/index.php(717) : eval()'d code on line 16
* Database type: PostgreSQL
* Loading class: DatabasePostgres
* Attempting to connect to database "postgres" as superuser "root"...
* Checking the version of Postgres...version 8.3 is OK.
* User "wikiuser" already exists, skipping account creation.
* Database "wikidb" already exists, skipping database creation.
* Connecting to "wikidb" as superuser "root" to check rights...OK
* Creating schema mediawiki ...
Warning: pg_query() [function.pg-query]: Query failed: ERROR: permission denied for database wikidb in /usr/share/mediawiki/includes/DatabasePostgres.php on line 591
FAILED.


Gagal kedua
Checking environment...

Please include all of the lines below when reporting installation problems.

* PHP 5.2.6-5 installed
* Found database drivers for: PostgreSQL
* PHP server API is apache2handler; ok, using pretty URLs (index.php/Page_Title)
* Have XML / Latin1-UTF-8 conversion support.
* Session save path (/var/lib/php5) appears to be valid.
* PHP's memory_limit is 128M.
* Couldn't find Turck MMCache, eAccelerator, APC or XCache; cannot use these for object caching.
* Found GNU diff3: /usr/bin/diff3.
* Found ImageMagick: /usr/bin/convert; image thumbnailing will be enabled if you enable uploads.
* Installation directory: /var/lib/mediawiki
* Script URI path: /mediawiki
* Installing MediaWiki with php file extensions
* Environment checked. You can install MediaWiki.
*

Generating configuration file...

Notice: Constant MW_INSTALL_PATH already defined in /var/lib/mediawiki/config/index.php(717) : eval()'d code on line 16
* Database type: PostgreSQL
* Loading class: DatabasePostgres
* Attempting to connect to database "postgres" as superuser "postgres"...
* Checking the version of Postgres...version 8.3 is OK.
* User "wikidb" already exists, skipping account creation.
* Creating database wikiuser...OK
* Connecting to "wikiuser" as superuser "postgres" to check rights...OK
* Creating schema mediawiki ...OK
* Checking for Pl/Pgsql ...not installed. Attempting to install Pl/Pgsql ...OK
* Attempting to connect to database "wikiuser" as "wikidb"... error: No database connection
* Checking the version of Postgres...
Warning: pg_query(): supplied argument is not a valid PostgreSQL link resource in /usr/share/mediawiki/includes/DatabasePostgres.php on line 591

Warning: pg_fetch_result(): supplied argument is not a valid PostgreSQL result resource in /usr/share/mediawiki/includes/DatabasePostgres.php on line 1027
Could not determine the numeric version from !


Yang ini yang berhasil

media wiki mysql berhasil

MediaWiki 1.12.0 Installation

* Don't forget security updates! Keep an eye on the low-traffic release announcements mailing list.

Checking environment...

Please include all of the lines below when reporting installation problems.

* PHP 5.2.6-5 installed
* Found database drivers for: MySQL PostgreSQL
* PHP server API is apache2handler; ok, using pretty URLs (index.php/Page_Title)
* Have XML / Latin1-UTF-8 conversion support.
* Session save path (/var/lib/php5) appears to be valid.
* PHP's memory_limit is 128M.
* Couldn't find Turck MMCache, eAccelerator, APC or XCache; cannot use these for object caching.
* Found GNU diff3: /usr/bin/diff3.
* Found ImageMagick: /usr/bin/convert; image thumbnailing will be enabled if you enable uploads.
* Found GD graphics library built-in.
* Installation directory: /var/lib/mediawiki
* Script URI path: /mediawiki
* Installing MediaWiki with php file extensions
* Environment checked. You can install MediaWiki.
*

Generating configuration file...

Notice: Constant MW_INSTALL_PATH already defined in /var/lib/mediawiki/config/index.php(717) : eval()'d code on line 16
* Database type: MySQL
* Loading class: DatabaseMysql
* Attempting to connect to database server as root...success.
* Connected to 5.0.51a-19
* Attempting to create database...
* Created database wikidb
* Creating tables... done.
* Initializing statistics...
* Granting user permissions to wikiuser on wikidb...success.
* Created sysop account WikiSysop.
*

Creating LocalSettings.php...

Installation successful! Move /var/lib/mediawiki/config/LocalSettings.php to /etc/mediawiki, then follow this link to your wiki.

You should change file permissions for LocalSettings.php as required to prevent other users on the server reading passwords and altering configuration data.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. or read it online

* MediaWiki home
* Readme
* Release notes
* Documentation
* User's Guide
* FAQ

MediaWiki is Copyright © 2001-2008 by Magnus Manske, Brion Vibber, Lee Daniel Crocker, Tim Starling, Erik Möller, Gabriel Wicke and others.

Reset Password MySQL

Terlalu banyak password memang membingungkan. Saat diminta untuk memasukkan password lagi (untuk database, misalnya), maka seringnya saya akan lupa.

Untung menemukan tautan ini.

Belajar PostgreSQL

Ini tautan bagus.

Kamis, 11 Desember 2008

Belajar Awk

Saya ingin mengambil angka hasil melakukan ping. Untuk itu saya perlu melakukan parsing dari hasil yang muncul.

Melakukan ping 5 kali
$ ping -c 5 localhost
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.092 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.071 ms
64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.069 ms
64 bytes from localhost (127.0.0.1): icmp_seq=4 ttl=64 time=0.067 ms
64 bytes from localhost (127.0.0.1): icmp_seq=5 ttl=64 time=0.060 ms

Lalu saya ambil urutan (urutan ke-6) berikut response time (urutan ke-8)
$ ping -c 5 localhost | awk '{print $6 " " $8}'
of
icmp_seq=1 time=0.070
icmp_seq=2 time=0.089
icmp_seq=3 time=0.085
icmp_seq=4 time=0.064
icmp_seq=5 time=0.090


0% loss,

Dilanjutkan lagi, ambil angkanya saja
$ ....