EIDA / webdc3

WebDC3 is the webinterface for EIDA.
http://geofon.gfz-potsdam.de/software/webdc3/
GNU General Public License v3.0
11 stars 10 forks source link

try to install webdc3 #33

Open lp880 opened 4 years ago

lp880 commented 4 years ago

Hello i try to install webdc3 but aofter Javier tell me to run python update-metadata.py -l DEBUG --singlenode "http://geofon.gfz-potsdam.de/fdsnws/station/1" it work in folder data is created xml files.

I go on web interface but in console give me that errors: ![image]()

What is the next step In the documentation nothing is written about these files as they are obtained

andres-h commented 4 years ago

Those are not static files, but entry points to the WSGI web service, eg.:

https://github.com/EIDA/webdc3/blob/fc42103fe502903eda19109bf429fde33bda4c54/wsgi/modules/metadata.py#L90

It seems you have a problem with WSGI installation, so either the web server is looking for static files instead of running the web service or (more likely in this case) there is an error loading WSGI modules.

WebDC has two major components -- one is Javascript, the other is WSGI web service providing the required metadata to Javascript. The latter is not working properly in your case.

At first try to open "loader", eg., http://eida.gfz-potsdam.de/webdc3/wsgi/loader. If this works, your WSGI is basically working.

Now try "metadata/networktypes", eg., http://eida.gfz-potsdam.de/webdc3/wsgi/metadata/networktypes. If you get "404 Not Found" (as expected from the above picture), there is probably an error loading the metadata.py module. Most likely the SC3 modules cannot be found.

Making the SC3 environment (PYTHONPATH, LD_LIBRARY_PATH) available to WSGI can be tricky and it depends on Linux distribution and web server. I haven't used Apache in a while, but our nginx/uwsgi example is here.

lp880 commented 4 years ago

Thanks for reply Andres, but when i try to install i stuck on documentation.

When I downloaded the files from github I didn't find in wsgi the metadata folder, so I created it manually. But I don't think that's right. I can not find in the documentation how to.

What I have done so far is as follows: I downloaded the files from git I uploaded them to the server, I put the wsgi module in apache2, I modified the virtual host as it says in the documentation, I put SEISCOMP_ROOT / etc / webinterface.cfg. and here I stopped, I do not know what steps I am taking because the documentation stop here.

Please can you tell me the steps that need to be taken to be a functional interface. Thank you.

andres-h commented 4 years ago

When I downloaded the files from github I didn't find in wsgi the metadata folder, so I created it manually. But I don't think that's right. I can not find in the documentation how to.

The documentation does not mention the metadata folder, because it is virtual (implemented in the Python script) and should not be created by the user.

If you can access "loader", but not "metadata/networktypes", then most likely the environment variables (SEISCOMP_ROOT, LD_LIBRARY_PATH, PYTHONPATH) are not seen by the Python script. Another possibility is that the Apache user does not have access to ~/seiscomp3.

You should see an error message in Apache error log.

I downloaded the files from git I uploaded them to the server, I put the wsgi module in apache2, I modified the virtual host as it says in the documentation, I put SEISCOMP_ROOT / etc / webinterface.cfg. and here I stopped, I do not know what steps I am taking because the documentation stop here.

If everything goes as expected, this should be all, I think.

lp880 commented 4 years ago

If you can access "loader", but not "metadata/networktypes", then most likely the environment variables (SEISCOMP_ROOT, LD_LIBRARY_PATH, PYTHONPATH) are not seen by the Python script. Another possibility is that the Apache user does not have access to ~/seiscomp3.

I can't access the loader and is no file "loader" in wsgi folder.

Do I have to manually create the loader file with similar:

window.eidaServiceRoot="/webdc3/wsgi"; window.eidaCSSSource="/webdc3/css"; window.eidaJSSource="/webdc3/js"; window.eidaDebug=false; $('head').append($('').attr({rel:'stylesheet',type:'text/css',href:"/webdc3/css/wimodule.css"})); $.getScript("/webdc3/js/webdc3.min.js");

andres-h commented 4 years ago

Do I have to manually create the loader file with similar:

No, "loader" is a Python function too.

See our (working) installation:

$ ls webdc3/wsgi descriptions eida.py inventorycache.py inventorycache.pyc modules webdc3.conf.sample webdc3.wsgi webinterface.cfg.sample webinterface.py webinterface.pyc wsgicomm.py wsgicomm.pyc

If "loader" does not work, then you have a problem with WSGI in general. Do you have mod_wsgi (for Python 2) installed? Eg., on Ubuntu/Debian you'll need the libapache2-mod-wsgi package.

See if the Python scripts are executed at all and check Apache's error log.

lp880 commented 4 years ago

Hello, sorry for long response.

This is the error log

Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 mod_python/3.3.1 Python/2.7.6 mod_wsgi/3.4 configured -- resuming normal operations

mod_wsgi (pid=24797): Target WSGI script '/var/www/et.infp.ro/wsgi/webdc3.wsgi' cannot be loaded as Python module., referer: http://et.infp.ro/error.html mod_wsgi (pid=24797): Exception occurred processing WSGI script '/var/www/et.infp.ro/wsgi/webdc3.wsgi'., referer: http://et.infp.ro/error.html Traceback (most recent call last):, referer: http://et.infp.ro/error.html File "/var/www/et.infp.ro/wsgi/webdc3.wsgi", line 6, in , referer: http://et.infp.ro/error.html import webinterface, referer: http://et.infp.ro/error.html File "/var/www/et.infp.ro/wsgi/webinterface.py", line 234, in , referer: http://et.infp.ro/error.html wi = WebInterface(name), referer: http://et.infp.ro/error.html File "/var/www/et.infp.ro/wsgi/webinterface.py", line 96, in init, referer: http://et.infp.ro/error.html self.ic = InventoryCache(inventory), referer: http://et.infp.ro/error.html File "/var/www/et.infp.ro/wsgi/inventorycache.py", line 102, in init, referer: http://et.infp.ro/error.html self.update(), referer: http://et.infp.ro/error.html File "/var/www/et.infp.ro/wsgi/inventorycache.py", line 154, in update, referer: http://et.infp.ro/error.html with open(self.cachefile) as cache:, referer: http://et.infp.ro/error.html

and this is webdc3 file: `import os import sys

sys.path.insert(0, '/var/www/et.infp.ro/wsgi/')

import webinterface

application = webinterface.application`

andres-h commented 4 years ago

File "/var/www/et.infp.ro/wsgi/inventorycache.py", line 154, in update, referer: http://et.infp.ro/error.html with open(self.cachefile) as cache:, referer: http://et.infp.ro/error.html

Looks like the webserver user does not have permission to open the cache file.

lp880 commented 4 years ago

yes, i will do that permission but this error : mod_wsgi (pid=24797): Target WSGI script '/var/www/et.infp.ro/wsgi/webdc3.wsgi' cannot be loaded as python module. ?

andres-h commented 4 years ago

The error is misleading. The script cannot be loaded because of exception when trying to open the file.

lp880 commented 4 years ago

Thanks, i will give permission and will see next.

lp880 commented 4 years ago

Hello Andres, can we talk in privat ? Email or whatsapp?