Same Ubuntu service with Nginx run Django and WordPress how to set up

Source: Internet
Author: User
Tags php website wordpress blog aliyun
Rented is the Aliyun server, now running django+fastcgi, normal operation. Want to add a WordPress blog up, with 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;        }}

Want to use the level two domain name blog.joinwee.com, the PHP5-FPM is moved, but the visit is still a hint无法访问此网页

Could the server run both Django and PHP at the same time? How do I set it up?

Reply content:

Rented is the Aliyun server, now running django+fastcgi, normal operation. Want to add a WordPress blog up, with 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;        }}

Want to use the level two domain name blog.joinwee.com, the PHP5-FPM is moved, but the visit is still a hint无法访问此网页

Could the server run both Django and PHP at the same time? How do I set it up?

Use two server blocks, which are written in terms of Django and PHP, respectively.
After writing, pay attention to restarting the nginx (or reload).

Since it seems not under the same domain name, it is divided into 2 servers to write
After all, Nginx is just for the reverse.
My own server is currently running PHP and Django at the same time.
I used the lnmp.org of the military brother to build the LNMP environment,
When you need to run a PHP website, use vhost.sh directly
Need to run Django, I use Supervisord and Uwsgi, and then manually write a nginx to reverse the

2 server, or custom modification agent, plainly nginx is just a proxy, you make your own back-end can

  • 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.