<div dir="ltr">







<p class="">







</p><p class="">Trying to follow instructions from<font color="#484848" face="HelveticaNeue, helvetica, arial, clean, sans-serif" style="font-size:13px"><span style="line-height:19px"> </span></font><a href="http://www.paraview.org/ParaView3/Doc/Nightly/www/js-doc/index.html#!/guide/paraviewweb_on_aws_ec2" target="_blank" style="font-size:13px;font-family:arial,sans-serif">http://www.paraview.org/ParaView3/Doc/Nightly/www/js-doc/index.html#!/guide/paraviewweb_on_aws_ec2</a> now. It looks like those urls used with wget are broken.</p>

<p class="">Found a replacement for httpd:</p><p class="">wget <a href="http://archive.apache.org/dist/httpd/httpd-2.4.7.tar.gz">http://archive.apache.org/dist/httpd/httpd-2.4.7.tar.gz</a> -O httpd.tgz</p>







<p class="">Can't seem to find 1.5.0 version. <b>Will 1.5.1 work?</b> If so, here is a working command:</p><p class="">wget <a href="http://apache.petsads.us/apr/apr-1.5.1.tar.gz">http://apache.petsads.us/apr/apr-1.5.1.tar.gz</a> -O apr.tgz</p>

<p class="">The last one works fine:</p><p class="">







</p><p class="">wget <a href="http://apache.petsads.us/apr/apr-util-1.5.3.tar.gz">http://apache.petsads.us/apr/apr-util-1.5.3.tar.gz</a> -O apr-util.tgz</p><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jul 21, 2014 at 3:36 PM, Dmitry Duplyakin <span dir="ltr"><<a href="mailto:duplyakin@uchicago.edu" target="_blank">duplyakin@uchicago.edu</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Got it. Rebuilding Apache now.<div><br></div><div>Thanks!<div><div class="h5"><br><div class="gmail_extra">

<br><br><div class="gmail_quote">On Mon, Jul 21, 2014 at 3:29 PM, Sebastien Jourdain <span dir="ltr"><<a href="mailto:sebastien.jourdain@kitware.com" target="_blank">sebastien.jourdain@kitware.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">You must have <span style="color:rgb(72,72,72);font-family:HelveticaNeue,helvetica,arial,clean,sans-serif;font-size:13px;line-height:19px">Apache 2.4.7+</span><div>


<font color="#484848" face="HelveticaNeue, helvetica, arial, clean, sans-serif"><span style="line-height:19px">Their is a fix in that version which allow mod_rewrite to work on web socket protocol instead of just http.</span></font></div>



<div><font color="#484848" face="HelveticaNeue, helvetica, arial, clean, sans-serif"><span style="line-height:19px">You can look at the apache section in here </span></font><a href="http://www.paraview.org/ParaView3/Doc/Nightly/www/js-doc/index.html#!/guide/paraviewweb_on_aws_ec2" target="_blank">http://www.paraview.org/ParaView3/Doc/Nightly/www/js-doc/index.html#!/guide/paraviewweb_on_aws_ec2</a></div>



<div><br></div><div>Seb</div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jul 21, 2014 at 2:25 PM, Dmitry Duplyakin <span dir="ltr"><<a href="mailto:duplyakin@uchicago.edu" target="_blank">duplyakin@uchicago.edu</a>></span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>We are running Apache/2.2.22 with loaded proxy_wstunnel_module (that we had to build from source).</div>



















<div><br></div>From Apache error log (with debug):<div><div>[Mon Jul 21 20:20:13 2014] [debug] mod_proxy_http.c(56): proxy: HTTP: canonicalising URL //localhost:8080/paraview/</div><div>[Mon Jul 21 20:20:13 2014] [debug] proxy_util.c(1506): [client 130.202.2.217] proxy: http: found worker <a href="http://localhost:8080/paraview" target="_blank">http://localhost:8080/paraview</a> for <a href="http://localhost:8080/paraview/" target="_blank">http://localhost:8080/paraview/</a>, referer: <a href="http://54.211.22.94/apps/Cone/" target="_blank">http://54.211.22.94/apps/Cone/</a></div>





<div>[Mon Jul 21 20:20:13 2014] [debug] mod_proxy.c(1020): Running scheme http handler (attempt 0)</div><div>[Mon Jul 21 20:20:13 2014] [debug] mod_proxy_http.c(1973): proxy: HTTP: serving URL <a href="http://localhost:8080/paraview/" target="_blank">http://localhost:8080/paraview/</a></div>





<div>[Mon Jul 21 20:20:13 2014] [debug] proxy_util.c(2011): proxy: HTTP: has acquired connection for (localhost)</div><div>[Mon Jul 21 20:20:13 2014] [debug] proxy_util.c(2067): proxy: connecting <a href="http://localhost:8080/paraview/" target="_blank">http://localhost:8080/paraview/</a> to localhost:8080</div>





<div>[Mon Jul 21 20:20:13 2014] [debug] proxy_util.c(2193): proxy: connected /paraview/ to localhost:8080</div><div>[Mon Jul 21 20:20:14 2014] [debug] mod_proxy_http.c(1743): proxy: start body send</div><div>[Mon Jul 21 20:20:14 2014] [debug] mod_deflate.c(615): [client 130.202.2.217] Zlib: Compressed 242 to 155 : URL /paraview/, referer: <a href="http://54.211.22.94/apps/Cone/" target="_blank">http://54.211.22.94/apps/Cone/</a></div>





<div>[Mon Jul 21 20:20:14 2014] [debug] mod_proxy_http.c(1847): proxy: end body send</div><div>[Mon Jul 21 20:20:14 2014] [debug] proxy_util.c(2029): proxy: HTTP: has released connection for (localhost)</div><div>[Mon Jul 21 20:20:14 2014] [debug] mod_proxy_http.c(56): proxy: HTTP: canonicalising URL //<a href="http://54.211.22.94/ws://localhost:9998/ws" target="_blank">54.211.22.94/ws://localhost:9998/ws</a></div>





<div>[Mon Jul 21 20:20:14 2014] [debug] proxy_util.c(1525): [client 130.202.2.217] proxy: *: found reverse proxy worker for <a href="http://54.211.22.94/ws://localhost:9998/ws?sessionId=6bf080cc-1114-11e4-b402-22000b0185a8" target="_blank">http://54.211.22.94/ws://localhost:9998/ws?sessionId=6bf080cc-1114-11e4-b402-22000b0185a8</a></div>





<div>[Mon Jul 21 20:20:14 2014] [debug] mod_proxy.c(1020): Running scheme http handler (attempt 0)</div><div>[Mon Jul 21 20:20:14 2014] [debug] mod_proxy_http.c(1973): proxy: HTTP: serving URL <a href="http://54.211.22.94/ws://localhost:9998/ws?sessionId=6bf080cc-1114-11e4-b402-22000b0185a8" target="_blank">http://54.211.22.94/ws://localhost:9998/ws?sessionId=6bf080cc-1114-11e4-b402-22000b0185a8</a></div>





<div>[Mon Jul 21 20:20:14 2014] [debug] proxy_util.c(2011): proxy: HTTP: has acquired connection for (*)</div><div>[Mon Jul 21 20:20:14 2014] [debug] proxy_util.c(2067): proxy: connecting <a href="http://54.211.22.94/ws://localhost:9998/ws?sessionId=6bf080cc-1114-11e4-b402-22000b0185a8" target="_blank">http://54.211.22.94/ws://localhost:9998/ws?sessionId=6bf080cc-1114-11e4-b402-22000b0185a8</a> to <a href="http://54.211.22.94:80" target="_blank">54.211.22.94:80</a></div>





<div>[Mon Jul 21 20:20:14 2014] [debug] proxy_util.c(2193): proxy: connected /ws://localhost:9998/ws?sessionId=6bf080cc-1114-11e4-b402-22000b0185a8 to <a href="http://54.211.22.94:80" target="_blank">54.211.22.94:80</a></div>



<div>[Mon Jul 21 20:20:14 2014] [debug] proxy_util.c(2444): proxy: HTTP: fam 2 socket created to connect to *</div>

<div>[Mon Jul 21 20:20:14 2014] [debug] proxy_util.c(2576): proxy: HTTP: connection complete to <a href="http://54.211.22.94:80" target="_blank">54.211.22.94:80</a> (54.211.22.94)</div><div>[Mon Jul 21 20:20:14 2014] [error] [client 54.211.22.94] File does not exist: /pv/www/ws:</div>





<div>[Mon Jul 21 20:20:14 2014] [debug] mod_proxy_http.c(1743): proxy: start body send</div><div>[Mon Jul 21 20:20:14 2014] [debug] mod_proxy_http.c(1847): proxy: end body send</div><div>[Mon Jul 21 20:20:14 2014] [debug] proxy_util.c(2029): proxy: HTTP: has released connection for (*)</div>





</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br>POST took ~1 second. Timestamps for POST and the following GET: 21/Jul/2014:20:23:02 and 21/Jul/2014:20:23:03<div><div><br><br><br><div class="gmail_quote">



On Mon, Jul 21, 2014 at 3:10 PM, Sebastien Jourdain <span dir="ltr"><<a href="mailto:sebastien.jourdain@kitware.com" target="_blank">sebastien.jourdain@kitware.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Which version of Apache are you using? Do you have the ws_tunnelling (<= wrong name but something like that) module enabled?<div>





<br></div><div>You may be able to check the system log that apache generate to see what went wrong.</div>
<div>Do you know how much time the POST request took?</div><div><br></div><div>Seb</div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jul 21, 2014 at 1:59 PM, Dmitry Duplyakin <span dir="ltr"><<a href="mailto:duplyakin@uchicago.edu" target="_blank">duplyakin@uchicago.edu</a>></span> wrote:<br>






<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div>Continue troubleshooting...</div><div>





<br></div>Now we get this in response to POST:<br><br>{"updir": "/Home", "sessionManagerURL": "http://54.211.22.94:/paraview/", "port": 9999, "host": "localhost", "sessionURL": "ws://<a href="http://54.211.22.94/proxy?sessionId=369f8648-110f-11e4-b402-22000b0185a8" target="_blank">54.211.22.94/proxy?sessionId=369f8648-110f-11e4-b402-22000b0185a8</a>", "id": "369f8648-110f-11e4-b402-22000b0185a8"}<br>








<br>Looks right to me. Then, after that POST, it does GETs that do not look right:<br><br>54.211.22.94 - - [21/Jul/2014:19:54:29 +0000] "GET <b>/ws://localhost:9999/ws?sessionId=d32a4d8a-1110-11e4-b402-22000b0185a8</b> HTTP/1.1" 404 509 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:30.0) Gecko/20100101 Firefox/30.0"<br>








<br>130.202.2.217 - - [21/Jul/2014:19:54:29 +0000] "GET /proxy?sessionId=d32a4d8a-1110-11e4-b402-22000b0185a8 HTTP/1.1" 404 509 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:30.0) Gecko/20100101 Firefox/30.0" <div>








<br></div><div>And the message: </div><div><br></div><div>Firefox can't establish a connection to the server at ws://<a href="http://54.211.22.94/proxy?sessionId=d32a4d8a-1110-11e4-b402-22000b0185a8" target="_blank">54.211.22.94/proxy?sessionId=d32a4d8a-1110-11e4-b402-22000b0185a8</a>. return new WebSocket(url, protocols);<div>








<br></div><div>What can possibly cause this? Again, complete apache and launcher configs are in the previous email.</div><div><div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 21, 2014 at 2:07 PM, Dmitry Duplyakin <span dir="ltr"><<a href="mailto:duplyakin@uchicago.edu" target="_blank">duplyakin@uchicago.edu</a>></span> wrote:<br>








<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">This helped tremendously! <div><br></div><div>








Both "-f" and "${host}" now make a lot more sense. </div><div class="gmail_extra"><br></div><div class="gmail_extra">POST works fine now and we can see the Rewrite rule in action. Something there still needs attention and we are investigating further.</div>









<div class="gmail_extra"><br></div><div class="gmail_extra">Thanks for you patience and all the help that allows us to move forward.</div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jul 21, 2014 at 12:59 PM, Sebastien Jourdain <span dir="ltr"><<a href="mailto:sebastien.jourdain@kitware.com" target="_blank">sebastien.jourdain@kitware.com</a>></span> wrote:<br>









<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hi Dmitry,<div><br></div><div>you may still have a typo</div>








<div><br></div><div>=> <span style="font-size:13px;font-family:arial,sans-serif">"ws://${host}/proxy?sessionId=</span><span style="font-size:13px;font-family:arial,sans-serif">${id}",</span></div>

<div><span style="font-size:13px;font-family:arial,sans-serif"><br></span></div><div><span style="font-size:13px;font-family:arial,sans-serif">${host} should have been replaced with a static string that match the host that the web browser is using to reach apache.</span></div>










