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