1

I need to be able to support multiple (~100) different users with their own websites on a CentOS based web server. They need to be able to use Python (v2&v3) along with Django. I understand that systemctl restart is required for apache, that can be arranged by a cron job. However, I have no idea as to the other tips & tricks and requirements from the admin side. Is there a website that will be use to me in setting up of the server? I understand that each of them can run their own web servers (simpleHTTPserver), but it looks very messy to me.

I would be grateful for any help regarding the issue.

2 Answers 2

0

I would suggest using VirtualHosts and automating the setup

You can set it up to that /var/www/<sname> will automatically load for any <sname>.domain.com

Example: going to s1.domain.com and s1.domain.com will automatically load /var/www/s1 and /var/www/s2, respectively.

Nginx

The server_name directive is simply used to match a request to the site; you can use a regex:

server { listen 80; server_name ~^(www\.)?(?<sname>.+?).domain.com$; root /var/www/$sname ... } 

You can use $sname throughout the rest of the config

Apache

This is a little bit complicated but can be done

LoadModule vhost_alias_module modules/mod_vhost_alias.so UseCanonicalName Off <VirtualHost *:80> ServerName vhosts.fqdn ServerAlias *.example.com VirtualDocumentRoot /var/www/%1+ </VirtualHost> 

If you would like to use HTTPS, I'm sure there's an API to generate Letsencrypt certificates

1
  • The problem with Python comes from its virtual environment requirements. The above solution works for PHP, etc., but not adequate for Python. Commented Aug 28, 2017 at 1:15
0

You should front their apps (Django, Flask, whatever pythonic) with a reverse proxy using Nginx.

Then install only the easy_install, setuptools and virtualenv packages in system python. All devs should use their own virtual env to install packages.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.