<div><span style="font-size:13px;font-family:arial,sans-serif"><br></span></div><div><font face="arial, sans-serif">Moreover, I forgot to mention that you need to add "-f" in your set of arguments. That will force some output generation to fill some buffer which will allow the launcher to detect when the server is actually ready.</font></div>










<div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">I've noticed that the documentation is missing them. Don't know why... Will update it at some point.</font></div><div><font face="arial, sans-serif">Although this page show that option: </font><a href="http://www.paraview.org/ParaView3/Doc/Nightly/www/js-doc/index.html#!/guide/py_launcher" target="_blank">http://www.paraview.org/ParaView3/Doc/Nightly/www/js-doc/index.html#!/guide/py_launcher</a></div>










<div><span style="font-size:13px;font-family:arial,sans-serif"><br></span></div><div><span style="font-size:13px;font-family:arial,sans-serif">And the value for "</span><span style="font-family:arial,sans-serif;font-size:13px">timeout" should be way bigger than 5. Like 25 maybe.</span></div>










<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Seb</span></div><div><span style="font-size:13px;font-family:arial,sans-serif"><br>










</span></div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jul 21, 2014 at 10:58 AM, Dmitry Duplyakin <span dir="ltr"><<a href="mailto:duplyakin@uchicago.edu" target="_blank">duplyakin@uchicago.edu</a>></span> wrote:<br>










<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Thanks for this detailed description! The process is starting to make sense and we can communicate more efficiently about our configuration and problems. <div>










<br></div><div>Here is our complete launch.json (with the right sessionURL for a config with Apache, according to your email):<div>

<div>{</div><div>"configuration": {</div><div>  "content": "/pv/www",</div><div>  "log_dir": "/pv/logs",</div><div>  "host": "localhost",</div>
<div>  "endpoint": "paraview",</div><div>  "sessionURL": "ws://${host}/proxy?sessionId=${id}",</div><div>  "timeout": 5,</div><div>  "upload_dir": "/pv/data",</div>













<div>  "fields": ["file", "host", "port", "updir"],</div><div>  "port": 8080,</div><div>  "proxy_file": "/pv/conf/proxy.conf"},</div><div>"apps": {</div>













<div>  "data_prober": {"cmd": ["${python_exec}", "${python_path}/paraview/web/pv_web_data_prober.py", "--port", "${port}", "--data-dir", "${data}"], "ready_line" : "Starting factory"},</div>













<div>  "pipeline": {"cmd": ["${python_exec}", "${python_path}/paraview/web/pv_web_visualizer.py", "--port", "${port}", "--data-dir", "${data}"], "ready_line" : "Starting factory"},</div>













<div>  "loader": {"cmd": ["${python_exec}", "${python_path}/paraview/web/pv_web_file_loader.py", "--port", "${port}", "--data-dir", "${data}"], "ready_line" : "Starting factory"},</div>










<div>


<div>  "cone": {"cmd": ["${python_exec}", "/pv/src/VTK/Web/Applications/Cone/server/vtk_web_cone.py", "--port", "${port}"], "ready_line" : "Starting factory"}},</div>













</div><div>"properties": {</div><div>  "python_path": "/pv/paraview/lib/paraview-4.1/site-packages/",</div><div>  "data": "/pv/data",</div><div>  "python_exec": "/pv/paraview/bin/pvpython"},</div>










<div>


<div>"resources": [{"port_range": [9901, 9999], "host": "localhost"}],</div></div><div>"sessionData": {"updir": "/Home"}</div><div>}</div></div></div>










<div><br>


</div><div>Apache host file:</div><div><div><VirtualHost *:80></div><div>        ServerAdmin webmaster@localhost</div><div>        DocumentRoot /pv/www</div><div>        <Directory /pv/www/></div><div>                Options Indexes FollowSymLinks MultiViews</div>












<div>                AllowOverride None</div><div>                Order allow,deny</div><div>                allow from all</div><div>        </Directory></div><div><div><br></div><div>        ProxyPass        /paraview <a href="http://localhost:8080/paraview" target="_blank">http://localhost:8080/paraview</a></div>












<div><br></div></div><div><div>        RewriteEngine On</div><div>        RewriteMap session-to-port txt:/pv/conf/proxy.conf</div><div>        RewriteCond %{QUERY_STRING}     ^sessionId=(.*)$ [NC]</div><div>        RewriteRule    ^/proxy.*$  ws://${session-to-port:%1}/ws  [P]</div>












<div><br></div></div><div>        RewriteLog "/var/log/apache2/rewrite.log"</div><div>        RewriteLogLevel 3</div><div>        ErrorLog ${APACHE_LOG_DIR}/error.log</div><div>        LogLevel debug</div><div>










        CustomLog ${APACHE_LOG_DIR}/access.log combined</div>

<div></VirtualHost></div></div><div><br></div><div>Now when we access http://<PVW server>/apps/Cone/ in the browser,</div><div>it does POST {"sessionManagerURL":"http://<CORRECT IP FOR PVW server>:/paraview/","application":"cone"}. Then Launcher starts a process listening to a port from the range (e.g. 9999). We can see that process:</div>












<div>ps auwx | grep cone</div><div>root     27943  2.3  1.8 1015600 137664 pts/2  Sl+  16:32   0:00 /pv/paraview/lib/paraview-4.1/pvpython /pv/src/VTK/Web/Applications/Cone/server/vtk_web_cone.py --port 9999 <br></div><div>












<br></div><div><span>After that we get a session timeout and this response:</span> "Session did not start before timeout expired. Check session logs."</div><div><br></div><div>Any further advice?</div><div><div>











<div class="gmail_extra">
<br><br><div class="gmail_quote">On Mon, Jul 21, 2014 at 10:02 AM, Sebastien Jourdain <span dir="ltr"><<a href="mailto:sebastien.jourdain@kitware.com" target="_blank">sebastien.jourdain@kitware.com</a>></span> wrote:<br>












<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hi Dmitry,<div><br></div><div>First of all you need to understand the role of apache here in order to see how the configuration should be.</div>












<div>As you may know, you can use ParaViewWeb without Apache, but such setup is not meant for production.<br>
</div><div><br></div><div>The list below is what you get when you add Apache:</div><div>- Apache can be use to serve the static content (html, js, png, css...)</div><div>- Apache provide a single entry point host + port. This prevent cross-domain issue or firewall limitation.</div>













<div>- Apache will relay the WebSocket communication to the proper ParaViewWeb instance on the backend based on a session ID. This mean that the ParaViewWeb process DOES NOT need to be on the same machine as the Apache Web Server.</div>













<div><br></div><div>Then you need to understand how the launcher works and its role.</div><div>In ParaViewWeb a launcher is used to start a new visualization process for a given user. This simply mean running a command line with some dynamic parameters like the port number on which this specific instance should listen.</div>













<div>So when a user connect to the system and request a new visualization session, it is the responsibility of the launcher to start the process and let the client know on which WebSocket URL it should connect to in order to reach the requested visualization session.</div>













<div><br></div><div>In a setup that DOES NOT contain Apache, we can not use the same port as the main server (the process would not start). Hence, we start it with some port and we let the user know that it should connect to "ws://{host}:{port}/ws" where host and port get replaced with the set that was used to create the process. </div>













<div><br></div><div>See section "resources" in launcher configuration.</div><div><br></div><div>BUT with Apache that is different, now we have a process which is meant to relay the communication to the backend using the port and host that Apache is using. So the launcher should let the client know what URL they should use so Apache could handle it and forward it to the backend. Hence the ws://{apache_host}/proxy?sessionId=${id}.</div>













<div>In the same time to keep track on which host/port a process is running the launcher generate a text file with the proper mapping.</div><div>That mapping file is then used inside Apache to figure out how it should establish the connection to the backend.</div>













<div><br></div><div>This should help you understand how to fix your configuration.</div><div>Moreover, here is the remaining set of questions:</div><div><br></div><div><div><div style="font-family:arial,sans-serif;font-size:13px">













> can we specifically log and debug Rewrite rule actions?</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div></div><div style="font-family:arial,sans-serif;font-size:13px">Don't know, Google will be your friend here...</div>












<div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">> do we actually need ProxyPassReverse in Apache?</div><div style="font-family:arial,sans-serif;font-size:13px">













<br></div></div><div style="font-family:arial,sans-serif;font-size:13px">Don't know, Google will be your friend here as well as the documentation on how to setup ParaViewWeb on Ubuntu 14LTS.<br></div><div><div style="font-family:arial,sans-serif;font-size:13px">













