1. install nginx and add the nginx source [plain] viewplaincopy & lt; spanstyle = & quot; font-size: 18px; & quot; & gt; [nginx] name = nginxrepobaseurl = ingress
1. install nginx
Add nginx source
[Plain]View plaincopy
-
[Nginx]
-
Name = nginx repo
-
Baseurl = http://nginx.org/packages/centos/?releasever/?basearch/
-
Gpgcheck = 0
-
Enabled = 1
-
Install nginx
[SQL]View plaincopy
-
"Font-size: 18px;"> # yum install nginx
2. Compile and install uwsgi
[Plain]View plaincopy
-
# 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
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
-
[Uwsgi]
-
; Plugins = cgi
-
Workers = 4
-
Socket = 127.0.0.1: 9001
-
Cgi =/var/www/cgi-bin
-
Cgi-allowed-ext =. cgi
-
Cgi-allowed-ext =. pl
Nginx configuration
Vi/etc/nginx/conf. d/default
Added. cgi. pl support
[Plain]View plaincopy
-
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