Build nginx + uwsgi + CGI platform under rhel6

Source: Internet
Author: User


1. Install nginx

Add nginx Source

[nginx]name=nginx repobaseurl=http://nginx.org/packages/centos/$releasever/$basearch/gpgcheck=0enabled=1

Install nginx

# yum install nginx


2. Compile and install uwsgi

# Http://projects.unbit.it/uwsgi/wget http://projects.unbit.it/downloads/uwsgi-1.9.13.tar.gztar-zxvf uwsgi-1.9.13.tar.gz # directly compile CGI Mode uwsgi CD uwsgi-1.9.13python uwsgiconfig. py -- Build buildconf/cgi. ini


3 Configuration

Uwsgi ini configuration. The. cgi and. pl extensions are enabled below. The local port 9001 is used to enable four worker processes.

[uwsgi];plugins = cgiworkers = 4socket = 127.0.0.1:9001cgi = /var/www/cgi-bincgi-allowed-ext = .cgicgi-allowed-ext = .pl


Nginx Configuration
VI/etc/nginx/CONF. d/Default
Added. cgi. pl support

location ~ .cgi$ {  include uwsgi_params;  uwsgi_modifier1 9;  uwsgi_pass 127.0.0.1:9001;}location ~ .pl$ {  include uwsgi_params;  uwsgi_modifier1 9;  uwsgi_pass 127.0.0.1:9001;}

4. Start
# Nginx

# Uwsgi-M -- ini CGI. ini-D/var/log/uwsgi/access. Log


5. Test



Perfect.


Refer:

Http://uwsgi-docs.readthedocs.org/en/latest/CGI.html

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.