The steps required to run a B4J server on a hosted server (such as a VPS) are:
1. Download Java: https://www.b4x.com/android/forum/t...lest-way-to-distribute-ui-apps.99835/#content
If you are not familiar with Linux then download it to your development computer, unzip it and upload the files with FTP. You do not need to install anything.
2. Upload the compiled jar with any additional files (www folder for example).
3. Start the server with:
The console output will be written to nohup.out.
You need to use nohup as otherwise the server will be killed when you log out.
4. Make sure that the relevant port is open in the firewall settings.
5. If you want to kill the server you can use this command to find the process number:
6. Tip: Use tail -f nohup.out
To monitor the server logs.
If you see an error related to the temporary folder then explicitly set it with:
If there is another http server running on the computer, like Apache or IIS, then you should not copy the B4J server to its public_html / www / or any other publicly accessible folder.
1. Download Java: https://www.b4x.com/android/forum/t...lest-way-to-distribute-ui-apps.99835/#content
If you are not familiar with Linux then download it to your development computer, unzip it and upload the files with FTP. You do not need to install anything.
2. Upload the compiled jar with any additional files (www folder for example).
3. Start the server with:
B4X:
nohup path_to_java/bin/java -jar somejar.jar > nohup.out &
You need to use nohup as otherwise the server will be killed when you log out.
4. Make sure that the relevant port is open in the firewall settings.
5. If you want to kill the server you can use this command to find the process number:
B4X:
ps -ef | grep java
kill <process number>
6. Tip: Use tail -f nohup.out
To monitor the server logs.
If you see an error related to the temporary folder then explicitly set it with:
B4X:
nohup path_to_java/bin/java -Djava.io.tmpdir="temp" -jar somejar.jar > nohup.out &
If there is another http server running on the computer, like Apache or IIS, then you should not copy the B4J server to its public_html / www / or any other publicly accessible folder.
Last edited: