wiki:Help/Migration

Server Migration

This document describes the full migration process for the ESTEST server located at http://estest.ucdavis.edu to another host. All web assets are replicated entirely.

Table of Contents

Part 1 HTTPD & PHP

http://www.youtu.be/Qn665qqH0LA

Apache HTTPD

  1. Download and unpack httpd-{version}.tar.gz http://httpd.apache.org/download.cgi
  2. configure
    ./configure --prefix=/home/tester/opt/httpd-2.2.15/ CC=gcc --enable-proxy-http --enable-proxy --enable-proxy-ftp --enable-modules=all --enable-mods-shared=all --enable-ldap --enable-authnz-ldap --with-ldap
    
  3. make
  4. make install

PHP

  1. Download and unpack php-{version}.tar.gz http://www.php.net/downloads.php
  2. configure
    ./configure  --with-apxs2=/home/tester/opt/httpd-2.2.15/bin/apxs --with-mysql --with-gd --with-zlib --with-pdo-mysql --with-openssl --with-ldap
    
  3. make
  4. make test
  5. [su(do)] make install

Part 2 eXist-db

http://www.youtu.be/kLZRUvrgS3Y
  1. Download eXist-setup-1.4.x-rev#.jar
    $ java -jar eXist-setup-1.4.x-rev#.jar
    

Part 3 eXist-db database backup & migrate

http://www.youtu.be/8m4ikAm6_0c

http://exist-db.org/exist/backup.xml

Part 4 ESTEST installation

http://www.youtu.be/GTAxNUwqt-A

ESTEST Installation Guide

Sample httpd.conf stub Include estest.conf

ProxyRequests Off

<Proxy *>
  Order deny,allow
  Allow from all
</Proxy>

ProxyPass /exist http://localhost:8080/exist
ProxyPassReverse /exist http://localhost:8080/exist

Redirect /estest-plugins /exist/rest/db/estest/plugins

Alias /estest /home/tester/www/estest-v1.4.2/www
<Directory "/home/tester/www/estest-v1.4.2/www">
  Options FollowSymLinks +ExecCGI
  AddHandler cgi-script .cgi
  AllowOverride None
  Order allow,deny
  Allow from all

  # Limit Requests to 10MB
  LimitRequestBody 10485760
</Directory>

Alias /registration/public /home/tester/www/estest-v1.4.2/www/registration/public
<Directory "/home/tester/www/estest-v1.4.2/www/registration/public">
  Options -Indexes +ExecCGI
  AddHandler cgi-script .cgi
  AllowOverride None
  Order allow,deny
  Allow from all
</Directory>

Alias /registration/private /home/tester/www/estest-v1.4.2/www/registration/private
<Directory "/home/tester/www/estest-v1.4.2/www/registration/private">
  Options -Indexes +ExecCGI
  AddHandler cgi-script .cgi
  AllowOverride None
  Order allow,deny
  Allow from localhost
</Directory>

Alias /administration /home/tester/www/estest-v1.4.2/www/administration
<Directory "/home/tester/www/estest-v1.4.2/www/administration">
  Options -Indexes +ExecCGI
  AddHandler cgi-script .cgi
  AllowOverride None
  Order allow,deny
  Allow from localhost
</Directory>

Part 5 System startup eXist-db & httpd

http://www.youtu.be/AI5ACt5BIro

Starting eXist-db at Boot

Part 6 ESTEST index webpages

http://www.youtu.be/W6YeWa_HvGI

Sample httpd.conf stub

DocumentRoot "/home/tester/www/index"

<Directory "/home/tester/www/index">
    Options Indexes FollowSymLinks

    AllowOverride None

    Order allow,deny
    Allow from all
</Directory>

<IfModule dir_module>
    DirectoryIndex index.html index.php index.cgi
</IfModule>

Part 7 OpenDS LDAP

