You are not logged in.
Pages: 1
Hello all!
So I currently have some cheap hosting service with few low-traffic sites on it: 2 wordpresses, one hand-made http + php site, picture galery, picture upload, file upload, some static sites and I also plan to use WSGI Python applications in the future.
Recently I bought VPS service for different reason: I built there a VPN with pi-hole to filter advertisements on my phone. Now I'm thinking about moving those sites to my VPS. So, few small sites with various requirements: PHP, mod_rewrite support, WSGI.
What approach should I use? How the configuration should look like? Should I set up a separate server, best for each kind of site (for example gunicorn for python apps, Apaches for the rest)? Or maybe I should set up nginx as a proxy for few instances of lighthttpd? Another approach would be to set up single Apache or nginx to host all of them. What would be best and why? I have no experience in projecting architecture of such systems.
Last edited by mkkot (2018-02-22 20:29:00)
Offline
nginx for routing and static data, php-fmp for that php crud, wsgi server of choise for python stuff. You can run all this on the single vps if this is just low traffic.
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
usually for small sites, a single webserver is enough. for low traffic site it doesn't really matter if it's apache, nginx, lighttpd ... it depends what you are familiar with. what you are willing to learn. each of these has their own pitfalls. apache does rewrites, nginx does rewrites, lighttpd does rewirtes, but each has slightly different syntax for them.
it's easy to get php setup wrong with nginx, and perhaps lighttpd also. a lot of wiki / blog explain wrong setups. make sure php is not executed for arbitrary user uploads, such as user avatars if they are hosted on your site and not gravatar.
webserver should execute PHP for existing PHP files only.
Offline
for low traffic site it doesn't really matter if it's apache, nginx, lighttpd
Agreed. A vast majority of the pros and cons of each of these only become relevant under high traffic conditions. The one criteria that doesn't depend on traffic patterns is how easy/hard it will be to set up. I have minimal experience with nginx, but for very simple sites it's definitely the easiest, but as soon as you throw in php and half of the things you mentioned, that may not be the case.
I'd say for your conditions Apache would likely be the easiest. Perhaps mostly because of the readily available documentation, examples, and web-searchability. Just follow the yellow-bricky wiki.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
I pretty much completely agree with everything above. On my VPS I use nginx instead of Apache as I find the configuration simpler and it's what I'm used to. All of the PHP webapps that I use (nextcloud, roundcube, etc) have nginx configs listed in their documentation alongside Apache examples.
Most of my sites are either static or use php-fpm, for the couple that use different server technologies (node.js etc) I just spin up a server listening on localhost and then still use nginx to do the https termination and reverse-proxy it to the server instance. Now that LetsEncrypt exists it's trivial to set up properly signed certificates that auto-renew for all of your domains, it also simplifies my nginx config as all traffic hitting port 80 gets immediately permanently redirected to port 443, meaning ssl config can live in my main configuration instead of each of the site-specific configs.
https://bbs.archlinux.org/viewtopic.php … 7#p1741847
Whichever method you choose there are plenty of knowledgeable people here who can help you if you get stuck
Offline
Thanks a lot for bunch of good advices. One more question: how do you do redundancy and do you do it at all? I mean, what happens if this apache/ngnix/whatever which is proxy/server for all those sites goes down?
Offline
That depends on what you mean by "goes down". If you have a single server and it goes offline then your server is offline, there is no magic software that can do anything about that*. If you want hardware redundancy, you need redundant hardware.
*There are steps you can take to ensure it comes back online promptly. Some of this is handled at the service provider / hypervisor level: linode for example has the "Lassie" service which will quickly reboot any VPS that powers down. Then just ensuring your services are enabled to start at boot, they should all come back online.
Last edited by Trilby (2018-02-27 11:25:14)
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
What about security concepts (process isolation, resource limits, logging, intrusion detection, counter measures...)?
sys2064
Offline
Pages: 1