yes that seems wrong, as the name for the process, which is the 2nd part ‘admin-django’ in your example has to be different for each vhost. if you run multiple vhost and they have the same name there you’ll see that ‘duplicate’ message.
from the template this should be put together from the web-domain plus the -django… part, hence
%domain%-django-ssl
or
%domain%-django
depending on the template… in your example it seem to more likely use %user%-django instead - maybe you can check your .tpl file again, if you just accidentically put the wrong var in there?
having %domain% there makes much more sense, as exactly that would be the key differantiator and not the user name
and check the ouput… according to the error you should see a name for that procces at least twice and the files which contain these lines
maybe that helps to narrow it down. I have a feeling that you are quite close already…
Yeah, I tried that, but it was appearing only once…
I really have interest in making this work because I see PHP too limited… And definitely more insecure than Python. But I’m running out of ideas on how to fix this…
from the snippet of your tpl/stpl you posted first it seems to be in there… from the quote of the ready made config later it seems to be missing. maybe run the same find for the processgroup again and check if it’s there at all and differs for ssl vs non-ssl.
I know it’s grasping at straws though… I am simply also running out of ideas, but I strongly believe that the error message is usually very close to the real problem
Yes, that’s one one the different approaches I tried. Maybe because how HestiaCP is designed there’s something that’s is causing the error with the duplicated names. I will try using an alternative to WSGI, maybe that way it works.
As I said, I have particular interest in making this work because I find PHP very limited and insecure. If make it work I think it’s just natural to share the way to do it with the community.
Just a note: Python is much older than PHP yet still php became the de facto backend platform in the early 2000s and this didn’t hapend because it was limited or insecure.
The recent hype python enjoyed in the recent years is mostly related to usage in data science fields, but on the web front not much has improved in the last 2 decades, as even this one month old thread shows; setting apache to serve multiple python apps shouldn’t take this long, even for a beginner.
This being said, extending support for other backends like python,node,deno or lxc/docker is something we will have to improve in the future
How relaxed/random are the content types in PHP is one of the multiple examples of how insecure it is. PHP was a good option years ago, but I don’t see many reasons to stick to it when there are many other alternatives (not just Django).
I have installed and running several websites using Django. The difficulties here are related to make it run with HestiaCP.
This is an interesting debate, although I would like not to divert too much from the main topic of the original post.
I have skimmed trough the thread and the problem is definitely not related to Hestia but with the Apache vhost config (maybe even python venv or wsgi entrypoint).
After all Hestia is just copying the template to apache and resolves the placeholder values if finds there (like %domain% %user% etc). When creating the template you have complete freedom to add anything you want there.
So if you have a standalone Apache config able to handle multiple wsgi apps it should not take more than a couple minutes to convert it to a template.
PS OT: Relaxed types are common to most dynamically typed lang like py,js,perl,ruby and that does not make them insecure. If you prefer more strict types then C#, golang might be worth looking into. (Last comment on this subj)
OK, new release, in case someone wants to test it:
I also noticed something while I was “hunting dragons” in the code. If you check the lines 42-51 in Django_app.sh you will notice that there are some lines commented out. This is because for some strange reason, the if that adds content to the file in case it exists (which by the way, I know that the piece of code that I was attempting to add is wrong) is being executed after the next if. This might be (or might not be) the cause why WSGI approach of these templates is not working.
Is anyone able to try these templates, please? You should be able to finally see this error when you access to your domain:
But it is solved just adding your domain and IP to the section ALLOWED_HOST in the Django app configuration and then restarting gunicorn with systemctl restart gunicorn.
It’s also necessary to follow this order to activate the templates (applying after each change):
Select Django_proxy_pass as NGINX template
Select Socket as Backend Template PHP-FPM (not sure if this is necessary)
Select Django as Apache2 template.
In the next iteration I will sort the limitation of only 1 Django app per server.