User:Kingboyk/Sandbox

From mediawiki.org
<s>Install ImageMagick</s>
Install fastCGI
Install PHP5 with mysql, mysqli, gd extensions (maybe should have installed PEAR? - need mail and 
net_smtp if wiki is to send email!)
Add C:\PHP to your path. From the Start menu, right click My Computer and select Properties. From the 
Advanced tab click the Environment Variables button. Under System Variable find Path and click Edit. At 
the end of what is already present in Variable Value add a semicolon (;) and then C:\PHP.

Make sure GD is enabled in php.ini

[To create a script map for FastCGI handler on IIS 6.0 follow these steps:

   1. Launch inetmgr.exe.
   2. Double click the machine icon for the local computer.
   3. Right click on "Web Sites" and pick "Properties."
   4. Click the tab labeled "Home Directory."
   5. Click the "Configuration…" button.
   6. Click the "Add…" button.
   7. Browse to %WINDIR%\system32\inetsrv\ to select fcgiext.dll as the Executable. 

Note: If you are setting this up on 64bit platform in WOW mode, then you must use fcgiext.dll located in 
%WINDIR%\SysWOW64\inetsrv

    8.  Enter .php as the Extension 
    9.  Enter Verbs as GET,HEAD,POST 
    10  Ensure that "Script Engine" and "Verify that file exists" are checked.

%windir%\system32\inetsrv\fcgiext.ini should have the php block] --- 64 bit approach didn't work on our 64 bit Srv2003

# In explorer create folders C:\PHP\sessiondata and C:\PHP\uploadtemp
# Select both folders, right click, and choose properties. On the Security tab grant user 
IUSR_<servername> “Modify” rights to both folders
# In Notepad open C:\PHP\php.ini
# Find the line “;cgi.force_redirect = 1” and uncomment it, change the value of “1” to “0”
# Find the line “upload_tmp_dir="C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\php\upload"” and change to 
“upload_tmp_dir="C:\PHP\uploadtemp"”
# Change the next line to read: “session.save_path="C:\php\sessiondata"”
# ** Search PHP.INI for other instances of session.save_path and upload_tmp_dir. Comment them out, if 
found.

Install MySQL

# Extract MediaWiki from its downloaded file and place the entire folder in C:\Inetpub\wwwroot\mediawiki
# Right click on this folder. Add IUSR_<servername> to the permissions list with "Read & Execute" 
permissions
# Open IIS Manager
# Stop the Default Website
# Right click on “Web Sites” and choose New, Website
# Call it “MediaWiki”
# Select the path “C:\Inetpub\wwwroot\mediawiki”
# Allow the permissions Read and Execute
# Right click on MediaWiki and choose Properties
# On the Documents tab add “index.php” as the default content page and move to the top of the list
# Save settings and exit IIS Manager
# Enable write permissions on the C:\Inetpub\wwwroot\mediawiki\config folder (at least during the setup 
process). -- gave me trouble, so make it world writable to be sure

Install the asapi rewriter 1.2.12*c* (d didn't work) into a readable folder (must not be within the IIS 
document tree), and add it as an ASAPI filter either for all of IIS or the specific wiki site(s) (in IIS 
Manager). Make sure the log folder is writable by server.
RewriteLog  E:\IsapiRewrite\logs\asapirewrite.log
RewriteLogLevel 3
MaxMatchCount 1
RewriteEngine On

# Change to suit your domain
RewriteCond %{HTTP_HOST} ^wiki.fleetobserver.co.uk

# Checks for local file existance so that .css, .js and other MediaWiki files arent processed
# Replace any non-file, non-directory request before a '?' w/ "index.php"
# (This is to make the Special:Search?search=... requests work)
RewriteCond %{REQUEST_FILENAME} !-f  
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/wiki/.*[?](.*)$ /w/index.php?$1 [I,L]
RewriteCond %{REQUEST_FILENAME} !-f  
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/staff/.*[?](.*)$ /s/index.php?$1 [I,L]

# Everything else (articles) should fall back to this
RewriteCond %{REQUEST_FILENAME} !-f  
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/wiki/(.*)$ /w/index.php?title=$1 [I,L]
RewriteCond %{REQUEST_FILENAME} !-f  
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/wiki$ /w/index.php [I,L]
RewriteCond %{REQUEST_FILENAME} !-f  
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/staff/(.*)$ /s/index.php?title=$1 [I,L]
RewriteCond %{REQUEST_FILENAME} !-f  
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/staff$ /s/index.php [I,L]

IterationLimit 4
Restart site after installing the rewriter
PROBLEM - rdfrom links aren't working; attempting to find out if a rewrite issue or a MW issue


Install Mediawiki into /w/ folder, and call up config page in browser
wikiadmin@fleetobserver.co.uk

Configure localsettings. Make sure pretty URLs are on:
#shorturl support
$wgArticlePath = '/wiki/$1';
$wgScriptPath= '/w';

Staff wiki, with Win Auth:
$wgScriptPath       = '/s';
$wgScriptExtension  = ".php";

#shorturl support
$wgArticlePath = '/staff/$1';

If making multiple wikis, copy or symlink the mediawiki files, copy the wiki database, set up single 
user table ($wgSharedDB) and remove the user table from the other wikis; use php logic to share config

robots.txt
redirect from / to /wiki/Main_Page:
<?php
// Permanent redirection
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.somacon.com/");
exit();
?>

condiguration
extensions

It *might* be possible to have Windows Auth/Active Directory authenticate for the wiki too, but I havent 
done that

Another tip: Ensure you have all of the necessary types configured in MIME settings (IIS server properties). Our wiki was throwing a 404 when we tried to access a .svg file because no MIME type existed.