jrreich / MEO_Analysis_HTML_Interface

HTML, CSS, JS, Flask and Python code to implement MEOLUT analysis
1 stars 1 forks source link

List of features to add, but mainly things to fix to get it workign #1

Open jrreich opened 7 years ago

jrreich commented 7 years ago

Features to add:

Javascript for:

Closed out features

Bugs:

jrreich commented 7 years ago

Things that will have to be done to get apache on windows serving flask app:

Changes to code:

Installation on App Server:

  1. Install Python
  2. Install PIP (optional - will be installed with virtualenv)
  3. Install virtualenv.

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