Closed chris2009 closed 7 years ago
If you have a public dns name (or even a hostname for your machine on your local network), you should use that for the ServerName
. You should set the DocumentRoot
to be the directory where the web content you plan to host is located.
Additionally, you should replace strings like <MAPPING-FILE-DIR>
or <MY-DOCUMENT-ROOT>
with appropriate values for your system.
The documentation on multi-user setup is included not so much as a feature of the project, but rather as an example of how you may choose to manage multiple users, where there could be many other options. You can find more documentation on Apache virtual hosts here:
Hi! scottwittenburg, thank you for your response.
I did some changes in the document but I have problems, yet. My file 001-pvw.conf is likes this:
<VirtualHost 127.0.1.1:80> ServerName 127.0.1.1 ServerAdmin webmaster@example-host.example.com DocumentRoot "/home/christian/Escritorio/Proyecto/build/www" ErrorLog "logs/pv-error_log" CustomLog "logs/pv-access_log" common
# Have Apache pass these requests to the launcher
ProxyPass /paraview http://localhost:8080/apps/Visualizer
# Turn on the rewrite engine
RewriteEngine On
# This is the path the mapping file Jetty creates
RewriteMap session-to-port txt:/home/christian/Escritorio/apache/config/proxy.txt
# This is the rewrite condition. Look for anything with a sessionId= in the query part of the URL and capture the value to use below.
RewriteCond %{QUERY_STRING} ^sessionId=(.*)$ [NC]
# This does the rewrite using the mapping file and the sessionId
RewriteRule ^/proxy.*$ ws://${session-to-port:%1}/ws [P]
<Directory "/home/christian/Escritorio/Proyecto/build/www">
Options Indexes FollowSymLinks
Order allow,deny
Allow from all
AllowOverride None
Require all granted
</Directory>
` And when I follow the next step:
$ sudo a2ensite 001-pvw.conf $ sudo service apache2 restart
I get the next message:
Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details.
And then I put this for more details: systemctl status apache2.service, and I get this: sep 07 15:15:36 christian-All-Series systemd[1]: Failed to start LSB: Apache2 web server.
I think couls be a problem of set up the file 001-pvw.conf, yet.
Not sure what the issue is. I noticed a couple potential issues with your apache virtual host configuration though:
1) Is your local host ip really 127.0.1.1
? Perhaps you could try replacing that with localhost
?
2) The ProxyPass
line should not be pointed at a visualization instance, but rather at the launcher, as the launcher is what should run the visualization processes. So it should be pointing at the host/port where you are running the launcher, and it should end in /paraview
, not /apps/Visualizer
. See the following for information on the launcher:
http://kitware.github.io/paraviewweb/docs/guides/launcher_api.html http://kitware.github.io/paraviewweb/docs/guides/python_launcher.html http://kitware.github.io/paraviewweb/docs/guides/launching_examples.html
One take-away from that third link is that you must configure your apache virtual host and your launcher in such a way that they are compatible. E.g. in the launcher config, you state what interface, host, port the launcher should listen on, and then in the virtual host config, the ProxyPass
to launcher (/paraview
) needs to match.
Hope this helps.
Thank you for your advices Scottwittenburg but I continue having problems as I said in the before comment. I have a question How should content the file proxy.txt?
You will not add any content to that file yourself. However, it must exist and be readable and writable by both the launcher process and the apache process. The launcher will write lines into it which map session ids to the appropriate ports where it has started those processes running. Then apache needs to be able to read it so when it receives a websocket request like:
ws://127.0.1.1/proxy?sessionId=1deeadf0-fa0e-1126-a850-3c07547598ec
it knows where to send that. If you need information on how to arrange permissions so that is true, the link below may help. It is just another page within those guides I linked above.
http://kitware.github.io/paraviewweb/docs/guides/apache_front_end.html#Create-a-proxy-mapping-file
I think if that file does not exist with the correct permissions when you start apache, that could cause it to fail.
You were rigth Scottwittenburg, I hadn't the correct permissions when I started apache. I continued with the steps and in the set up of Python as Launcher, I wrote the following command:
root@christian-All-Series:~/Escritorio/Proyecto/build# ./bin/pvpython lib/site- package/vtk/web/launcher.py launcher.config And I got the next message: `Got unknown argument: lib/site-package/vtk/web/launcher.py
--connect-id=opt Set the ID of the server and client to make sure they match. 0 is reserved to imply none specified.
--cslog=opt ClientServerStream log file.
--data=opt Load the specified data. To specify file series replace the numeral with a '.' eg. my0.vtk, my1.vtk...myN.vtk becomes my..vtk
--disable-registry
-dr Do not use registry when running ParaView (for testing).
--enable-bt Enable stack trace signal handler.
--enable-streaming EXPERIMENTAL: When specified, view-based streaming is enabled for certain views and representation types.
--help
/? Displays available command line arguments.
--hostname=opt Override the hostname to be used to connect to this process. By default, the hostname is determined using appropriate system calls.
--multi-servers Allow client to connect to several pvserver
--print-monitors Print detected monitors and exit (Windows only).
--server-url=opt
-url=opt Set the server-url to connect with when the client starts. --server (-s) option supersedes this option, hence one should only use one of the two options.
--state=opt Load the specified statefile (.pvsm).
--stereo Tell the application to enable stereo rendering
--stereo-type=opt Specify the stereo type. This valid only when --stereo is specified. Possible values are "Crystal Eyes", "Red-Blue", "Interlaced", "Dresden", "Anaglyph", "Checkerboard","SplitViewportHorizontal"
--test-plugin=opt Specify the name of the plugin to load for testing
--test-plugin-path=opt Specify the path where more plugins can be found.This is typically used when testing plugins.
--use-cuda-interop
-cudaiop When specified, piston classes will use cuda interop for direct rendering
--version
-V Give the version number and exit.
`
My question is: Where should be located the file launcher.config? I PUTTED THIS FILE IN /home/christian/Escritorio/Proyecto/ParaView/VTK/Web/Python/vtk/web TOGETHER WITH THE FILE launcher.py
My file launcher.config is this:
`
"configuration": { "host" : "localhost", # name of network interface to bind for launcher webserver "port" : 8080, # port to bind for launcher webserver "endpoint": "paraview", # SessionManager Endpoint "content": "/.../www", # Optional: Directory shared over HTTP "proxy_file" : "/home/christian/Escritorio/mappingfile/proxy.txt", # Proxy-Mapping file for Apache "sessionURL" : "ws://${host}:${port}/ws", # ws url used by the client to connect to started process "timeout" : 5, # Wait time in second after process start "log_dir" : "/.../viz-logs", # Directory for log files "upload_dir" : "/.../uploadDirectory", # Start file upload server on same port as launcher "fields" : ["file", "host", "port", "updir"] # Fields not listed are filtered from response },
"resources" : [ { "host" : "localhost", "port_range" : [9001, 9003] } ],
"properties" : { "build_dir" : "/.../build", "python_exec" : "/.../build/bin/vtkpython", "WWW" : "/.../build/www", "source_dir": "/.../src" },
"apps": { "pipeline": { "cmd": [ "${python_exec}", "-dr", "${python_path}/paraview/web/pv_web_visualizer.py", "--port", "${port}", "--data-dir", "${dataDir}", "-f", "--authKey", "${secret}" ], "ready_line" : "Starting factory" }, "visualizer": { "cmd": [ "${python_exec}", "-dr", "${python_path}/paraview/web/pv_web_visualizer.py", "--port", "${port}", "--data-dir", "${dataDir}", "-f", "--authKey", "${secret}" ], "ready_line" : "Starting factory" }, "loader": { "cmd": [ "${python_exec}", "-dr", "${python_path}/paraview/web/pv_web_file_loader.py", "--port", "${port}", "--data-dir", "${dataDir}", "-f", "--authKey", "${secret}" ], "ready_line" : "Starting factory" }, "data_prober": { "cmd": [ "${python_exec}", "-dr", "${python_path}/paraview/web/pv_web_data_prober.py", "--port", "${port}", "--data-dir", "${dataDir}", "-f", "--authKey", "${secret}" ], "ready_line" : "Starting factory" } } }`
THank you for your time.
Hi my friends! I have been working with ParaviewWeb very well but when I have tried to set up the Multi-User mode but I really don't now how I have to set up the file :
*<VirtualHost :80> ServerName
ServerAdmin webmaster@example-host.example.com
DocumentRoot ""
ErrorLog "logs/pv-error_log"
CustomLog "logs/pv-access_log" common
**
May you help me How Do I have to put in the parts:
Thanks very much.