Step 1 : Log into your CentOs sever with any SSH client.( have admin rights to your account.) I use
http://mobaxterm.mobatek.net/. You can use any other software you like.
Step 2 : You need to open the port number which your B4J webserver will use to communicate with your IOS or Andorid application. To know which port number is currently used. Go to configure.properties in your files folder and search for "ServerPort"
Code:
#Java server port
ServerPort=51043
Type the below line in your CentOs terminal to open the port.
Code:
sudo iptables -I INPUT -p tcp -m tcp --dport 51043 -j ACCEPT
To Check the open port. use
You will get the following output
Code:
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:51043
Step 3 : Upload the compiled Jar file into a folder of your choice. Here I have uploaded to /home/sk/b4ardc/
Step 4 : Run the Jar file using the below command
Code:
nohup path_to_jdk -jar path_to_jarfile > nohup.out &
example -
nohup /opt/jdk1.8.0_91/bin/java -jar /home/sk/b4ardc/test.jar > nohup.out &
To know the path to Java, use
Step 5 : Confirm your B4J web server is running, use
Code:
curl http://127.0.0.1:ServerPort/test
Example -
curl http://127.0.0.1:51043/test
Output -
RemoteServer is running (2016-01-09 11:31:49)<br/>Connection successful.root@xxx [~]#
To access you B4J web sever from your application you can use the link
Code:
http://yourwebsiteadress:51043/rdc