Hello, My experience with deployment apache+mod_wsgi under windows, for the tutorials/modwsgi/index.html.
Env: Windows 10, Apache/2.4.25 (Win32) OpenSSL/1.0.2k mod_wsgi/4.5.15 Python/2.7 C:/Projects/sqla_demo/ ├── venv/ ├── sqla_demo/ -------------- wsgi.conf: ------------- WSGIPythonPath "C:/Projects/sqla_demo/venv/Lib/site-packages" WSGIScriptAlias /myapp "C:/Projects/sqla_demo/pyramid.wsgi" <Directory C:/Projects/sqla_demo> Require all granted </Directory> ========================= pyramid.wsgi is exactly the same as in tutorials/modwsgi/index.html but ini_path updated: ini_path = 'C:/Projects/sqla_demo/production.ini' ------------------ pyramid.wsgi ------------------ from pyramid.paster import get_app, setup_logging ini_path = 'C:/Projects/sqla_demo/production.ini' setup_logging(ini_path) application = get_app(ini_path, 'main') ========================= Page works correct, can see requests in logs for: MySQL (MySQL-python==1.2.5, SQLAlchemy==1.1.6) Redis (pyramid-redis-sessions==1.0.1) boom -c 50 -n 300 RPS: ~145 (Pretty good) Kind regards On Thursday, 27 October 2011 17:51:43 UTC+3, jkd wrote: > > This is in reply the request for Windows experience with "Running a > Pyramid Application under mod_wsgi" that was made in > > http://docs.pylonsproject.org/projects/pyramid/1.1/tutorials/modwsgi/index.html#modwsgi-tutorial > > . > > I'm a newbie at Python, Pyramid, Apache and mod_wsgi, yet getting it > all to work wasn't as difficult as I had feared. > > The final deployment steps on Windows turned out to be essentially the > same as those in the tutorial above. > > Here's my setup and how I got to the end result: > > A Windows developmental environment for Apache is provided by > WampServer: http://www.wampserver.com . > > A system-wide Python, plus the usual utilities virtualenv and > simple_install, are installed in D:\PF\Python27\. > > For learning about, setting up and testing mod_wsgi with Apache, the > documentation at http://code.google.com/p/modwsgi/ proved to be clear, > thorough and indispensable. > > Also valuable are the docs at the WSGI.org site. They contain > tutorials that further explain and explore WSGI applications. > > Some simple tutorial scripts from WSGI.org were tested, initially > using the wsgiref Python server, and later using Apache+mod_wsgi. > > Then, focus turned to learning Pyramid. > > See: http://docs.pylonsproject.org/projects/pyramid/1.1/index.html . > > Create a new Python environment called PyramidEnv. D:\P\ is my Python > project sandbox. > > D: > cd \P\ > virtualenv --no-site-packages D:/P/PyramidEnv/ > > Activate this environment and install Pyramid in it: > > cd \P\PyramidEnv\ > Scripts\activate > easy_install pyramid > > Create and test the first non-trivial project, calling it MyProject: > > Scripts\paster create -t pyramid_starter MyProject > cd MyProject > ..\Scripts\python setup.py develop > ..\Scripts\python setup.py test -q > > The test results returned an "OK", so paster's server was launched for > a browser test: > > ..\Scripts\paster serve development.ini > > http://127.0.0.1:6543 displayed MyProject's welcome screen. > > A CTRL-C (or two) exited the server loop. To bring the system-wide > Python back, deactivate the PyramidEnv with: > > deactivate > > Before continuing with the tutorial to enhance MyProject, test a > deployment of it to Apache+mod wsgi: > > cd \P\PyramidEnv\ > > Create a WSGI script file in this directory, called RunMyProject, > containing two lines: > > from pyramid.paster import get_app > application = get_app('D:/P/PyramidEnv/MyProject/production.ini', > 'main') > > Set up Apache's mod_wsgi in the header portion of its httpd.conf file: > > WSGIScriptAlias /PE/ D:/P/PyramidEnv/ > WSGIPythonHome D:/P/PyramidEnv/ > > The trailing '/' on '/PE/' indicates that the name of the WSGI script > to be executed will be specified in the requesting URL. > > And allow Apache to access D:/P/PyramidEnv/ with these commands, also > in the header section of httpd.conf: > > <Directory D:/P/PyramidEnv/> > Order allow,deny > Allow from all > </Directory> > > http://127.0.0.1/PE/RunMyProject/ confirms that Apache+mog_wsgi serves > up MyProject's welcome screen. > > ### > -- You received this message because you are subscribed to the Google Groups "pylons-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to pylons-devel+unsubscr...@googlegroups.com. To post to this group, send email to firstname.lastname@example.org. Visit this group at https://groups.google.com/group/pylons-devel. For more options, visit https://groups.google.com/d/optout.