OpenWetWare:Software/Projects/Server Switch

=Move OpenWetWare from Rackspace server www1.OpenWetWare.org to web1.OpenWetWare.org=

Rackspace Contact

 * Bill Flanagan 18:13, 2 October 2007 (EDT) Contact Rackspace re: the possibility of swapping IP addresses between ld and new server.
 * Bill Flanagan 18:13, 2 October 2007 (EDT) Rackspace Reply: They cannot move primary IP addresses between servers.


 * Fallback for switchover
 * Change the DNS config at Rackspace.

Modules to Test/verify

 * Bill Flanagan 18:13, 2 October 2007 (EDT) Compiled list of known items to be changed as part of the move


 * New sudo program: not standard RHEL 4.0 sudo.
 * Perl
 * PHP Pear modules
 * WikiTex
 * ChemTex
 * LaTex
 * Gnu Plot
 * readme file explains details
 * OpenID
 * Install the OpenID package in addition to the MEdiaWiki extension
 * Asterisk

Comments/To Do

 * Create shell script to automate the process
 * Set up a good DNS address to serve as a fallback if there is a migration problem
 * Use OpenWetWare:Feature Test as s smoke test to make sure all modules are working.
 * Setup a wld-card DNS domain to allow for testing of all applications
 * Asterisk is not a priority
 * If the WikiTex estenesion isn't working, don't hold up move
 * Scheduled for Saturday night (10:00 PM EST, Oct 6, 2007)

Installation Checklist
The idea is to have the OpenWetWare customizations separate from the MediaWiki software installation by placing them in two different directories (/data/web/openwetware and /data/web/mediawiki respectively) with appropriate symlinks setup between them. $ sudo mkdir /data/web/mediawiki $ sudo /usr/sbin/groupadd www $ sudo chown -R root:www /data/www/html/openwetware $ sudo chmod -R g+ws /var/www/html/openwetware sudo chown apache ./config sudo mv ./config/LocalSettings.php ./
 * Download the latest version of MediaWiki (downloading via SVN may be easier that using the tar file)
 * Change DocumentRoot in /etc/httpd/conf/httpd.conf to /data/web/mediawiki
 * Create wiki folder in DocumentRoot:
 * Create a group that would have write access to the wiki folder:
 * Change ownership of the folder:
 * Extract mediawiki code into wikifolder or follow SVN instructions
 * Make config folder writeable by the webserver for setup:
 * Create a VirtualHost entry in Apache configuration file (/etc/httpd/conf/httpd.conf)
 * Visit your wiki site/config and answer configuration questions
 * Wiki name
 * License
 * DB user
 * Sysop account name (e.g., Administrator)
 * move LocalSettings.php from config folder to main wiki folder

LocalSettings.php
$wgFileExtensions = array('png','gif','jpg','jpeg','ogg','doc','xls','ppt','sxc','pdf'); $wgStrictFileExtensions = false; $wgUploadSizeWarning = 10485760; #10M $wgDisableUploads = false; $wgUseImageResize = true; $wgUseImageMagick = true; $wgImageMagickConvertCommand = "/usr/bin/convert";  # may need changing: /usr/X11R6/bin/convert $wgUseTeX          = true; $wgMathPath        = "{$wgUploadPath}/math"; $wgMathDirectory   = "{$wgUploadDirectory}/math"; $wgTmpDirectory    = "{$wgUploadDirectory}/tmp"; cd ./math make
 * Add extensions after require_once( "includes/DefaultSettings.php" );
 * Specify access rights (to be added)
 * To allow easier file uploads
 * Warn if uploaded files are larger than this (use this to prevent default warning about uploads larger than 100k)
 * To enable image uploads, make sure the 'images' directory is writable, then uncomment this:
 * Top enable image manipulation:
 * If you have the appropriate support software installed you can enable inline LaTeX equations:
 * To install LaTeX support (OCaml software package required):

Optional
$wgLocalTZoffset = date("Z") / 3600; $wgLogo = "$wgStylePath/common/images/newlogoname.jpg";
 * time zone fix to use local time (if hwtime is set to UTC)
 * custom wiki logo (upload the logo image and provide a path to it here)
 * Copyright info
 * Google search
 * Wikitex

End
php_value engine off AddType text/plain .html .htm .shtml sudo chown -R root:wiki wikifolder sudo chmod -R g+w wikifolder find ./ -type d -exec chmod g+s '{}' \; sudo chown apache:wiki ./LocalSettings.php sudo chmod 460 ./LocalSettings.php sudo chown apache:wiki ./images sudo chmod -R g+w ./images sudo chown root:wiki ./images/.htaccess
 * Disable interpretation of PHP in the upload directory (./images):
 * create .htaccess file and with the following two lines:
 * Set permissions
 * make config file read-only by the webserver, readable and writeable by wiki group and not accessible by anyone else (contains mysql user password)
 * make upload directory writeable by the webserver
 * create/move favicon.ico file in/to the wikifolder
 * add commands to daily backup script to dump the wiki database - IMPORTANT

Server-wide config
(to be done once per site)
 * You may wish to turn register_globals off, because some programs may be insecure using that mode. See http://php.net/register_globals for how to disable it.

File uploading
(maximum file size)

php.ini
(changing this file requires Apache restart) upload_max_filesize = M where  is the limit in MBytes. post_max_size =M

httpd.conf
(/etc/httpd/conf/httpd.conf for Apache2 on Linux) LimitRequestBody 524288 PHPIniDir /usr/local/pkg/php-5.1.2/etc
 * Some versions of Apache2 have an additional limit which is enforced by default for PHP scripts (Content-length limit in Apache2).
 * Sometimes php.ini file is ignored by Apache; workaround in httpd.conf or /etc/httpd/conf.d/php.conf

SpecialImport.php
This MediaWiki file has a hardcoded MAX_FILE_SIZE on the form that you may need to increase manually.

MySQL user privileges

 * SHOW DATABASES, CREATE TEMPORARY TABLES, LOCK TABLES ON *.*
 * SELECT, INSERT, UPDATE, DELETE, DROP, CREATE, ALTER ON 'wikidbname'.*

=Bill Flanagan 16:35, 9 October 2007 (CDT) Update: Server Move Complete. Follow-Up Issues=

Merge log files

 * We've moved the log files to the new (neo) server from the old (old) one.
 * Save the log files to the new HTTPD log file directory
 * Make sure this week is handled appropriately (Saturday/Sunday case in particular)

Further isolate the OpenWetware apps in the /data directory

 * All PHP files will be included in /data

Make sure Rackspace does not interfere with the PHP configuration now working

 * We are not running the 'standard' PHP configuration
 * Talk to them re: how to handle it.
 * Do this before submitting trouble ticket.

Complete documentation of server move in the the wiki

 * Use notes from messages to Barry, Austin, and Ilya to do this
 * Document all required components in the Tex-related installation
 * Document the log-related actions (merge; above)
 * Document the PHP-related issues

Recompile the PHP binaries on the new server

 * Packages are still missing
 * Find and install them then finish the recompile

Complete script file to automate install

 * First get the PHP issues ironed out.
 * Test on beta.openwetware.org