insideLM VM Build Steps

Steps to build an iLM Dev env from the base box stored in the insideLM-vagrant git repository currently located in the Stash insidelm project.


  • Create a local directory that will store the base box VM

  • Open the Git BASH command prompt and navigate to the directory just created.

  • Clone the insidelm-vagrant repository from Stash (or Github later)

  • After the insidelm-vagrant repo is cloned locally; the VM can be added to vagrant

  • At the command line enter: vagrant box add insidelm/basevm base_lamp_box_v1.box

  • Create a data directory: mkdir data (or do it manually via Windows explorer)

  • Next enter vagrant up (this will start the VM)

  • After VM starts up enter vagrant ssh to login

  • Update Apache config files

      CD to /etc/apache2/sites-available
    
      Copy default config file to two new files
    
      Sudo CP 000-default.conf insidelmdev.conf
    
      Sudo CP 000-default.conf apache_start.conf
    
      Edit insidelmdev.conf with nano (or other editor) and update as note below
    
      Insidelmdev conf
    

    C:\A75B92A5\101DC400-C546-4997-82E1-506439E245C4_files\image002.png

    Edit apache_start.conf as below (this is optional)

    Apache_start conf (this is just a base conf to validate apache is working)

Machine generated alternative text: <VirtualHost *:80> # The ServerName directive sets the request scheme, hostname and port that # the server uses to identify itself. This is used when creating # redirection URL5\. In the context of virtual hosts, the ServerName # specifies what hostname must appear in the request’s Host: header to It match this virtual host. For the default virtual host (this file) this It value is not decisive as it is used as a last resort host re9ardless. It However, you must set it for any further virtual host explicitly. Server Name apache_start ServerAdmin anm. d . ceelylmco. corn Document Root /var /www/ <Di rectory /var/www/> AllowOverride All </Directory> It Available loglevels: trace8, ..., tracel, debug, info, notice, warn, It error, cnt, alert, emerg. It It is also possible to configure the loglevel for particular It modules, e.g. ItLogLevel info ssl:warn ErrorLog S{APACHE_LOC_DIR}/error .1 og CustomLog S{APAcHE_LOG_DIR}/access . log combined It For most configuration files from conf—available/, which are It enabled or disabled at a global level, it is possible to It include a line for only one particular virtual host. For example the It following line enables the CCI configuration for this host only It after it has been globally disabled with “a2disconf”. ItIncl ude conf-avai 1 ahl e/serve-cgi -bin, conf </Vi rtual Host>

  • Enable insidelmdev

      Sudo a2ensite insidelmdev.conf
    
  • Enable apache_start (optional)

      Sudo a2ensite apache_start.conf
    
  • Disable default site

      Sudo a2dissite sudo
    
  • Restart apache

      Sudo service apache2 restart
    
  • Update hosts file on local desktop/notebook to point the VM IP address to the friendly name insidelmdev

    The hosts file is located here --> c:\windows\system32\drivers\etc and it must be edited as a local admin.

    Add the following line --> 192.168.44.44 insidelmdev and save

  • Make sure the browser proxy settings (for IE or Chrome or FF) includes an exclusion for insidelmdev or you will get a proxy error when trying to browse the site initially.

  • Hit the site http://insidelmdev - there shouldn’t be anything yet but this is just a check that it resolves

  • CD to /var/www

  • Clone the insideLM repo to the local VM

      git clone ssh://[email protected]:7999/ius/insidelm.git
    
  • Download copy of a recent backup of the iLM production database; this can be done using the scp tool.

  • Navigate to the local dir where the DB backup should be downloaded; this could be the root directory of the local VM where the vagrant box was cloned from Stash.

    Ex. scp [email protected]:/data/insideLMdb/mySqlBackup/weekly/insidelm/weekly_insidelm_2016-01-22_00h00m_3.sql.gz .

  • Unzip the file --> gunzip weekly_insidelm_2016-01-22_00h00m_3.sql.gz

  • From command line create empty DB

      Mysql -u root -proot
      Mysql> create database insidelm;
      Mysql> create database saml;
      Exit
    
  • Mysql -u root -proot insidelm < backupfile.sql

  • Copy all media files down to local VM

      First create dir path
    
      Cd /var/www/insidelm/htdocs/sites
    
      Mkdir default
    
      Cd default
    
      Mkdir files
    
      Run rsync command to pull all QAS or Prod media files
    
      rsync -Phav --exclude=".snapshot" [email protected]:/data/insidelm_intranet/ /var/www/insidelm/htdocs/sites/default/files/
    
      This should sync the empty files dir to match the prod files dir
    
  • Copy insideLM settings.php file to /var/www/insidelm/htdocs/sites/default/files/ (this is located in the root folder where the vagrant base lamp box was downloaded to from git)

  • Update the insideLM MySQL DB id and password if they have been changed; default is root/root

  • Run Drush command to check features modules (must be in folder /var/www/insidelm/htdocs)

      Drush fl
    
      Revert all features modules from code to the DB
    
      Drush fra -y (or by each module drush dr <module name> -y
    
      Run any DB updates that are necessary: drush updb
    
  • At this point you should be able to test the iLM dev site at http://insidelmdev/user (need to login and update the simplesamlphp_auth module to either disable it or change the application path)su

  • Solr search indexing - this is necessary to support the site search and the display of various content lists.

  • Prior to running solr indexing process

    • Increase Tomcat7 Java memory heap size from 128 to 512 or higher in /etc/default/tomcat7 file.

        JAVA_OPTS="-Djava.awt.headless=true -Xmx512m -XX:+UseConcMarkSweepGC"
      
  • Config search_api_solr by copying config to Solr config dir

  • Rerun solr indexing process

      Go to Config-->Search & Metadata-->Search API
    
      Click on the solr server link
    
      Click update
    
      Update Solr server URL --> localhost:8080
    
  • Rebuild search_api_solr indexes (Nodes and Files)

    • Click on the nodes link

    • Click the clear all indexed data button first and when complete click the Index now button. This should re-index all of the DB content. This may take awhile and may require running multiple times to complete.

    • First clear all indexed data and then run index now.

    • Repeat the process for the Files index

  • Configure SSOCircle IDP if desired for SSO functionality

    • SSOCircle is a internet based SSO SAML test provider - http://www.ssocircle.com/en/

    • Follow instructions noted here to configure SSO - https://simplesamlphp.org/docs/stable/simplesamlphp-sp

    • Need to reconfigure simpleSAMLphp_auth module attributes to utilize SSOCircle values otherwise the app will bomb with the module enabled.

    • The config.php, authsources.php, config-metarefresh.php should be added to the git repo to be used if necessary in a subdir

  • Gotchas/Notes

    • Need to ensure apache config is set to AllowOverride ALL
    • Need to ensure Apache rewrite module is installed and enabled. This can be checked by running
        apachectl -M
      
  • Set the VM cron by using the drush command and crontab.
    Add to crontab file (this will run the cron hourly)
    0 * * * * /var/www/insidelm/htdocs/drush --root=/var/www/insidelm/htdocs --quiet elysia-cron > /dev/null 2>&1