views:

41

answers:

1

I'm currently working on developing a personal Django site that will consist of various technologies / subdomains. My main page(s) will be Django, with a blog.blah.com subdomain that runs wordpress, and several other subdomains for projects (project1.blah.com, project2.blah.com), that are static HTML files (created with Sphinx).

I'm having a lot of trouble organizing my file hierarchy and web server configurations. I'm currently running Apache on port 8080 which serves the Django stuff via mod_wsgi, and I use NGINX on port 80 to handle requests and proxying.

Here's my current filesystem layout. NOTE: I run ALL websites under a single user account.

blah@blah:~$ tree
.
`-- sites
    |-- blah.org
    |   |-- logs
    |   |-- blah
    |   |   |-- apache
    |   |   |   |-- blah.conf
    |   |   |   `-- blah.wsgi
    |   |   |-- INSTALL
    |   |   |-- nginx
    |   |   |   `-- blah.conf
    |   |   |-- blah
    |   |   |   |-- app1
    |   |   |   |   `-- models.py
    |   |   |   |-- app2
    |   |   |   |   `-- models.py
    |   |   |   |-- manage.py
    |   |   |   |-- settings.py
    |   |   |   `-- urls.py
    |   |   `-- README
    |   `-- private
    `-- blah2.org

Can anyone help me figure out where to place files for a best-practices type of deployment? The structure above ONLY contains my Django code. I've got no idea where to put my static content files (eg: html subdomain sites), and my other services (eg: wordpress stuff).

Any help would be greatly appreciated! Bonus points if you show off your directory structure.

+1  A: 

I put my stuff in /srv/www/blah.org/ like this:

-- blah.org
  | -- media
  | -- amedia
  | -- templates
  | -- blah
     | django app
     ...
  | -- settings.py
  | -- config
     | -- crontab
     | -- blag.org.conf (nginx)
  | -- manage.py

Then I confiugure static /media/ and /amedia/ with nginx and proxy everything else to gunicorn serving django.

iElectric
That looks nice, but what do you do about subdomains? For example, what do you do if you want to serve an all static webpage subdomain (test.blah.org) which consists of only HTML files? Or a blog.blah.org subdomain which needs to run wordpress and has to have some apache configs?
b14ck
put stuff in /srv/www/blog.blag.org/
iElectric