On my local machine I have set up a web project like toled in a tutorial. I have installed XAMPP and used MySQL and Apache to run my Node.JS backend. Now I'm about to use a external server to host the project and make it available through the internet.
So I have to setup the server and I want to know why I need Apache (from XAMPP) to run the Node.JS backend? I thought the node.js is a web server by itself? So would it be a clever idea to set up the external server again with XAMPP?
When I want to start index.html by the URL could I also do this with the node.js?
No you won't need an Apache server. Because Node itself will serve as a Server Especially if you are working with Frameworks like Express.
We can use Nginx if we want. It's very cosy to some people use Nginx to do the load balance, or even other stuff like handle the https or server static content. It's your choice at the end.
For best performance, though, you'll combine node.js with nginx, depending on the needs of your application. nginx does a better job of serving static files, though at the highest performance for static files will come from using a CDN. Most often, you'll use nginx as a reverse proxy: the web request will be received by nginx, which acts as a load balancer in front of several identical or subdivided servers. If it needs to server static files as well, it will just answer those requests directly.