Guide to deploy Texera service - Texera/texera GitHub Wiki

guide to deploy texera service

prerequisites:

1. choose a url name

for example, texera.ics.uci.edu/twitter, then the url name is /twitter

2. change backend config

  • open conf/web-config.yml
  • under applicationContextPath, put in the url name, applicationContextPath: /twitter
  • under applicationConnectors and adminConnectors, change port numbers if multiple texera instances are running.
  • for example, change port in applicationConnectors to 8300 and port in adminConnectors to 8301

3. build backend

cd amber
sbt clean
sbt compile

4. build frontend

notice the extra options in ng build, "/" is needed both before and after the url name in both options

cd new-gui
npm install
ng build --prod  --deploy-url=/twitter/ --base-href=/twitter/

5. run server

  • open a new tab in screen, then run ./scripts/server.sh
  • open a new tab in screen, then run ./scripts/worker.sh

6. set up apache reverse proxy

apache server must be set up properly, including adding modules for reverse proxy and websocket reverse proxy

cd /etc/apache2/sites-enabled then sudo vi to open the config file

Add reverse proxy for http and websocket, use the port number specified in step 2. Add the following config in between <VirtualHost *:80> </VirtualHost>. Notice that wsapi entry needs to be on the top

ProxyPass /twitter/wsapi/ ws://texera.ics.uci.edu:8300/twitter/wsapi/
ProxyPassReverse /twitter/wsapi/ ws://texera.ics.uci.edu:8300/twitter/wsapi/

ProxyPass /twitter http://texera.ics.uci.edu:8300/twitter
ProxyPassReverse /twitter http://texera.ics.uci.edu:8300/twitter
  • replace first /twitter after ProxyPass and ProxyPassReverse with your own name
  • replace the url afterwards with your own url and ports

restart apache service sudo service apache2 restart