Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
What version of django are you using? –  singer Apr 21 '13 at 1:36
    
@singer I'm using 1.5.1 –  marksweb Apr 21 '13 at 16:39
add comment

1 Answer

up vote 0 down vote accepted

My mistake here was an improperly renamed module in my Django project.

I changed mydomain.mydomain to mydomain.myd so then uWSGI was looking for a module named mydomain.mydomain and then the wsgi.py file instead of mydomain.myd.wsgi which is where it had been.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.