Flask based website to display University of Miami geodesylab volcano displacement timeseries data.
| Location | Role |
|---|---|
$MINSAR_HOME/tools/VolcDef_web (this repo) |
Where you edit code in development (e.g. under minsar/tools/VolcDef_web). |
/var/www/VolcDef_web |
What Apache/WSGI actually runs (web.wsgi, volcdef_web/app.py, web_env). |
Changes made in the MinSAR repo are not live until you deploy them to /var/www/VolcDef_web, for example:
# Example: sync Python package (adjust host/user as needed)
sudo rsync -a --delete /path/to/minsar/tools/VolcDef_web/volcdef_web/ /var/www/VolcDef_web/volcdef_web/
sudo systemctl reload apache2Or maintain /var/www/VolcDef_web as a git clone / git pull of VolcDef_web and pull on the server after merging changes from the minsar copy.
c## Installation
- Go to
/var/www/and clone the repository (on a new server you may need your private and public key in ~/.ssh for git to work)
git clone git@github.com:geodesymiami/VolcDef_web
git clone git@github.com:geodesymiami/webconfig
(preferred), or if cloned into the $MINSAR_HOME/tools directory create a symbolic link:
sudo ln -s /home/exouser/code/minsar/tools/VolcDef_web /var/www
- Install the required packages into a virtual environment (first adjust ownership):
USER=exouser
sudo chown -R $USER:$USER /var/www/VolcDef_web
python -m venv web_env
source web_env/bin/activate
pip install -r requirements.txt
-
Make sure the MAPBOX_ACCESS_TOKEN is set in
mapbox_access_token.env(orcp ~/accounts/mapbox_access_token.env .). -
Volcano list (production)
The app uses/var/www/webconfig/volcanoes_volcdef.json(if not available sibling../webconfig/volcanoes_volcdef.json, thenWEBCONFIG_DIR/volcanoes_volcdef.json. Seevolcdef_web/app.py(get_volcanoes_json_path).SetEnv WEBCONFIG_DIR /var/www/webconfigis set involcdef_web.conf. -
Run the website
cd volcdef_web/
python run.py
- Check whether website is running using
curl -s http://127.0.0.1:5001
or open website at the given address (chrome/safari)
127.0.0.1:5001
-
On the remote server, configure Apache by copying volcdef_web.conf to /etc/apache2/sites-available/ (
sudo cp volcdef_web.conf /etc/apache2/sites-available/)((Ubuntu,/etc/httpd/conf.dfor Alma/RedHat) (usevolcdef_web.conf_jetstreamis /data/HDFEOS5 lives on server running Apache). -
Start Apache using:
sudo a2ensite volcdef_web.conf
sudo systemctl restart apache2
- Check for errors using:
sudo tail -20 /var/log/apache2/error.log
If you see a Traceback, then python could not properly run your web.wsgi or app.py.
To update the volcano list, go to /var/www/webconfig and update using git pull. Else, run make_volcdef_volcanoes_json.py in /var/www/webconfig or with --outdir /var/www/webconfig. Reload Apache after updating the JSON so WSGI reloads (sudo systemctl restart apache2); JSON alone may require a process reload depending on setup.