Thursday, September 16, 2010

session for UCSC genomebrowser

i've enabled wiki track with sessions by these steps:
1.
Download and install mediawiki , better in a root subfolder of your mirror

2.
As written in kent/src/hg/wikiMod/README
$IP = MEDIAWIKIINSTDIR
cd kent/src/hg/wikiMod/
cp SpecialUserloginUCSC.php $IP/includes/specials/
cp SpecialUserlogouUCSC.php $IP/includes/specials/
cp configuration.SpecialUserloginUCSC.php $IP/SpecialUserloginUCSC.php
cp configuration.SpecialUserlogoutUCSC.php $IP/SpecialUserlogoutUCSC.php
cp UserloginUCSC.php $IP/includes/templates/

at the end of $IP/LocalSettings.php add these rows :

require_once( "$IP/extensions/SpecialUserloginUCSC.php" );
require_once( "$IP/extensions/SpecialUserlogoutUCSC.php" );
require_once( "$IP/includes/templates/UserloginUCSC.php" )


3.
Check if db "hgcentral" has this table: namedSessionDb.
If not use this sql to create it : CREATE TABLE namedSessionDb (
userName varchar(64) not null, # User name (from genomewiki).
sessionName varchar(255) not null, # Name that user assigns to
this session
contents longblob not null, # CGI string of var=val&... settings.
shared tinyint not null, # 1 if this session may be shared with
other users.
firstUse datetime not null, # Session creation date.
lastUse datetime not null, # Session most-recent-usage date.
useCount int not null, # Number of times this session has been
used.
settings longblob not null, # .ra-formatted metadata
#Indices
PRIMARY KEY(userName,sessionName)
);

3a.
rsync your local goldenPath/html dir with remote
htdocs/goldenPath/html/ dir.


4.
I've installed mediawiki in a subfolder of a root folder. I called it w.
Modify hg.conf adding these rows:
wiki.host=SERVER/w # w is MY installation dir of mediawiki.
wiki.userNameCookie=wikidbUserName ######### use the firebug to get the right name for wikidbUserName wikidbUserID and wikidb_session
wiki.loggedInCookie=wikidbUserID
wiki.sessionCookie=wikidb_session
wikiTrack.URL=http://SERVER/w
wikiTrack.browser=SERVER
wikiTrack.dbList=hg18,mm9,hg19

Note. If you have problem with genome session login, please check with
firefox live_http_header plugin what data is passed after login from
mediawiki. And modify wiki.userNameCookie or wiki.loggedInCookie or
wiki.sessionCookie values.

#LDAP AUTH To use ldap authentication with mediawiki download
LdapAuthentication extension from here:
cd MEDIAWIKIINSTDIR/extensions/
wget -v
http://upload.wikimedia.org/ext-dist/LdapAuthentication-trunk-r65285.tar.gz
tar xvzf LdapAuthentication-trunk-r65285.tar.gz

cd MEDIAWIKIINSTDIR

modify LocalSettings.php adding these rows (at the bottom! ) :

#enable LDAP require_once(
"$IP/extensions/LdapAuthentication/LdapAuthentication.php" );
$wgAuth = new LdapAuthenticationPlugin();

#$wgLDAPDebug = 3; //to enable ldap debug

$wgLDAPDomainNames = array( "CAMPUS" );
$wgLDAPServerNames = array( "CAMPUS" => "LDAPSERVER");
$wgLDAPSearchAttributes = array('CAMPUS' => 'uid');
$wgLDAPBaseDNs = array( "CAMPUS"=>"YOUR BASE DN" );
$wgLDAPEncryptionType = array( "CAMPUS" => "tsl" );

Add this row :
$this->mName=strtolower($this->mName);
after row 763 of SpecialUserloginUCSC.php in MEDIAWIKIDIR/includes/special/
#END LDAP AUTH

No comments: