本文介绍了如何在Fedora 22下安装ParaView 4.4。对于RedHat/CentOS系列的linux更有帮助。
1)Fedora准备
2)安装paraviewweb
3)配置apache
4) 配置ParaViewWeb网站
5)修改web 安全设置
文章的步骤参考了paraview的官方介绍 http://paraviewweb.kitware.com/#!/guide/ubuntu_14_04
补充了 paraview 5.0的说明。
试验的机器安装了Fedora 22+Gnome。GUI环境是运行Paraview需要的。
sudo dnf groupinstall "Web Server"
<em>sudo dnf groupinstall "httpd" </em>猜测这个可以满足需求,没有实际测试。
启动Apache serversudo systemctl start httpd.service"停止sudo systemctl stop httpd.service"重启sudo systemctl restart httpd.service"
把apche注册成服务su -c "systemctl enable httpd.service"
sudo usermod -a -G apache pvw-user
sudo mkdir /data sudo chown pvw-user /data sudo chgrp apache /data
mkdir -p /data/pvw /data/pv /data/logs /data/www
Directory structure:
cp -r /.../ParaView-4.4.0-Qt4-Linux-64bit /data/pv/pv-20160112 ln -s /data/pv/pv-20160112 /data/pv/pv-current
chown -R pvw-user /data/pv chgrp -R pvw-user /data/pv
mkdir -p /data/pvw/bin /data/pvw/conf /data/pvw/data /data/pvw/logs
{ "resources": [ {"port_range": [9001, 9103], "host": "localhost"} ], "sessionData": { "updir": "/Home" }, "configuration": { "log_dir": "/data/pvw/logs", "host": "localhost", "endpoint": "paraview", "sessionURL": "ws://YOUR_HOST_NAME_TO_REPLACE/proxy?sessionId=${id}", "timeout": 25, "upload_dir": "/data/pvw/upload", "fields": ["file", "host", "port", "updir"], "port": 8080, "proxy_file": "/data/proxy.txt" }, "properties": { "python_path": "/data/pv/pv-current/lib/paraview-4.4/site-packages", "dataDir": "/data/pvw/data", "python_exec": "/data/pv/pv-current/bin/pvpython" }, "apps": { "pipeline": { "cmd": [ "${python_exec}", "${python_path}/paraview/web/pv_web_visualizer.py", "--port", "${port}", "--data-dir", "${dataDir}", "-f", "--authKey", "${secret}" ], "ready_line" : "Starting factory" }, "visualizer": { "cmd": [ "${python_exec}", "${python_path}/paraview/web/pv_web_visualizer.py", "--port", "${port}", "--data-dir", "${dataDir}", "-f", "--authKey", "${secret}" ], "ready_line" : "Starting factory" }, "loader": { "cmd": [ "${python_exec}", "${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}", "${python_path}/paraview/web/pv_web_data_prober.py", "--port", "${port}", "--data-dir", "${dataDir}", "-f", "--authKey", "${secret}" ], "ready_line" : "Starting factory" } } }
#!/bin/bash export DISPLAY=:0.0 /data/pv/pv-current/bin/pvpython /data/pv/pv-current/lib/paraview-4.4/site-packages/vtk/web/launcher.py /data/pvw/conf/launcher.json &
cp -r /.../ParaViewData-v4.4.0/* /data/pvw/data
sudo chown -R pvw-user /data/pvw sudo chgrp -R pvw-user /data/pvw sudo chmod u+x /data/pvw/bin/start.sh
"sessionURL" : "ws://${host}:${port}/ws",
<VirtualHost YOUR_HOST_NAME_TO_REPLACE:80> ServerName YOUR_HOST_NAME_TO_REPLACE ServerAdmin webmaster@YOUR_HOST_NAME_TO_REPLACE DocumentRoot /data/www ErrorLog /data/logs/error.log CustomLog /data/logs/access.log combined <Directory /data/www> Options Indexes FollowSymLinks Order allow,deny Allow from all AllowOverride None Require all granted </Directory> # Handle launcher forwarding ProxyPass /paraview http://localhost:8080/paraview # Handle WebSocket forwarding RewriteEngine On # The following line is used for debuging rewrite #LogLevel debug rewrite:trace6 RewriteMap session-to-port txt:/data/proxy.txt RewriteCond %{QUERY_STRING} ^sessionId=(.*)$ [NC] RewriteRule ^/proxy.*$ ws://${session-to-port:%1}/ws [P] </VirtualHost>
mv /data/www/index.html /data/www/index.origin sh -c 'cat /data/www/index.origin | grep -v DEMO-APPS > /data/www/index.html'
cp -r /data/pv/pv-current/share/paraview-4.4/www/* /data/www/
sudo chown -R pvw-user /data/www sudo chgrp -R apache /data/www
su -c "/usr/bin/chcon -R --reference=/etc/httpd/logs /data/logs" su -c "/usr/bin/chcon -R --reference=/var/www /data/www" su -c "/usr/bin/chcon -R --reference=/var/www /data/proxy.txt"
su -c "setsebool -P httpd_can_network_connect 1"
firewall-cmd --permanent --add-service=http firewall-cmd --permanent --add-service=https
firewall-cmd --add-service=http firewall-cmd --add-service=https