http://www.youtu.be/Qs0wV_h058M
  1. Download OpenDS-{version}.zip http://opends.java.net/public/downloads_index.html
  2. Run setup
  3. Set "Directory Base DN" based on domain name e.g. "dc=estest,dc=ucdavis,dc=edu"
  4. Follow backup and migrate instructions from video for directory contents
  5. Create startup script
    $ create-rc-script -f ldapds
    
  6. Configure "ldapds" to start at boot
    $ [su(do)] ln -s `pwd`/ldapds /etc/init.d/ldapds
    $ [su(do)] update-rc.d ldapds defaults
    

Part 8 Trac

http://www.youtu.be/s1XgY7qK4SQ
  1. Install Trac and trac-admin
  2. Install the Trac plugin dependencies for
    1. http://trac-hacks.org/wiki/LdapAuthnzPlugin
    2. http://trac-hacks.org/wiki/AccountManagerPlugin
    3. http://trac-hacks.org/wiki/DiscussionPlugin
  3. Create new installation of Trac
    $ mkdir estrac; cd estrac
    $ trac-admin env initenv
    $ trac-admin env deploy www
    
  4. On remote server (estest.ucdavis.edu) execute hotcopy of Trac
    $ trac-admin `pwd`/env hotcopy ~/Desktop/trac.env.copy
    
  5. Copy remote server hotcopy of Trac to localhost
    $ mv env env.orig
    $ scp -r estest.ucdavis.edu:~/Desktop/trac.env.copy env
    
  6. Edit httpd.conf to Include trac.conf, sample stub of trac.conf
    Alias /estrac /home/tester/www/estrac/www
    <Directory "/home/tester/www/estrac/www">
      Options -Indexes +ExecCGI
      AddHandler cgi-script .cgi
      AllowOverride None
      Order allow,deny
      Allow from all
    </Directory>
    
    Alias /trac/chrome/common /home/tester/www/estrac/www/htdocs/common
    <Directory "/home/tester/www/estrac/www/htdocs/common">
      Order allow,deny
      Allow from all
    </Directory>
    
    <Directory "/home/tester/www/estrac/www/imgs">
      Options None
      Order allow,deny
      Allow from all
    </Directory>
    
    ScriptAlias /trac /home/tester/www/estrac/www/cgi-bin/trac.cgi
    
  7. Edit env/conf/trac.ini
    [ldap]
    anonymous_bind = true
    root_dn = dc=estest,dc=ucdavis,dc=edu
    server = ldap://0.0.0.0:1389
    user_searchbase = ou=Users,o=estest
    user_searchfilter = cn=%s
    

Part 9 ESTEST Discovery drupal

http://www.youtu.be/5tzySrWh9cc
  1. Download drupal http://drupal.org/project/drupal
  2. mkdir www/discovery; cd www/discovery
  3. unpack drupal www/discovery
  4. scp -r estest@estest.ucdavis.edu:~/www/discovery/static .
  5. synaptic install mysql-client & mysql-server
  6. mysql -u root -p
  7. show databases;
  8. create database estdisc; # show databases;
  9. create user 'estest'@'localhost' identified by 'password';
  10. grant all privileges on estdisc.* to 'estest'@'localhost';
  11. show grants for 'estest'@'localhost';
  12. exit mysql ctrl+d
  13. edit httpd.conf with drupal.conf (include), sample stub
    Alias /disc /home/tester/www/discovery/drupal-7.14
    <Directory "/home/tester/www/discovery/drupal-7.14">
      Options -Indexes +ExecCGI
      AddHandler php5-script php
      AllowOverride None
      Order allow,deny
      Allow from all
    </Directory>
    
    Redirect /disc/admin/content /disc
    
    Alias /disc-static /home/tester/www/discovery/static
    <Directory "/home/tester/www/discovery/static">
      Options None
      Order allow,deny
      Allow from all
    </Directory>
    
  14. go to localhost/disc
  15. go through interactive installer for drupal
  16. install custom modules
  17. go to http://estest.ucdavis.edu/disc as administrator and create backup
  18. on localhost go to configuration backup & migrate and restore the backup
  19. go to configuration tab, status report, run cron
  20. go to drupal home on localhost
  21. go to appearance tab on localhost
    • edit settings for bartik (default theme)
    • upload logo image
    • upload favicon image
  22. go to modules and configure LDAP authentication
    • go to 2.servers tab, edit estest LDAP server
    • change server IP address and port
    • test server
  23. Test rest of discovery

