Hello. Please explain to me some things. Here I have a local server, I write it on SparkJava ... And it turns out the server can be collected in a jar archive. Next, I write the server in php and I can drop php scripts.

Both servers are permissible, but how can they work on the Internet? How does the server work on hosting in different languages? How to run jar if the server is not in my home? How does all this work? (

  • 3
    The server in the sense of a piece of iron is just a computer, and everything on it starts and works in exactly the same way as on a home computer - andreymal
  • 2
    On shared hosting, full access to the server (in the sense of a piece of iron) is not allowed, there is usually some Apache that runs the user's scripts. On VDS and Dedik, the most ordinary Windows can theoretically stand, showing the most ordinary desktop and allowing you to create anything like on your home computer - andreymal
  • @andreymal, and .. Again, nothing is clear. 4 years already stupid and here everything is minus and minus - Flippy
  • What exactly is the word incomprehensible? "Server is just a computer" is also unclear?) - andmalmal
  • one
    “How to start the jar if the server is not in my home?” - take the VDS or Dedik, put the java there as usual and run the jar on it as usual :) - andreymal

1 answer 1

Without the interpreter, nothing will work, you need a machine that will run the JAR code, and again, if the server is in php , then there is either a LAMP server or another one, the same node.js And the most interesting thing, the two servers will never work together, as there are configs, single configs. They are for one server only.

About how it works on hosting. Very simple. Why did you decide that there is one server on the hosting? There are many of them, the same VPS technology is worth something, or, for example, dockers aka cubernets are used.

  • But now I remember they gave me the admin panel and I threw php scripts in there (on the site). And then it was necessary to launch .jar. And I couldn't do it - Flippy
  • @Flippy, and it won't happen, this is PHP hosting, don't run anything there just like that, it won't work without an interpreter, I say it again. If you want to implement, then you need a VPS server. There you install Java Open JDK , and then in PHP you give a command to the shell that you need to run through Java . - MrMEX 2:23 pm