User:Ursdestiny/installing Wikipedia on Server 2003
I am posting a tutorial for installing Wikipedia on Server 2003 using wamp and mediwiki for lan access.
I hope its useful.
==
== Wikipedia Installation == ==
[edit]1. Install Wamp (Windows-apache-MySql-PHP) server
2. Create a DB user on MySql
a. Go to PHPMyAdmin b. Click privileges c. Add a new user i. Username: wikiuser ii. Host: Localhost iii. Password: xxxxxx iv. Generate password: click the generate button v. Global privileges: All unchecked d. Click Go e. On confirmation page click edit the user to for the section “Database-Specific privileges” f. Set Dropdown to “ Use text field” g. Enter “wikidb” and click Go h. Check all and click Go
Install Mediawiki
[edit]1. Unpack the mediawiki to a new folder (wiki) created in the www in the Wamp folder
2. Type: http://localhost/wiki in your browser and you reach “setup the wiki first” page
3. Follow the link and you will get a “Site Config.” page
a. Wiki Name: Wikipedia b. Password: xxxxxx c. Database Host: localhost d. Database Name: wikidb e. DB username: wikiuser f. DB password: same password used when creating MySql user
4. Leave the rest default and click install mediawiki.
5. Go to- wamp root\www\wiki\config\ and copy LocalSettings.php to wamp root\www\wiki\
== Download and Install dumps of Wikipedia ==
1. Download the latest Wikipedia dumps from Wikimedia website
2. Extract the file
3. Download XML2SQL
4. Run XML2SQL giving the extracted file with following options:
a. Output format – mysqlimport b. Option Full revision
5. Go to MySql console and type source filename.sql for both pages and text files
6. For importing revision table run the following sql command:
a. Alter table Revision Drop Column rev_len, drop column rev_parent_id; b. Source revision.sql; c. Alter table revision Add column rev_len INT (10) UNSIGNED DEFAULT NULL AFTER rev_deleted, Add column rev_parent_id INT (10) UNSIGNED DEFAULT NULL AFTER rev_len;
7. In cmd type: (path)\Php.exe (path-maintenance folder of wiki)\ rebuild.php
== Tweaking Wiki ==
1. Get the following file cite.php and Parser Function.php
2. Add the two lines to LocalSettings.php
Require_once (“$IP/extensions/parserfunctions/ParserFunction.php”); Require_once (“$IP/extensions/cite/cite.php”); The setup is now complete but the search is slow.
Installing Sphinx
[edit]1. Extract to a Folder
2. Rename the “sphinx.conf.in” to “sphinx.conf”
3. Set the following code in the file
source src_wiki_main
{
type = mysql
sql_host = localhost
sql_user = wikiuser
sql_pass = xxxxxx
sql_db = wikidb
sql_query_pre = SET NAMES utf8
sql_query = SELECT page_id, page_title, page_namespace, old_id, old_text FROM page, revision, text WHERE rev_id=page_latest AND old_id=rev_text_id sql_attr_uint = page_namespace
sql_attr_uint = old_id
sql_query_info = SELECT page_title, page_namespace FROM page WHERE page_id=$id
}
source src_wiki_incremental : src_wiki_main
{
sql_query = SELECT page_id, page_title, page_namespace, old_id, old_text FROM page, revision, text WHERE rev_id=page_latest AND old_id=rev_text_id AND page_touched>=DATE_FORMAT(CURDATE(), '%Y%m%d070000')
}
index wikipedia
{
source = src_wiki_main
path = C:\Sphinx\data\wikipedia
docinfo = extern
morphology = stem_en
min_word_len = 1
charset_type = utf-8
charset_table = 0..9, A..Z->a..z, _, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F
}
index wiki_incremental : wikipedia
{
path = C:\Sphinx\data\wikipediastemmed
source = src_wiki_incremental
}
indexer
{
mem_limit = 64M
}
searchd
{
#address = 127.0.0.1
port = 3312
log = C:\Sphinx\data\log\searchd.log
query_log = C:\Sphinx\data\log\query.log
read_timeout = 5
max_children = 30
pid_file = C:\Sphinx\data\log\searchd.pid
max_matches = 1000
}
4. Go to Command prompt and set sphinx as the working directory
5. Run the command: bin/indexer –-config sphinx.conf
6. Wait
7. After indexing has completed Run the command: bin/searchd –install –-config sphinx.conf