Part 10 ESTEST Development Blog Movable Type

http://www.youtu.be/P0yeTj1Skbs
  1. Download MT 5
  2. mkdir www/blog; cd www/blog
  3. unpack MT # unzip MTOS-5.14-en
  4. ln -s MTOS-5.14-en mt
  5. cd mt
  6. cp mt-config.cgi-original mt-config.cgi
  7. create mysql database mt; grant privileges mt.* to 'estest'@'localhost';
  8. edit mt-config.cgi, sample stub
    CGIPath    /blog/mt/
    
    StaticWebPath    /blog/mt/mt-static
    
    ##### MYSQL #####
    ObjectDriver DBI::mysql
    Database mt
    DBUser estest
    DBPassword password2
    DBHost localhost
    
    DefaultLanguage en_US
    
  9. edit httpd.conf, sample stub
    Alias /blog /home/tester/www/blog
    <Directory "/home/tester/www/blog">
      Options -Indexes +ExecCGI
      AddHandler cgi-script .cgi
      AllowOverride None
      Order allow,deny
      Allow from all
    </Directory>
    
  10. go to http://localhost/blog/mt/mt.cgi
  11. go through interactive installer
  12. create new blog; publish
  13. go to http://estest.ucdavis.edu/blog/cgi-bin/mt/ and sign in as admin
  14. select development blog; tools->Export Entries
  15. go to localhost and select development blog; tools->Import Entries
  16. republish
  17. go to Design->Styles; select MT4 Style Library; choose Minimalist Blue 2 columns wide thin and apply design
  18. go to Design->Templates; edit Banner Header; copy from estest.ucdavis.edu; edit for localhost
  19. republish

Part 11 SVN and Downloads

http://www.youtu.be/5rkfzzi8w-4
  1. dump estest-svn @ estest.ucdavis.edu
  2. create new svn @ localhost
  3. load estest-svn.dump to new svn on localhost
  4. configure httpd.conf with svn.conf, if necessary install libapache2-svn
  5. unpack repos-style-2.4.zip, http://reposstyle.com/
  6. configure svn.conf with repos-style
  7. svn co estest_index/download
  8. configure svn.conf with /download

Sample svn.conf include for httpd.conf

LoadModule dav_svn_module /usr/lib/apache2/modules/mod_dav_svn.so
LoadModule authz_svn_module /usr/lib/apache2/modules/mod_authz_svn.so

Alias /repos-web /home/tester/www/repos-web
<Directory "/home/tester/www/repos-web">
  Options None
  AddHandler php5-script php
  Order allow,deny
  Allow from all
</Directory>

<Location /svn>
  DAV svn
  SVNPath /home/tester/opt/estest-svn
  SVNIndexXSLT "/repos-web/view/repos.xsl"

  AuthzSVNAccessFile /home/tester/opt/httpd-2.2.15/conf/acls/svn.acl

  AuthType Basic
  AuthName "estest-svn"
  AuthBasicProvider ldap
  AuthLDAPURL "ldap://localhost:1389/dc=estest,dc=ucdavis,dc=edu?uid"
  Require valid-user

</Location>

Alias /download /home/tester/www/download
<Directory "/home/tester/www/download">
  AddHandler php5-script php
  Options None
  Order allow,deny
  Allow from all

  AuthType Basic
  AuthName "Access Downloads"
  AuthBasicProvider ldap
  AuthLDAPURL "ldap://localhost:1389/dc=estest,dc=ucdavis,dc=edu?uid"
  Require valid-user
</Directory>
Last modified 5 years ago Last modified on 10/31/12 17:32:05