Advertisement
Guest User

Untitled

a guest
Mar 6th, 2015
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.49 KB | None | 0 0
  1. ----from windows httpd.conf ---
  2.  
  3. WSGIScriptAlias /moin2/ /home/web/m2-fixedleft/moin2.wsgi/
  4. <Directory "C:/home/web/m2-fixedleft/">
  5. Options None
  6. AllowOverride None
  7. Order allow,deny
  8. Allow from all
  9. ExpiresActive On
  10. ExpiresDefault "access plus 3600 seconds"
  11. </Directory>
  12.  
  13. ----my wsgi file used for both windows and centos ----
  14.  
  15. # -*- coding: iso-8859-1 -*-
  16. """
  17. MoinMoin - mod_wsgi driver script
  18.  
  19. To use this, add those statements to your Apache's VirtualHost definition:
  20.  
  21. # you will invoke your moin wiki at the root url, like http://servername/ItemName:
  22. WSGIScriptAlias / /some/path/moin.wsgi
  23.  
  24. # create some wsgi daemons - use someuser.somegroup same as your data_dir:
  25. WSGIDaemonProcess moin-wsgi user=someuser group=somegroup processes=5 threads=10 maximum-requests=1000 umask=0007
  26.  
  27. # use the daemons we defined above to process requests!
  28. WSGIProcessGroup moin-wsgi
  29.  
  30. @copyright: 2010 by MoinMoin:ThomasWaldmann
  31. @license: GNU GPL, see COPYING for details.
  32. """
  33.  
  34. # hint: use None as value if the code already is in sys.path
  35. # moin_code = None # '/path/to/code'
  36.  
  37. # wiki_config = '/path/to/config/wikiconfig.py'
  38.  
  39. import sys, os, site
  40.  
  41. # print '==moin2.wsgi==', sys.path
  42. # per http://code.google.com/p/modwsgi/wiki/VirtualEnvironments
  43. if sys.platform == 'win32':
  44. site.addsitedir('/home/web/m2-fixedleft-venv-python/Lib/site-packages')
  45. # site.addsitedir('/python26/Lib/site-packages')
  46. # activate_this = '/home/web/m2-fixedleft/env/Scripts/activate_this.py'
  47. else:
  48. site.addsitedir('/home/rockart/webapps/web/m2-fixedleft-venv-python/lib/python2.7/site-packages')
  49. # activate_this = '/home/rockart/webapps/web/moin-2.0/env/bin/activate_this.py'
  50. # execfile(activate_this, dict(__file__=activate_this))
  51. print '= moin2.wsgi sys.path =\n',
  52. for p in sys.path:
  53. print p
  54. print '== end sys.path ==\n'
  55. #~ wiki_config = os.path.dirname(os.path.abspath(__file__)) + '/wikiconfig.py'
  56. wiki_config = os.path.dirname(os.path.abspath(__file__)) + '/wikiconfig_local.py'
  57. moin_code = os.path.dirname(os.path.abspath(__file__))
  58.  
  59. if moin_code:
  60. # add the parent dir of the MoinMoin code to sys.path,
  61. # to make import work:
  62. sys.path.insert(0, moin_code)
  63.  
  64. # application is the Flask application
  65. from MoinMoin.app import create_app
  66. application = create_app(wiki_config)
  67.  
  68. # please note: if you want to do some wsgi app wrapping, do it like shown below:
  69. #application.wsgi_app = somewrapper(application.wsgi_app)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement