-
Notifications
You must be signed in to change notification settings - Fork 1
Deployment
The SSD AngularJS website is a static HTML website that uses web services to reach backend data. It also consists of at least 3 PHP scripts to proxy AJAX calls to prevent CORS errors. These PHP scripts do not and should not allow willy-nilly proxy requests in order to prevent malicious usage.
The deployment is manual, with code on Github. These steps only apply to the deployment from 1.x to 2.x, in other words from the WP site to the NG site with WP backend. In 2.x and beyond the deployment should consist of a single "git pull github master" where 'github' is a git repo.
The steps for moving WP from the root to its own folder are at: http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory
The deployment outline is:
- create a sandbox
- clone/download the new site from Github into the sandbox
- copy the WP site into a subfolder in the sandbox
- make changes in the sandbox as required to have the new NG site with a WP subfolder
- backup the current boulderhackerspace.com files
- do not worry about WP database backup
The deployment steps go like this:
- git clone [ssd-w3-ng-code] wwwroot-[todays_date]
- cp -R [wwwroot] wwwroot-[todays_date]/wp
- cd [wwwroot]-[todays_date]
- vi ./wp/.htaccess
- RewriteBase = /wp
- save, exit
- touch .htaccess
- vi .htaccess 1.1. RewriteBase = /app
- check file permissions and ownership. Probably need to sudo chown the files cloned with Git since shell user != httpd daemon user. Ownership should be the same as wwwroot. Use -R switch. Read/write permissions should just be read. There are 3+ proxy*.php files that probably need execute permission, not sure. Permissions from wwwroot for wordpress should have copied over verbatim.
- cp proxy-flickr-template.php proxy-flickr.php
- cp proxy-meetup-template.php proxy-meetup.php
- edit proxy-flickr.php with your Flickr API key
- edit proxy-meetup.php with your Meetup API key
- cd ..
- mv [wwwroot] wwwroot-v1-BAK
- cp -R wwwroot-[todays_date] wwwroot
- check site with web browser
- From the admin, two vars should be changed in wp-admin/options-general.php:
There are 3 proxy files for:
- Wordpress API (no API key needed)
- Meetup API (need API key)
- Flickr API (need API key)
Meetup and Flickr require API keys. These API keys are not checked into this repository. You must edit these files:
- proxy-meetup-template.php
- proxy-flickr-template.php
- mv wwwroot-v1-BAK [wwwroot]
- Do the proxy scripts have their API keys?
- If proxy scripts don't work check path and URLs in app/js/services.js.
- Use developer toolbar to check proxy requests and responses.
- Wrong settings in RewriteBase will usually throw a 500 or 50x error. Possible corrective action is to add/remove trailing slash, or try commenting it out by adding # as the first character in the line.