<br></div><span style="font-family:arial,sans-serif;font-size:13px">> what particular modules in Apache are required?</span></div></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div>












<span style="font-family:arial,sans-serif;font-size:13px">Read the documentation, the list is minimum and provided in it.</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">> in launch.json there are two particular lines host/resources:</span></div>













<div><br></div><div>So the "host" is to select the proper network card when you have several for the actual launcher server.</div><div><br></div><div>Then the resources are use for process management and URL generation for the client. Which mean, what name should be used by Apache to connect to the machine that actually run a ParaViewWeb process.<br>













</div><div><br></div><div>Seb</div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jul 21, 2014 at 8:01 AM, Dmitry Duplyakin <span dir="ltr"><<a href="mailto:duplyakin@uchicago.edu" target="_blank">duplyakin@uchicago.edu</a>></span> wrote:<br>













<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div style="font-family:arial,sans-serif;font-size:13px">








<div>Thank you very much, Sebastien!</div><div>




<br></div></div><div class="gmail_extra"><div class="gmail_quote"><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">


















<div dir="ltr"><div>Launcher side:</div><div><span style="font-family:Menlo,'Courier New',Courier,monospace;font-size:13px;line-height:13px;white-space:pre-wrap;color:rgb(102,102,0);background-color:rgb(247,247,247)"><pre style="margin-top:10px;margin-bottom:14px;padding:10px 12px;font-family:Menlo,'Courier New',Courier,monospace;line-height:1.3em;border:1px solid rgb(232,232,232);border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;color:rgb(49,78,100);max-width:900px">

<code style="margin:0px;padding:0px;font-style:inherit;font-family:Menlo,'Courier New',Courier,monospace;line-height:13px"><span style="color:rgb(0,136,0)"><span>"sessionURL"</span><span style="color:rgb(102,102,0)">:</span><span style="color:rgb(0,0,0)"> </span><span>"ws://YOUR_HOST_NAME_TO_REPLACE(the one used to connect to apache)/proxy?sessionId=${id}",</span></span></code></pre>
















<pre style="margin-top:10px;margin-bottom:14px;padding:10px 12px;font-family:Menlo,'Courier New',Courier,monospace;line-height:1.3em;border:1px solid rgb(232,232,232);border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;color:rgb(49,78,100);max-width:900px">

<span style="font-style:inherit;line-height:13px;color:rgb(0,136,0)">"proxy_file"</span><span style="font-style:inherit;line-height:13px;color:rgb(102,102,0)">:</span><span style="font-style:inherit;line-height:13px;color:rgb(0,0,0)"> </span><span style="font-style:inherit;line-height:13px;color:rgb(0,136,0)">"/data/proxy.txt"</span></pre>
















</span></div></div></blockquote></div><div>This is exactly what we have in our launcher:</div><div>







<p><span>  </span>"sessionURL"<span>: </span>"ws://${host}:${port}/ws"<span>,</span></p><p><span>







</span></p><p><span>  </span>"host"<span>: </span>"localhost"<span>,</span></p><p><span>







</span></p><p>  <span>"port"</span>: 8080,</p><p>Your sessionURL looks different. Do you actually use "<span style="color:rgb(0,136,0);font-family:Menlo,'Courier New',Courier,monospace;font-style:inherit;line-height:13px;font-size:13px">proxy?sessionId=</span>" there? Ours came directly from the script you've suggested earlier: <a href="http://www.paraview.org/gitweb?p=ParaViewSuperbuild.git;a=blob_plain;f=Scripts/pvw-setup.py;hb=HEAD" target="_blank">http://www.paraview.org/gitweb?p=ParaViewSuperbuild.git;a=blob_plain;f=Scripts/pvw-setup.py;hb=HEAD</a> </p>


















</div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div>Apache side</div>
<div><pre style="margin-top:10px;margin-bottom:14px;padding:10px 12px;font-family:Menlo,'Courier New',Courier,monospace;line-height:1.3em;border:1px solid rgb(232,232,232);border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;color:rgb(49,78,100);max-width:900px;font-size:13px;background-color:rgb(247,247,247)">

