Simply put it bluntly, write down the detailed setup process for record.
(1) install nginx
1.1 download nginx-1.0.5.tar.gz and decompress
1.2./configure (you can also add -- prefix = path to specify the installation path)
In this case, you may be prompted that PCRE support is missing. To install PCRE, you can install PCRE-devel using Yum install PCRE-devel.
1.3 make
1.4 make install
(2) install uwsgi
2.1 Download uwsgi-0.9.8.2.tar.gz and decompress
2.2 make
When you install uwsgi, you may be prompted that libxml2 does not exist. In this case, we recommend that you use the yum install libxml2-devel to solve this problem.
(3) Install Web. py
You can use easy_install web. py to install the latest version. However, I encountered an error while installing 0.36, and it was a syntax error, so I finally rolled back to version 0.35.
(4) use a simple webpyProgramAs an example. BelowCodeIs a complete webpy Program (webpytest. py)
Import weburls = ('/(. *) ', 'Hello') APP = web. application (URLs, globals () Class Hello: def get (self, name): If not name: Name = "world" return "hello" + name + "! "Application = app. wsgifunc ()
The application = app. wsgifunc () in the last sentence is the key. In this case, you can access it through wsgi.
(5) Start uwsgi
Uwsgi-s 127.0.0.1: 9000-W webpytest
(6) Change nginx configuration (nginx. conf)
Server {Listen 80; SERVER_NAME 10.0.11.226; # charset koi8-r; # access_log logs/host. access. log main; Location/{include uwsgi_params; uwsgi_pass 127.0.0.1: 9000; uwsgi_param uwsgi_chdir/usr/local/sphinx; uwsgi_param uwsgi_script webpytest ;}
Note: The uwsgi_pass configuration must be consistent with that when uwsgi is started! Uwsgi_chdir refers to the directory where the program is located, and uwsgi_script refers to the program to be started (note that the py suffix must be removed here). Test results show that uwsgi_chdir and uwsgi_script can also be avoided!
(6) Start nginx
/Usr/local/nginx/sbin/nginx
Restart the nginx command to (/usr/local/nginx/sbin/nginx-s stop)
(7) access through HTTP
Http: // 10.0.11.226
The above is just a very simple setup process, only for record!