One server running Django (with Nginx and Apache) and Wordpress Blog

Posted by JCWong on Server Fault See other posts from Server Fault or by JCWong
Published on 2012-10-07T16:22:51Z Indexed on 2012/10/14 15:40 UTC
Read the original article Hit count: 383

Filed under:
|
|
|
|

I have nginx listening to port 80 for my primary site foo.com. It proxys to port 8080 which is where the Django app lives

server {
  listen 80;
  server_name www.foo.com foo.com;
  access_log /home/jeffrey/www/ddt/logs/nginx_access.log;
  error_log /home/jeffrey/www/ddt/logs/nginx_error.log;
  location / {
   proxy_pass http://127.0.0.1:8080;
   include     /etc/nginx/proxy.conf;
  }
  location  /media/ {
   root /home/jeffrey/www/ddt/;
  }
  location  /static/ {
   root /home/jeffrey/www/ddt/;
  }
  location  /public/ {
   root /home/jeffrey/www/ddt/;
  }
}

I'd like to have a wordpress blog run on the same server. Apache is listening to port 8080 with this http.conf file

NameVirtualHost *:8080
WSGIScriptAlias / /home/jeffrey/www/ddt/apache/ddt.wsgi
WSGIPythonPath /home/jeffrey/www/ddt

<Directory /home/jeffrey/www/ddt/apache/>
<Files ddt.wsgi>
Order deny,allow
Allow from all
</Files>
</Directory>

I added my Wordpress site using a virtualhost

<VirtualHost *:8080>
ServerName www.bar.com
ServerAlias bar.com
DocumentRoot /home/jeffrey/www/jeffrey_wp
</VirtualHost>

When I go to bar.com I still see my django app. Is it possible for these two sites to run on the same server?

© Server Fault or respective owner

Related posts about apache2

Related posts about nginx