<code style="margin:0px;padding:0px;font-style:inherit;font-family:Menlo,'Courier New',Courier,monospace;line-height:13px"><span style="color:rgb(102,0,102)">RewriteMap</span><span style="color:rgb(0,0,0)">  session</span><span style="color:rgb(102,102,0)">-</span><span style="color:rgb(0,0,0)">to</span><span style="color:rgb(102,102,0)">-</span><span style="color:rgb(0,0,0)">port  txt</span><span style="color:rgb(102,102,0)">:</span><span style="color:rgb(0,136,0)">/data/</span><span style="color:rgb(0,0,0)">proxy</span><span style="color:rgb(102,102,0)">.</span><span style="color:rgb(0,0,0)">txt</span></code></pre>






















</div><div></div></div></blockquote></div><div class="gmail_quote">In Apache we have:</div><div>RewriteEngine On<br>RewriteMap session-to-port txt:/pv/conf/proxy.conf<br>RewriteCond %{QUERY_STRING}     ^sessionId=(.*)$ [NC]<br>













RewriteRule    ^/proxy.*$  ws://${session-to-port:%1}/ws  [P]<br>




 </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div>Then when a session start you can check the content of that /data/proxy.txt and that should one line by running session with {sessionId} localhost:yyyyy</div>


















</div></blockquote><div><br></div><div>Verified that those entires are added to the file and have the right format. </div><div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">


















<div dir="ltr"><div>On the other hand you forgot that line in the config of your cone app: <span style="font-family:Menlo,'Courier New',Courier,monospace;font-style:inherit;line-height:13px;font-size:13px;color:rgb(0,136,0);background-color:rgb(247,247,247)">"ready_line"</span><span style="font-family:Menlo,'Courier New',Courier,monospace;font-style:inherit;line-height:13px;font-size:13px;color:rgb(0,0,0);background-color:rgb(247,247,247)"> </span><span style="font-family:Menlo,'Courier New',Courier,monospace;font-style:inherit;line-height:13px;font-size:13px;color:rgb(102,102,0);background-color:rgb(247,247,247)">:</span><span style="font-family:Menlo,'Courier New',Courier,monospace;font-style:inherit;line-height:13px;font-size:13px;color:rgb(0,0,0);background-color:rgb(247,247,247)"> </span><span style="font-family:Menlo,'Courier New',Courier,monospace;font-style:inherit;line-height:13px;font-size:13px;color:rgb(0,136,0);background-color:rgb(247,247,247)">"Starting factory"</span></div>






















<div><span style="font-family:Menlo,'Courier New',Courier,monospace;font-style:inherit;line-height:13px;font-size:13px;color:rgb(0,136,0);background-color:rgb(247,247,247)"><br></span></div></div></blockquote></div>













<div>




Thanks! Added it and now the app looks like this:</div><div><br></div><div>"cone"<span>: </span><span>{</span>"cmd"<span>: </span><span>[</span>"${python_exec}"<span>, </span>"/pv/src/VTK/Web/Applications/Cone/server/vtk_web_cone.py"<span>, </span>"--port"<span>, </span>"${port}"<span>]</span><span>, </span>"ready_line"<span> : </span>"Starting factory"<span>}}</span><span>,</span></div>













<div>




<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><span style="font-family:Menlo,'Courier New',Courier,monospace;font-style:inherit;line-height:13px;font-size:13px;color:rgb(0,136,0);background-color:rgb(247,247,247)"></span></div>


















<div>You can check is any pvpython process is running, on which port, see if that match in the proxy file (/data/proxy.txt) and also looking at the log directory with the output of the pvpython process.</div>



<div><br></div><div>A common error could also be that the apache does not have the right to read the /data/proxy.txt file or that the launcher is not able to write it.</div></div></blockquote><div> </div></div><div>Verified that launcher can write it and that entries are added.</div>


















<div> </div><div><div style="font-size:13px;font-family:arial,sans-serif"><div>These are the rest of our questions (we need to sort these out because they have caused some confusion and we want to clear things up and do not come back to these issues anymore):</div>















<div><br></div><div>- can we specifically log and debug Rewrite rule actions?</div><div>- do we actually need ProxyPassReverse in Apache?</div>


- what particular modules in Apache are required? So far we have: proxy_module, proxy_http_module, and rewrite_module. We are unsure whether we need proxy_wstunnel_module or not.<br>- in launch.json there are two particular lines:<br>


















"host": "localhost",<br>"resources": [{"port_range": [9901, 9999], "host": "localhost"}],<br>where we have some confusion about using "localhost" vs. "0.0.0.0". What exactly should we use in either case?</div>


















