5
I have some systems based in Django that often need to be deployed (Deployed) on different servers. This involves, among other things, installing all the dependencies, downloading the project files, putting them in a standardized folder, etc., all of which can be done through a simple script.
However, a part of this process I have always done manually, since I don’t know a good way to automate/semi-automate:
- Make basic Apache configuration (if it’s your first installation as well);
Create a virtual host for my application; in general it is just a file more or less with this format:
<VirtualHost X.X.X.X:443> SSLEngine On ServerName <<nome do servidor>> ServerAlias <<nome alternativo>> ServerAdmin <<e-mail do administrador>> DocumentRoot /opt/<<pasta da aplicação>> Alias /media/ /opt/<<pasta da aplicação>>/media/ Alias /static/ /opt/<<pasta da aplicação>>/static/ WSGIDaemonProcess <<processo wsgi>> user=<<usuario>> group=<<grupo>> threads=1 WSGIProcessGroup <<grupo wsgi>> WSGIScriptAlias / /opt/<<pasta da aplicação>>/aplicacao.wsgi </VirtualHost>
to be placed in the
sites-available
linked tosites-enabled
. This is the easiest: in the last case, I can generate the data file the desired parameters. But if there is a simpler way, better.
There are tools - from Apache itself or third parties (preferably open-source) - to simplify this configuration, without needing to edit the httpd.conf
and its various referenced files? Or, if the answer is no, what is the best way to programmatically edit these files? Unlike popular formats like XML, JSON and YAML, I don’t know any reader/writer for their format.
P.S. I am assuming a Linux/Unix environment, and the programming language doesn’t matter (but if there is a solution in Python, so much the better).
I am going to jabá the company of a friend of mine who works with configuration only: https://configr.com/
– Leonel Sanches da Silva