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)
Need to set up RSA key to enable SSH access to the Stash environment because apparently the VM is too big for standard HTTPS.
Create an SSH Key on local Windows machine following this article --> (Local notebook environments) https://confluence.atlassian.com/display/STASH/Creating+SSH+keys#CreatingSSHkeys-CreatinganSSHkeyonWindows
Create an SSH Key on Linux/Mac --> (Server environments) https://confluence.atlassian.com/display/STASH028/Adding+an+SSH+key+to+your+Stash+account+on+Linux+and+Mac
Associate SSH Key with Stash repository --> https://confluence.atlassian.com/display/STASH/SSH+user+keys+for+personal+use
After setting up an SSH key and associating with the Stash repo clone it locally
git clone ssh://[email protected]:7999/ius/insidelm-vagrant.git (this will ask for password and download the insidelm-vagrant git repo which includes the base vagrant vm)
After the git repo is cloned; cd into insidelm-vagrant.
Make a new directory named "data"
Perform an ls -l on the insidelm-vagrant dir and the following should be displayed.
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
Edit apache_start.conf as below (this is optional)
Apache_start conf (this is just a base conf to validate apache is working)
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