</div><div><br></div><div>Appreciate your help!</div><div><div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
















<div dir="ltr"><div><br></div><div>Good luck,</div>

<div><br></div>



<div>Seb</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Jul 20, 2014 at 10:12 AM, Dmitry Duplyakin <span dir="ltr"><<a href="mailto:duplyakin@uchicago.edu" target="_blank">duplyakin@uchicago.edu</a>></span> wrote:<br>






















<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hi all,<div><br></div><div>My name is Dmitry Duplyakin. I am a PhD student helping to build a ParaViewWeb system at University of Chicago.</div>






















<div><br></div><div><div>We are building ParaView 4.1.0 (with OSMesa) on Amazon EC2 Ubuntu 12.04 instances.</div>
<div><br></div></div><div>We have verified that PV builds without errors and that PVW launcher is functioning (new entries are added to the proxy file, vis sessions are created and are listening to ports in the specified range, etc.)</div>























<div><br></div><div>We are trying to visualize a simple cone: </div><div>(added app in launch.json)</div><div>"cone"<span>: </span><span>{</span>"cmd"<span>: </span><span>[</span>"${python_exec}"<span>, </span>"/pv/src/VTK/Web/Applications/Cone/server/vtk_web_cone.py"<span>, </span>"--port"<span>, </span>"${port}"<span>]}}</span><span>,</span></div>























<div><br></div><div>We have verified that vtk_web_cone.py actually gets called. In order to test it, we used /pv/www/apps/TestApp/index.html as a template and created /pv/www/apps/Cone/index.html where we have:</div><div>























...<br>  var config = {<br>    sessionManagerURL: vtkWeb.properties.sessionManagerURL,<br>    application: "cone"<br>  };</div><div>...</div><div><br></div><div>Now when we access this app via a browser at: http://<hostname>/apps/Cone/ we either get a timeout or "connection can't be established" message.<br>























</div><div><br></div><div>In the apache error log we see: </div><div><div>[Sun Jul 20 16:04:15 2014] [error] [client 128.135.188.231] proxy: Error reading from remote server returned by /paraview/, referer: <a href="http://54.211.22.94/apps/Cone/" target="_blank">http://54.211.22.94/apps/Cone/</a></div>























<div>[Sun Jul 20 16:04:15 2014] [error] [client 128.135.188.231] File does not exist: /pv/www/ws</div></div>







<div><br></div><div>It appears that it has do to with Apache configuration, where we have:</div><div><div>ProxyPass        /paraview <a href="http://localhost:8080/paraview" target="_blank">http://localhost:8080/paraview</a></div>






















<div>ProxyPassReverse /paraview <a href="http://localhost:8080/paraview" target="_blank">http://localhost:8080/paraview</a></div>
<div>RewriteEngine On</div><div>RewriteMap session-to-port txt:/pv/conf/proxy.conf</div>RewriteCond %{QUERY_STRING}     ^sessionId=(.*)$ [NC]<br>RewriteRule    ^/proxy.*$  ws://${session-to-port:%1}/ws  [P]<br><br>Do these Rewrite commands look right? How can their actions be logged and verified?</div>























<div><br></div><div>Do we actually need ProxyPassReverse here?<br></div><div><br></div><div>Is it possible that we are missing a module or some additional configuration in Apache?</div><div><div># apachectl -t -D DUMP_MODULES</div>























<div>...</div><div> proxy_module (shared)</div><div> proxy_http_module (shared)</div><div> proxy_wstunnel_module (shared)</div><div> rewrite_module (shared)</div><div>...</div><div>Syntax OK</div></div><div><br></div><div>























Any debugging advice?</div><div><br></div><div>Your help will be much appreciated and will allow to move forward with our isntallation.</div><div><br></div><div>-------------------------------------------------------------------------------<div dir="ltr">























<div><br></div><div>Dmitry Duplyakin </div><div>PhD student, CS at University of Colorado - Boulder</div></div></div><div> </div></div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/paraview" target="_blank">http://public.kitware.com/mailman/listinfo/paraview</a><br>
<br></blockquote></div><br></div>
</blockquote></div></div></div><br></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div></div></div></div>
</blockquote></div><br></div></div></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div></div></div></div></div>
</blockquote></div><br></div></div>