Proceed to these steps after you have set up your development environment.
When going through the information below, be sure to replace all instances of DISID with your DISID username.
Step-by-step guide
- Edit the hosts file
- Edit hosts file (
C:\windows\system32\drivers\etc\hostson Windows,/etc/hostson Linux and OSX) Add
localhost-axis.disney.networkto the127.0.0.1line (line #3 below)#AXIS GAE Setup 127.0.0.1 localhost localhost-axis.disney.network localhost-gae-axis.disney.network direct-access-localhost-gae-axis.disney.network
- Edit hosts file (
- Install Postman in Chrome
- Install NGINX as a HTTPS reverse proxy
- Windows (Nginx)
- Download Nginx https://nginx.org/en/download.html
- Install to C:\nginx
edit the conf.ini file with the following config:
server { charset utf-8; root home/localhost-gae-axis.disney.network/public_html; listen 127.0.0.1:443; server_tokens off; server_name localhost-gae-axis.disney.network direct-access-localhost-gae-axis.disney.network; ssl on; #ssl_certificate c:/winginx/conf/server.crt; #ssl_certificate_key c:/winginx/conf/server.key; ssl_certificate c:/winginx/certs/authority/localhost-gae-axis.disney.network.crt; ssl_certificate_key c:/winginx/certs/authority/localhost-gae-axis.disney.network.key; ssl_protocols TLSv1.3; #location /6 { # alias home/localhost-axis.disney.network/public_html/axis6-client; #} location ~* ^/axis/(.*) { proxy_http_version 1.1; proxy_cookie_path ~* /; proxy_connect_timeout 2; proxy_send_timeout 55; proxy_read_timeout 55; send_timeout 55; proxy_set_header Host localhost-gae-axis.disney.network; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Host $host:$server_port; proxy_set_header X-Forwarded-Server $host; proxy_pass http://localhost:8080/axis/$1$is_args$args; } #location /axis { # proxy_pass http://localhost:8080$request_uri; #} location /dam { proxy_pass http://localhost:8080$request_uri; } location /_ah { proxy_http_version 1.1; proxy_cookie_domain localhost-gae-axis.disney.network localhost; proxy_cookie_path ~* /; proxy_connect_timeout 30; proxy_send_timeout 30; proxy_read_timeout 30; send_timeout 30; proxy_set_header Host localhost:8080; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Host $host:$server_port; proxy_set_header X-Forwarded-Server $host; proxy_pass http://localhost:8080/_ah; } location /oidc { proxy_http_version 1.1; proxy_cookie_path ~* /; proxy_connect_timeout 50; proxy_send_timeout 50; proxy_read_timeout 50; send_timeout 50; proxy_set_header Host localhost-gae-axis.disney.network; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Host $host:$server_port; proxy_set_header X-Forwarded-Server $host; proxy_pass http://localhost:8080/axis/oidc; } location /6/ { proxy_pass https://dev1-axis.disney.network/6/; } location /6/css { proxy_pass https://dev1-axis.disney.network/6/css/; } location /6/scripts { proxy_pass https://dev1-axis.disney.network/6/scripts/; } }
- run in command window by
cd c:\nginx nginx.exe
Create a self signed certificate
Install cygwin
Install OpenSSL from cygwin
Make sure C:\cygwin64\bin is in the variables path
Create a "certs" folder in C:/Users/DISID/Documents/ and run the following in command line.
Run the following in a new terminal
cd users/DISID/documents/certs openssl req -new -x509 -nodes -days 3650 -newkey rsa:2048 -keyout localhost-dev.key -out localhost-dev.crt openssl rsa -in localhost-dev.key -text > localhost-dev.pem openssl x509 -inform PEM -in localhost-dev.crt > localhost-dev.pem
Windows (nginx with Windows Subsystem for Linux)
- Disable services on port 80 - http://www.devside.net/wamp-server/opening-up-port-80-for-apache-to-use-on-windows
- Run
sudo apt-get install nginx-extras Create file
/etc/nginx/sites-available/localhost-axis.disney.networkwith the following contentsupstream devserver { server 127.0.0.1:8080; keepalive 32; } server { listen 127.0.0.1:80; server_name localhost-axis.disney.network; location / { return 302 https://localhost-axis.disney.network/; } } server { listen 127.0.0.1:443 ssl; server_name localhost-axis.disney.network; server_tokens off; root /var/www/localhost-axis/html/axis6-site; index index.html; ssl on; ssl_certificate certs/localhost-axis.pem; ssl_certificate_key certs/localhost-axis.key; log_not_found off; access_log logs/localhost-axis.disney.network-access.log; error_log logs/localhost-axis.disney.network-error.log; location /6 { alias /var/www/localhost-axis/html/axis6-client; } location ~* ^/axis/(.*) { proxy_pass http://devserver/axis/$1$is_args$args; proxy_http_version 1.1; proxy_set_header Connection ""; } location /_ah { proxy_pass http://devserver/_ah; } }You must use the
upstreamconfiguration to define a pool of servers (a single server, in this case) otherwise the second and subsequent proxied calls will fail with an HTTP 502 (Bad Gateway) error.Tested with Ubuntu 16.04 and nginx 1.10.3-0ubuntu0.16.04.2
Create a self signed certificate
Install cygwin
Install OpenSSL from cygwin
Make sure C:\cygwin64\bin is in the variables path
Create a "certs" folder in /etc/nginx/ and run the following in command line.
Run the following in a new terminal
cd /etc/nginx/certs openssl req -new -x509 -nodes -days 3650 -newkey rsa:2048 -keyout localhost-axis.key -out localhost-axis.crt openssl rsa -in localhost-axis.key -text > localhost-axis.pem openssl x509 -inform PEM -in localhost-axis.crt > localhost-axis.pem
- Nginx for a Mac
Install Homebrew
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
install nginx
$ brew install nginx
Run nginx
$ sudo nginx
After installation, go to http://localhost:8080 in a browser. if you see a “Welcome to nginx” message it was a successful install.
Create a self signed certificate
openssl req -new -x509 -nodes -days 3650 -newkey rsa:2048 -keyout /usr/local/certs/localhost-dev.key -out /usr/local/certs/localhost-dev.crt Country Name (2 letter code) [AU]:CA State or Province Name (full name) [Some-State]:BC Locality Name (eg, city) []:Kelowna Organization Name (eg, company) [Internet Widgits Pty Ltd]:DI Organizational Unit Name (eg, section) []:DI Common Name (e.g. server FQDN or YOUR name) []:localhost-axis.disney.network Email Address []:jacquie.armstrong@disney.com
- Configure NGINX
- Windows (Nginx)
Comment out default
serverblocks in nginx.confEdit /usr/local/etc/nginx/nginx.conf so that there are two
serverblocks as followsserver_names_hash_bucket_size 64; server { listen 127.0.0.1:80; location / { return 302 https://localhost-axis.disney.network/; } } server { root home/localhost-axis.disney.network/public_html; listen 127.0.0.1:443 ssl; server_tokens off; server_name localhost-axis.disney.network; ssl on; ssl_certificate /usr/local/certs/localhost-dev.pem; ssl_certificate_key /usr/local/certs/localhost-dev.key; log_not_found off; access_log logs/localhost-axis.disney.network-access.log; error_log logs/localhost-axis.disney.network-error.log; location /6{ alias /usr/local/public_html/axis6-client; } location ~* ^/axis/(.*) { proxy_pass http://localhost:8080/axis/$1$is_args$args; proxy_connect_timeout 25; proxy_send_timeout 25; proxy_read_timeout 25; send_timeout 25; } location /_ah { proxy_pass http://localhost:8080/_ah; } }
- Once axis server is running, and nginx is configured and running, you can load Axis locally by going toThis will have the front end being loaded by dev, but the back end referencing your local Axis server.
http://localhost-gae-axis.disney.network/axis/oidc
- Configure Axis
- Copy configs off dev1 ( /etc/disney/cstools/ )
- Using Postman
- Install Postman App
- Install Postman Interceptor extension
- Import some sample postman environments and calls in axis-server/postman
- Using Charles
- install charles
add the following 3 lines to /etc/disney/cstools/ client.properties
#abstractclient.proxy_host=localhost#abstractclient.proxy_port=8888
#abstractclient.allow_invalid_certs=true