B4J Question [ABMaterial] Deployment [Solved]

Robert Maguire

Member
Licensed User
Longtime User
Hi Folks,

I'm currently trying to deploy an ABMaterial app that I developed for a friend to their VPS and not having much luck... I have read the following threads but they have not helped me get over the line:
https://www.b4x.com/android/forum/threads/abmaterial-need-vps-deployment-tutorial.78297/
https://www.b4x.com/android/forum/threads/abmaterial-for-dummies-beginner-lessons.88346/#post-609895
https://www.b4x.com/android/forum/threads/server-run-a-server-on-a-vps.60378/

I know enough about Unix to be drive and (and be dangerous) but I not a qualified Unix Admin so I picking my way through carefully but not getting a successful deployment.

My app runs perfectly on my dev machine from the B4J IDE using USBWebServer but I can't seem to get it working on the VPS. What I end up with in Chrome is:
1597625545043.png


Here is what I do to deploy:
  • In B4J I compile and run the app in Release mode to create the jar file.
  • On the VPS I have created a directory called 'www' under the 'public_html' directory.
    • I have set the permissions on www to 'rwxr-xr-x'.
  • I copy the jar file and the 'copymewithjar.needs' file from the dev PC to the VPS 'public_html' directory.
  • I copy the entire contents from dev pc '.../Object/www' to VPS '.../public_html/www/' directory, i.e. css, fonts, js and the app directory.
  • I login to the VPS and start the app server with 'nohup java -jar appname cat > nohup.out &'.
  • The process is running, verified by 'ps -ef | grep appname'
B4X:
root@mys [~]# ps -ef | grep Swim
root     [B] 9375 [/B]    1  0 02:03 ?        00:01:08 [B]java -jar MySwimSplits.jar[/B]
root     17735 17702  0 20:08 pts/0    00:00:00 grep --color=auto Swim
root@mys [~]#
  • The contents of nohup.out suggest that the app has started OK and I don't see any errors or issues in there.
  • I suspected that the server port (51405) was not open and I asked the ISP to open that port, which I was told has been done (I don't know how I can verify this) but a couple of Unix commands do suggest that there is a java process listening on port 51405.
So at this point I've reached my limits as to what I can do to diagnose the problem...so I'm seeking B4X community advice as to how I can proceed to get this working. Can anybody point me in the right direction here?

Thanks in advance.
 
Last edited:

Robert Maguire

Member
Licensed User
Longtime User
[Solved] Once again I have posted a question and then found out the problem an hour later....

It turns out the port had 'probably' been opened but the the firewall service had not been re-started. I re-started the firewall service and everything works perfectly.

Hope this little issue helps somebody else out on their first ABMateriel deployment.
 
Upvote 0

OliverA

Expert
Licensed User
Note: anything in public_html can be downloaded, including your .jar file.
Note2: if the default Webserver is still running alongside your ABM application
 
Upvote 0

Robert Maguire

Member
Licensed User
Longtime User
Thanks for the info OliverA...

I'm not terribly brilliant at Unix permissions and directory structures... Can you give me any tips on how I should secure it or where I should install it?

Thanks in advance.
 
Upvote 0

Robert Maguire

Member
Licensed User
Longtime User
Thanks AB... I appreciate the response.

I thought it contradicted the advice in the posts I linked at the start of this thread but after re-reading them I get it now and understand the reasoning for not putting it in public_html...

Off to move the app now...

Cheers
 
Upvote 0
Top