Guide to deploy Texera service - Texera/texera GitHub Wiki
guide to deploy texera service
prerequisites:
- install all required packages, following https://github.com/Texera/texera/wiki/Getting-Started
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
andadminConnectors
, change port numbers if multiple texera instances are running. - for example, change
port
inapplicationConnectors
to8300
andport
inadminConnectors
to8301
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
- install apache2 server, for ubuntu, check https://www.digitalocean.com/community/tutorials/how-to-install-the-apache-web-server-on-ubuntu-18-04-quickstart
- enable reverse proxy modules on apache2 server, for ubuntu, follow instructions here: https://www.serverlab.ca/tutorials/linux/web-servers-linux/how-to-reverse-proxy-websockets-with-apache-2-4/
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
afterProxyPass
andProxyPassReverse
with your own name - replace the url afterwards with your own url and ports
restart apache service
sudo service apache2 restart