tailieunhanh - Web to py enterprise web framework - p 31

SETUP MOD WSGI ON LINUX 285 The Apache logs are in: 1 /var/log/apache2/ Setup mod wsgi on Linux Download and unzip web2py source on the machine where you installed the web server above. Install web2py under /users/www-data/, for example, and give ownership to user www-data and group www-data. These steps can be performed with the following shell commands: 1 2 3 4 cd /users/www-data/ sudo wget sudo unzip sudo chown -R www-data:www-data /user/www-data/web2py To set up web2py with mod wsgi, create a new Apache configuration file: 1 /etc/apache2/sites-available/web2py and include the following code: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18. | SETUP MOD-WSGI ON LINUX 285 1 1 2 3 4 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 The Apache logs are in var log apache2 Setup on Linux Download and unzip WEB2py source on the machine where you installed the web server above. Install WEB2py under users www-data for example and give ownership to user www-data and group www-data. These steps can be performed with the following shell commands cd users www-data sudo wget http examples static sudo unzip sudo chown -R www-data www-data user www-data web2py To set up WEB2py with mod_wsgi. create a new Apache configuration file etc apache2 sites-available web2py and include the following code VirtualHost 80 ServerName WSGIDaemonProcess web2py user www-data group www-data display-name GROUP WSGIProcessGroup web2py WSGIScriptAlias users www-data web2py Directory users www-data web2py AllowOverride None Order Allow Deny Deny from all Files Allow from all Files Directory AliasMatch static . users www-data web2py applications 1 static 2 Directory users www-data web2py applications static Order Allow Deny Allow from all Directory Location admin Deny from all Location LocationMatch appadmin Deny from all 286 DEPLOYMENT RECIPES 30 LocationMatch 31 32 CustomLog private var log apache2 common 33 ErrorLog private var log apache2 34 VirtualHost When you restart Apache it should pass all the requests to web2y without going through the CherryPy wsgiserver. Here are some explanations 1 WSGIDaemonProcess web2py user www-data group www-data 2 display-name GROUP defines a daemon process group in context of . By defining this inside of the virtual host only this virtual host including any virtual host for same server name but on a different port can access this using WSGIProcessGroup. The user and group options should be setto the user who has write access to the .

TỪ KHÓA LIÊN QUAN