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