Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor modification for ubuntu 14.04 deamon mode #3

Open
chungyan5 opened this issue Jan 18, 2016 · 0 comments
Open

Minor modification for ubuntu 14.04 deamon mode #3

chungyan5 opened this issue Jan 18, 2016 · 0 comments

Comments

@chungyan5
Copy link

Just sharing my setup experience:

bin/tjwserv

description "tjwserv"

start on (local-filesystems and net-device-up IFACE!=lo)
stop on runlevel [!2345]

env HOME=/home/user
setuid "user"
setgid "user"

exec /opt/tjws/bin/tjwserv.sh

respawn

bin/tjwserv.sh

#!/bin/bash
RETVAL=0;

JDK_HOME=$(readlink -f /usr/bin/javac | sed "s:/bin/javac::")
tjws=/opt/tjws
cp=$tjws/lib/javax.servlet.jar:$tjws/lib/war.jar:$tjws/lib/webserver.jar:$tjws/lib/app.jar:$tjws/lib/class-scanner.jar:$tjws/lib/wskt.jar:$tjws/lib/javax.websocket-client-api.jar:$tjws/lib/javax.websocket-server-api.jar:$tjws/lib/jsp.jar:$tjws/lib/jasper.jar:$JDK_HOME/lib/tools.jar
log=/var/log/tjws
webapps=/usr/share/java/webapps

tjws_cmd=$JDK_HOME/bin/java\ -cp\ $cp\ -Dtjws.webappdir=$tjws/webapps\ -Dtjws.wardeploy.dynamically\ -Dorg.slf4j.simpleLogger.defaultLogLevel=DEBUG\ rogatkin.app.Main\ -nohup\ -a\ $tjws/aliases\ -p\ 8011\ -l\ -c\ cgi-bin\ -d\ $log\ -g\ 10000\ -acceptorImpl\ Acme.Serve.SelectorAcceptor

$tjws_cmd

exit $RETVAL

Installation and Configuration

  • prepare log file
    • sudo mkdir -p /var/log/tjws/
    • sudo chown user.user /var/log/tjws/
    • sudo chmod u+wx /var/log/tjws/
  • sudo chmod a+rx /opt/tjws/lib/
  • sudo chmod +rx /opt/tjws/bin/
  • sudo cp /opt/tjws/bin/tjwserv /etc/init/tjwserv.conf
  • sudo chmod +x /opt/tjws/bin/tjwserv.sh
  • sudo /opt/tjws
  • update the port and log mode(debug or info, etc.) at /opt/tjws/bin/tjwserv.sh
  • sudo service tjwserv start
  • wait a moment, ~1 min, see the log file
  • log file at tail -n 200 /var/log/tjws/TJWS-*.log
  • update xyz.war into webapps/ at any time, wait ~30Sec, it will update the new content by itself
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant