1. Install nginx
Add nginx Source
[Plain] view plaincopy
<Span style = "font-size: 18px;"> [nginx]
Name = nginx repo
Baseurl = http://nginx.org/packages/centos/?releasever/?basearch/
Gpgcheck = 0
Enabled = 1
</Span>
Install nginx
[SQL] view plaincopy
<Span style = "font-size: 18px;"> # yum install nginx </span>
2. Compile and install uwsgi
[Plain] view plaincopy
<Span style = "font-size: 18px;"> # http://projects.unbit.it/uwsgi/
Wget http://projects.unbit.it/downloads/uwsgi-1.9.13.tar.gz
Tar-zxvf uwsgi-1.9.13.tar.gz
# Directly compile the cgi Mode uwsgi
Cd uwsgi-1.9.13
Python uwsgiconfig. py -- build buildconf/cgi. ini </span>
3 Configuration
Uwsgi ini configuration. The. cgi and. pl extensions are enabled below. The local port 9001 is used to enable four worker processes.
[Plain] view plaincopy
<Span style = "font-size: 18px;"> [uwsgi]
; Plugins = cgi
Workers = 4
Socket = 127.0.0.1: 9001
Cgi =/var/www/cgi-bin
Cgi-allowed-ext =. cgi
Cgi-allowed-ext =. pl </span>
Nginx Configuration
Vi/etc/nginx/conf. d/default
Added. cgi. pl support
[Plain] view plaincopy
<Span style = "font-size: 18px;"> 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;
} </Span>
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