Domas, can you write up the manual install instructions? I'd like to try adding support to the installer but I'm pretty fuzzy on what needs to be done first.
Hey, the master document is still at http://ph3.defau.lt/index.php?title=PostgreSQL_Install
-- Domas ---------------------------------------cut here---------------------------------------------------------------------------------
Hereby I, humble developer of mediawiki, try to document the HEAD install process on my FreeBSD/PostgreSQL box.
Files are taken from my dev cf.net CVS account,
cvs co phase3 mv phase3 pgwiki.defau.lt
What I try to do next is creating database and users.
* Database and users should not be created before * I should be able to supply admin credentials
$ psql -U superuser template1 Welcome to psql 7.4.1, the PostgreSQL interactive terminal. ... template1=# CREATE USER mediawikiadmin PASSWORD 'someadminpassword'; CREATE USER template1=# CREATE USER mediawikiuser PASSWORD 'someuserpassword'; CREATE USER template1=# CREATE DATABASE mediawiki WITH OWNER=mediawikiadmin ENCODING='UNICODE'; CREATE DATABASE ...
Then I have to load the database schema as mediawikiadmin:
$ psql -U mediawikiadmin mediawiki < maintenance/postgresql/pg_tables.sql
There are two meanings of schemas in PG, one as, well, database structure. Another is a logical domain for grouping same kinds of objects. In order to allow many MW instances with shared or not-so-shared tables I made that logical domain by default called "mediawiki", but changable by $wgDBschema. Some additional modules (like search) might use other schemas. That's nice for not mixing everything up.
Command names and some notices on implicit indexes would be provided.
Then, if it is desired to use lower-security user (the mediawikiuser), we should grant him access as in maintenance/postgresql/pg_users.sql (there we have {$wgDBuser}):
$ psql -U mediawikiadmin -h dammit.lt mediawiki mediawiki=> set search_path=mediawiki,public; SET mediawiki=> GRANT SELECT,INSERT,UPDATE,DELETE ON mediawiki-> archive,brokenlinks,categorylinks,cur, mediawiki-> cur_cur_id_seq,"group",hitcounter,image,imagelinks, mediawiki-> interwiki,ipblocks,ipblocks_ipb_id_seq,links, mediawiki-> linkscc,"logging",math,objectcache,"old",old_old_id_seq, mediawiki-> oldimage,profiling,querycache,recentchanges, mediawiki-> recentchanges_rc_id_seq,searchindex,site_stats, mediawiki-> site_stats_ss_row_id_seq,"user",user_groups,user_newtalk, mediawiki-> user_rights,user_user_id_seq,validate,watchlist mediawiki-> TO mediawikiuser; GRANT
As database is prepared, here we might need to load some initial data. I do set up AdminSettings.php:
$wgDBadminuser='mediawikiadmin'; $wgDBadminpassword='someadminpassword';
I take a reference LocalSettings.php from another site and start walking through it:
$IP = "/home/midom/www/pgwiki.defau.lt";
PG!
$wgDBtype = "PostgreSQL"; $wgDBserver = "localhost"; $wgDBname = "mediawiki"; $wgDBuser = "mediawikiuser"; $wgDBpassword = "someuserpassword"; # There's a simple bug to fix, but this is required now: $wgPutIPinRC=true;
As I am not a liar:
$wgDBmysql4 = false;
I've got to load initial group data as well, I've got to change `->" from group and load the data into correct schema:
SET search_path=mediawiki,public; INSERT INTO "group" (group_id,group_name,group_description,group_rights) VALUES (1,'Anonymous','Anonymous users','read,edit,createaccount'); INSERT INTO "group" (group_id,group_name,group_description,group_rights) VALUES (2,'Loggedin','General logged in users','read,edit,move,upload'); INSERT INTO "group" (group_id,group_name,group_description,group_rights) VALUES (3,'Sysops','Operators of this site', 'read,edit,move,delete,undelete,protect,block,upload,asksql,rollback,patrol,editinterface,sysop'); INSERT INTO "group" (group_id,group_name,group_description,group_rights) VALUES (4,'Bureaucrat','The bureaucrat group is able to make sysops for example. They have no other rights.', 'read,edit,move,delete,undelete,protect,block,userrights,createaccount,upload,asksql,rollback,patrol,editinterface,siteadmin,sysop');
Mhm, it could load some defaults in case it does not find default groups... That's for owner of Hashar's cat :)
Ah, and next thing is of course - message loading.
$ php rebuildMessages.php --rebuild Initialising "MediaWiki" namespace... Clearing message cache...Done.
Ah, right, search. This is a bit trickier. You've got to have PostgreSQL contrib installed. There you've got /usr/local/share/postgresql/contrib/tsearch2.sql file. You should edit one of first lines in this file from
-- Adjust this setting to control where the objects get CREATEd. SET search_path = public;
to
-- Adjust this setting to control where the objects get CREATEd. SET search_path = tsearch;
This code uses external functions for your PG, therefore, you must be a PG superuser to do this. You should create schema tsearch as user mediawikiadmin, and then load the tsearch schema from pg contrib.
Moreover, as database superuser you'll have to make this:
GRANT ALL ON TABLE pg_ts_cfg,pg_ts_cfgmap,pg_ts_dict,pg_ts_parser to mediawikiadmin; GRANT SELECT ON TABLE pg_ts_cfg,pg_ts_cfgmap,pg_ts_dict,pg_ts_parser to mediawikiuser;
Then again, as mediawikiadmin:
SET search_path=mediawiki,tsearch,public; CREATE TABLE searchindex ( si_page integer PRIMARY KEY, si_title tsvector, si_text tsvector );
CREATE INDEX si_text_idx ON searchindex USING gist (si_text); CREATE INDEX si_title_idx ON searchindex USING gist (si_title); GRANT USAGE ON SCHEMA tsearch to mediawikiuser; GRANT INSERT,UPDATE,SELECT,DELETE ON searchindex to mediawikiuser;
Search is working. Or should be. The wiki - as well.
wikitech-l@lists.wikimedia.org