B4J Question [ABMaterial] Publishing Project to Windows VPS WebServer

alwaysbusy

Expert
Licensed User
Longtime User
All your server needs is being able to run Java. It can even be a Raspberry Pi. B4J webapps do not work on conventional web servers, it must be a VPS. This is not an ABMaterial limitation. I suggest you start reading up on how WebApps and Web Sockets in B4J work (Erel wrote plenty of tutorials on the subject).
 
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
All your server needs is being able to run Java. It can even be a Raspberry Pi. B4J webapps do not work on conventional web servers, it must be a VPS. This is not an ABMaterial limitation. I suggest you start reading up on how WebApps and Web Sockets in B4J work (Erel wrote plenty of tutorials on the subject).
Sure thanks will look into it.
 
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
1. I have installed Java on my VPS machine and verified it.
2. I did ftp of the files to my server, these are in c:\inetpub\wwwroot\mymaterial
3. As admin i ran java -jar mymaterial.jar (the file is sitting in folder named in 2). This recreated the files, now I know that I wont ftp everything again.
4. I open the browser with the port as in image 4
Image 3 is when I check without the project path, it says forbidden
5. I have run the b4j server examples and that is working as per image 5 below.

@alwaysbusy How did you manage to run this on your windows machine? I understand you have moved over to a linux machine now, for any other users running windows, what's the magic of this? Thanks in advance
 

Attachments

  • 1 Verify if java is installed.png
    1 Verify if java is installed.png
    23.1 KB · Views: 561
  • 2 Run jar file.png
    2 Run jar file.png
    13.1 KB · Views: 531
  • 4 Check with port and project path.png
    4 Check with port and project path.png
    8.1 KB · Views: 514
  • 3 Check with port number only.png
    3 Check with port number only.png
    7 KB · Views: 456
  • 5 B4J Server Example.png
    5 B4J Server Example.png
    17.2 KB · Views: 512
Last edited:
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
Make sure to see this tutorial: [server] Run a Server on a VPS

You don't need to copy the B4J server to wwwroot. It is actually not recommended as it makes it possible to access the raw files through the IIS server.

Based on the browser messages, you haven't copied the www folder correctly.
Thanks Erel, I have looked at your tutorial and it seems to concentrate on Linux however I have managed to run the examples provided after I ftped them, perfectly without hussles. What I cant seem to get working is the ABMaterial project running. #bang head. I wish there was someone who have had an experience perhaps with this to provide me with a step by step as I am trying this out for the first time.

When one runs the jar file for the first time it generates the www folder, do I put this file outside inetpub in the root of the drive perhaps?
 
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
Ok, this is what I've done.

I uploaded the demo to my server and ran it, it worked without hustles.
I uploaded my own app it didnt work, renamed my app to demo and used port 51042 and not 51043 and it worked. Will keep on testing..

I'm thinking perhaps file names might have something to do with it but im just speculating as 'mymaterial' has 10 characters and perhaps there is a lock on port 51042 by ABMaterial. I could be wrong.

http://mbanga.dedicated.co.za:51042/demo/
 
Upvote 0

inakigarm

Well-Known Member
Licensed User
Longtime User
If you've running ABMaterial on 51402 port you'll have to use different port for your app (51403) or stop ABmaterial before start your app on same port; maybe it's why you can't run your app on 51402 port.
 
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
Publishing ABMaterial Apps Experience Test 1

I guess some things that are simple are hard and those things that are hard are simple, case in point this...

1. Ensure the app name is not more than 8 characters long. My apps with more than 8 characters just did not budge
2. Run your app and ensure it works on the development machine. I'm running Windows 10, lenovo g580
3. Install java on the VPS server and confirm its working.
4. Create a folder in your \inetput\wwwroot, e.g. demoapp for your app.
5. FTP the www and the jar file to \inetpub\wwwroot\demoapp
6. Start the command prompt and change directory to inetpub\wwwroot\demoapp
7. type java -jar demoapp.jar, this should start your app on the named port.
8. Open the browser localhost:51043/demoapp (This could be any port that you specified)

My next test will be to move the jar file out of inetpub and see how this goes. When you run the jar it creates the www folder so I need to be careful of what happens here.
 
Upvote 0

alwaysbusy

Expert
Licensed User
Longtime User
1. Ensure the app name is not more than 8 characters long. My apps with more than 8 characters just did not budge
Must be a limitation on your machine. B4J/ABMaterial allows longer app names. Maybe because you run it in Web Server (which is discouraged anyway, as there is absolute no need for it).
 
Upvote 0
Top