A few general comments/questions are described below.
See also this story's subtasks.
1. Hardwired localhost
There seems to be quite a lost of calls to localhost in the code. I think this might cause some problems when running on Apache into a docker container, but I'm not sure how....
Update: problem solved, I think.
2. /ws_service and /wikispeech/lexserver
ws_service needs to be proxy mapped in apache (see apache config file below).
Both of these URL prefixes seem to have the same function. Maybe only one of them is needed?
wikispeech_server/wikispeech.py contains a hardwired proxy to the lexicon server?
@app.route('/wikispeech/lexserver/<path:url>')
def lexserver_proxy(url):
redirect_url = "http://localhost:8787/%s%s" % ((url, "?" + request.query_string.decode("utf-8") if request.query_string else ""))I tried to configure this as a proxy in apache's config file instead but it doesn't seem to work in the same way.
I don't think this causes trouble atm, but should preferably not be hardwired in the future....?
3. Apache config
- Do these proxies really have to exist?
- Naming looks a bit weird. ws_service should be rather be pronlex?
- What about /wikispeech/lexserver? Should be proxy mapped or not used at all....?
/etc/apache2/sites-available/000-default.conf :
#HB 170329
ProxyPreserveHost On
ProxyPass /wikispeech/ http://127.0.1.1:10000/wikispeech/
ProxyPassReverse /wikispeech/ http://127.0.1.1:10000/wikispeech/
ProxyRequests Off
#HL 170911
ProxyPreserveHost On
ProxyPass /ws_service/ http://127.0.1.1:8787/
ProxyPassReverse /ws_service/ http://127.0.1.1:8787/
ProxyRequests Off