Skip to content

Latest commit

 

History

History
54 lines (37 loc) · 2.58 KB

WEBSERVICE_INSTRUCTIONS.rst

File metadata and controls

54 lines (37 loc) · 2.58 KB

Your new CLAM project has been set up!

DEVELOP YOUR WEBSERVICE

To develop your webservice, edit your service configuration file /home/wstoop/glem/webglem/webglem/webglem.py , the host specific configuration file /home/wstoop/glem/webglem/webglem/webglem.$HOSTNAME.yml, and your system wrapper script /home/wstoop/glem/webglem/webglem/webglem_wrapper.py (or /home/wstoop/glem/webglem/webglem/webglem_wrapper.sh if you prefer to use a simple shell script rather than Python).

Keep host-specific settings out of the service configuration file and instead put it in the respective config.$HOSTNAME.yml file that is automatically included by the service configuration. Create a new one for each host you plan to deploy this webservice on.

Consult the CLAM Documentation and/or instruction videos on https://proycon.github.io/clam for further details on how to do this.

Also don't forget to edit the metadata in the setup script /home/wstoop/glem/webglem/setup.py and run python setup.py install to install the webservice after you made any changes (the start scripts provided will do so automatically for you).

START YOUR WEBSERVICE

Whilst you are in the process of building your CLAM webservice, you can start and test your webservice using the built-in development webserver, start it with ./startserver_development.sh . This takes care of any installation as well. Once started, you can point your browser to the URL advertised by this script.

DEPLOYING YOUR WEBSERVICE (for system administrators)

For production use, we recommend using uwsgi in combination with a webserver such as Apache (with mod_uwsgi_proxy), or nginx. A uwsgi configuration has been generated (webglem.$HOSTNAME.ini); it is specific to the host you deploy the webservice on. This in turn loads the wsgi script (webglem.wsgi), which loads your webservice.

Sample configurations for nginx and Apache have been generated as a starting point, add these to your server and then use the ./startserver_production.sh script to launch CLAM using uwsgi.

VERSION CONTROL

We strongly recommend you to put /home/wstoop/glem/webglem and everything inside under version control (e.g. git). To create a new git repository:

cd /home/wstoop/glem/webglem
git init
git add *
git commit -m "generated by clamnewproject"

VIRTUAL ENVIRONMENT

We strongly recommend the use of a Python virtual environment for your CLAM webservice, both in development and in production.