1、安裝LAMP
sudo aptitude install apache2
sudo aptitude install mysql-server
sudo aptitude install php5
sudo aptitude install php5-mysql
sudo aptitude install php5-cli
sudo aptitude install libgd2-xpm libgd2-xpm-dev php5-gd
2、配置php、mysql
sudo gedit /etc/php5/apache2/php.ini
upload_max_filesize = 8M
memory_limit = 12M
extension=mysql.so
sudo gedit /etc/mysql/my.cnf
max_allowed_packet = 128M
3、安裝MediaWiki
cd /var/www
sudo wget http://download.wikimedia.org/mediawiki/1.12/mediawiki-1.12.0.tar.gz
sudo tar vxfz mediawiki-1.12.0.tar.gz
sudo mv mediawiki-1.12.0 wiki
cd /var/www/wiki
sudo chmod a+w config
4、配置MediaWiki
去配置:http://localhost/wiki
不要加表前綴
sudo mv config/LocalSettings.php .
sudo rm -rf config
5、下載Znwiki和導入程序
http://download.wikimedia.org/zhwiki/20080407/zhwiki-20080407-pages-articles.xml.bz2
http://download.wikimedia.org/tools/mwdumper.jar
6、清空數據庫,以便導入
mysql -p wikidb
Password: ******
mysql> delete from page;
mysql> delete from revision;
mysql> delete from text;
7、導入
java -jar /home/(你的用戶名)/mwdumper.jar ——format=sql:1.5 /home/(你的用戶名)/zhwiki-20080407-pages-articles.xml.bz2 | mysql -u (表管理員) -p (庫名)
例:
java -jar /home/antares/mwdumper.jar ——format=sql:1.5 /home/antares/zhwiki-20080407-pages-articles.xml.bz2 | mysql -u root -p wikidb