How to Set Up Django and Wordpress running with Nginx for the same Ubuntu Service

Source: Internet
Author: User
Tags php website wordpress blog
I rented an aliyun server and now it runs Django + fastcgi and runs normally. I want to add a wordpress blog, use php5-fpm. Blog. conf configuration: {code ...} I want to use the second-level domain name blog.joinwee.com, re-activated the php5-fpm, but the access is still prompted to be inaccessible... I rented an aliyun server and now it runs Django + fastcgi and runs normally. I want to add a wordpress blog, use php5-fpm.

Blog. conf configuration:
server {listen 80;server_name blog.joinwee.com;error_log /alidata1/wwwlogs/blog.error.log;access_log /alidata1/wwwlogs/blog.access.log;location / {        index index.html index.htm index.php;        root /alidata1/wordpress/;        if (-f $request_filename/index.html){                rewrite (.*) $1/index.html break;        }        if (-f $request_filename/index.php){                rewrite (.*) $1/index.php;        }        if (!-f $request_filename){                rewrite (.*) /index.php;        }}location ~ \.php$ {        include fastcgi_params;        fastcgi_index index.php;        #fastcgi_pass 127.0.0.1:53217;        #fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;        fastcgi_pass unix:/var/run/php5-fpm.sock;        }}

To use the second-level domain name blog.joinwee.com, The php5-fpm is re-activated, but the access is still promptedUnable to access this webpage

Can the Server Run django and php at the same time? How do I set it?

Reply content:

I rented an aliyun server and now it runs Django + fastcgi and runs normally. I want to add a wordpress blog, use php5-fpm.

Blog. conf configuration:
server {listen 80;server_name blog.joinwee.com;error_log /alidata1/wwwlogs/blog.error.log;access_log /alidata1/wwwlogs/blog.access.log;location / {        index index.html index.htm index.php;        root /alidata1/wordpress/;        if (-f $request_filename/index.html){                rewrite (.*) $1/index.html break;        }        if (-f $request_filename/index.php){                rewrite (.*) $1/index.php;        }        if (!-f $request_filename){                rewrite (.*) /index.php;        }}location ~ \.php$ {        include fastcgi_params;        fastcgi_index index.php;        #fastcgi_pass 127.0.0.1:53217;        #fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;        fastcgi_pass unix:/var/run/php5-fpm.sock;        }}

To use the second-level domain name blog.joinwee.com, The php5-fpm is re-activated, but the access is still promptedUnable to access this webpage

Can the Server Run django and php at the same time? How do I set it?

We need to use two server blocks, which are written in django and php respectively.
After writing, restart Nginx (or reload ).

Since it does not seem to be under the same domain name, it is divided into two servers to write
After all, nginx is only used for reverse generation.
My own servers are currently running both php and django.
I used the lnmp.org of June to build the lnmp environment,
When you need to run a php website, you can directly use vhost. sh
When running django, I use supervisord and uwsgi, and then manually write a copy of nginx for reverse generation.

Two servers or custom modification agents. To put it bluntly, nginx is only a proxy. You can customize the backend by yourself.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.