tailieunhanh - Web to py enterprise web framework - p 32

APACHE2 AND MOD PYTHON IN A SHARED HOSTING ENVIRONMENT 295 1 nohup python & Then, (re)start the web server with: 1 /etc/ restart Notice that FastCGI binds the web2py server to a Unix socket, not to an IP socket: 1 /tmp/ This is where Lighttpd forwards the HTTP requests to and receives responses from. Unix sockets are lighter than Internet sockets, and this is one of the reasons Lighttpd+FastCGI+web2py is fast. As in the case of Apache, it is possible to setup Lighttpd to deal with static files directly, and to force some applications over HTTPS. Refer to the Lighttpd documentation for details. The administrative interface must be disabled. | APACHE2 AND MOD-PYTHON IN A SHARED HOSTING ENVIRONMENT 295 1 nohup python Then re start the web server with i etc lighttpd restart Notice that FastCGI binds the WEB2py server to a Unix socket not to an IP socket i tmp This is where Lighttpd forwards the HTTP requests to and receives responses from. Unix sockets are lighter than Internet sockets and this is one of the reasons Lighttpd FastCGI web2py is fast. As in the case of Apache it is possible to setup Lighttpd to deal with static files directly and to force some applications over HTTPS. Refer to the Lighttpd documentation for details. The administrative interface must be disabled when WEB2py runs on a shared host with FastCGI or it will be exposed to the other users. Apache2 and modpython in a shared hosting environment There are times specifically on shared hosts when one does not have the permission to configure the Apache config files directly. You can still run WEB2py. Here we show an example of how to set it up using mod_python6 Place contents of WEB2py into the htdocs folder. In the WEB2py folder create a file file with the following contents 1 from mod_python import apache 2 import modpythonhandler 3 4 def handler req 5 PATH_INFO 6 SCRIPT_URL 7 return req Create update the file .htaccess with the following contents 1 SetHandler python-program 2 PythonHandler web2py_modpython 3 PythonDebug On 6Examples provided by Niktar 296 DEPLOYMENT RECIPES Setup Cherokee with FastGGI Cherokee is a very fast web server and like WEB2py it provides an AJAX-enabled web-based interface for its configuration. Its web interface is written in Python. In addition there is no restart required for most of the changes. Here are the steps required to setup WEB2py with Cherokee Download Cherokee 76 Untar build and install 1 tar -xzf 2 cd 3 . configure --enable-fcgi make 4

TỪ KHÓA LIÊN QUAN