Open jrreich opened 7 years ago
Changes to code:
Installation on App Server:
make sure you install the proper mod_wsgi binary (don't build from source). For python 2.7, apache 2.4, win x64, use VC10/VC9 - (Apache24-win64-VC10) > (mod_wsgi-py27-VC9.so) mod_wsgi-windows-4.4.12.tar.gz Then move the appropriate module (see above -- mod_wsgi-py27-VC9.so) file to the modules folder and rename to just "mod_wsgi.so"
Add the below to httpd.conf: WSGIApplicationGroup %{GLOBAL} is need for numpy and pandas I think
## mod wsgi_
WSGIRestrictStdout Off #allows 'prints' to print to apache error log
LoadModule wsgi_module modules/mod_wsgi.so
WSGIScriptAlias / C:\Users\reichj\Source\Repos\MEO_Analysis_HTML_Interface\myapp.wsgi
DocumentRoot "C:\Users\reichj\Source\Repos\MEO_Analysis_HTML_Interface" #probably not needed
<Directory C:\Users\reichj\Source\Repos\MEO_Analysis_HTML_Interface>
WSGIApplicationGroup %{GLOBAL}
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Require all granted
</Directory>
I had to do this when I was importing matplotlib
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
Had to make all of the file paths absolute instead of relative to the app's working directory. So had to do a lot of
approot = os.path.dirname(__file__)
os.path.join(approot, filename)
To Install Apache as a service:
In most cases you will want to run Apache as a Windows Service.
To do so you install Apache as a service by typing at the command prompt [1];
httpd -k install
You can then start Apache by typing
httpd -k start
Apache will then start and eventually release the command prompt window.
[1] You have to run the command prompt as Administrator in Windows Vista/7/2008/8/8.1/10/2012/
Other Command line options:
Stop Apache httpd -k stop
Restart Apache httpd -k restart
Uninstall Apache Service httpd -k uninstall
Test Config Syntax httpd -t
Version Details httpd -V
Command Line Options List httpd -h
Features to add:
Javascript for:
Closed out features
Bugs: