Obviously I was wrong to assume adding a subdomain would be as straightforward as duplicating my existing domain & adding a DNS A record.
So I tried to run cp -r /var/www/mydomain.com/ /var/www/dev.mydomain.com
& configure a subdomain from the original domain settings, but now it gives a 'Python application not found' error on my original domain.
I have a VDS running Ubuntu, Nginx and uWSGI to serve Django with the following configuration;
/var/www/mydomain.com
- /conf
-- /nginx.conf
-- /uwsgi.conf
- /logs
- /src
- /venv
Nginx is setup to read configs from /var/www/*/conf/nginx.conf
uWSGI is set to startup with a Daemon and this is my uwsgi.conf;
[uwsgi]
# variables
projectname = mydomain
projectdomain = mydomain.com
base = /var/www/mydomain.com
# config
plugins = python
master = true
protocol = uwsgi
env = DJANGO_SETTINGS_MODULE=%(projectname).settings
pythonpath = %(base)/src/%(projectname)
module = %(projectname).wsgi
#module = mydomain.wsgi
#module = mydomain.wsgi:application
#socket = /tmp/%(projectdomain).sock
socket = 127.0.0.1:8889
logto = %(base)/logs/uwsgi.log
# below line runs as a daemon in background
daemonize = /var/log/uwsgi/mydomain.log
And I've pastebined my uwsgi domain log if it helps
I'm still new to uwsgi/nginx (if you hadn't guessed!) so could anyone offer a suggestion for my problem or could I provide some more detail?