New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Recommended Web Server Setup (Nodejs, PHP)?
Hi,
As title says, asking for some advice which/what is the recommended server setup (including the linux OS) to use for NodeJs and/or PHP application.
Current KVM VPS (1vcore, 1.5gb ram,15gb ssd ,1TB bw 1gbps link).
Looking for a lightweight setup to save on ram and to avoid bottleneck
Aside, is there a batch script available we could use to install the said setup one time.
Thank you in advance for any suggestion/help.
Comments
Seems like Ubuntu is the most choice.
you can find many bash scripts.
for nginx there are many famous ones and for apache, you gotta find good ones.
which one is better apache or nginx?
I always use apache but many ppl here prefer nginx.
and i am not here to argue which is better, i started with apache and it serves my purpose so i just use it.
my local development environment also based on apache so i just use it.
after trying many others, i wrote my own script too but i stopped it after updating some times. i don't recommend using mine because it requires extra manual steps too.
currently i am using this https://github.com/stephenlang/bash-lamp-installer
OS
I use Ubuntu 18 or 20 on most servers (including local WSL development environment), but use Debian 10 on small servers (512MB or less).
These two systems are very similar for PHP and Node.
HTTP server
Most of my deployments use nginx.
nginx has all the features I need in a
nginx-light
meta-package: FPM, rewrite, reverse proxy, caching, etc.I started with Apache but it's too heavyweight and I dislike the
.htaccess
files scattered everywhere.I also used lighttpd in the past but I dislike its configuration structure.
I'm investigating Caddy server.
It's supposed to be more secure and more efficient, but I haven't figured out how to represent the rewrite rules needed to support 14 years worth of old links.
PHP
I use php-fpm via Unix socket, nginx config.
Currently I have PHP 7.3. I'm somewhat behind in upgrades.
Node.js
I don't have a public-facing Node.js based web application.
In an internal deployment, I just let Node.js listen on a high port and visit that port.
For public deployment, I'll probably setup nginx reverse proxy, and have nginx handle static files directly.
I use Caddy. My sites hardly get any load and setup is easy and
Caddyfile
s are easy to configure.I like Lighttpd. It uses like 10MB ram on my box. With PHP it takes more of course but for general usage I never miss any of the advanced features of Apache or Nginx.
Caddy as web server, Phusion Passenger as app server.
No more hefty Nginx or php-fpm config.