===================== How to install Pyrame ===================== .. note:: Pyrame needs root priviledges to be installed and, depending on the modules used, also to be executed. Install it and use it as root, or otherwise use sudo as needed. Dependencies on Scientific Linux 6.6 and CentOS 7 ================================================= Install the dependencies: .. code:: bash yum -y install epel-release yum -y install psmisc gcc gcc-c++ python python-devel python-pip expat-devel lua-devel python-pip flex flex-devel pip install --upgrade pyserial notify2 argparse If you want to generate the documentation, install also: .. code:: bash pip install --upgrade docutils Pygments sphinx If you want to use a web binding, install httpd: .. code:: bash yum -y install httpd Dependencies on Debian-based distribution ========================================= Install the dependencies: .. code:: bash apt-get -y install psmisc gcc g++ python python-dev python-pip libexpat1-dev liblua5.1-dev python-pip flex pip install --upgrade pyserial notify2 argparse If you want to generate the documentation, install also: .. code:: bash pip install --upgrade docutils Pygments sphinx If you want to use a web binding, install apache: .. code:: bash apt-get install apache2 Installation ============ .. warning:: If you have a previous version of Pyrame it is important to go to the sources of that version, and `make uninstall`. This will avoid conflicts with the new version. If you want to clean even more, remove /opt/pyrame Get the source code from our `website `_ .. note:: In Debian systems you might need to create links for lua.h and liblua.so:: updatedb ln -s `locate -b "\liblua5.1.so"` /usr/lib/liblua.so ln -s /usr/include/lua5.1/lua.h /usr/include/lua.h ln -s /usr/include/lua5.1/luaconf.h /usr/include/luaconf.h ln -s /usr/include/lua5.1/lualib.h /usr/include/lualib.h ln -s /usr/include/lua5.1/lauxlib.h /usr/include/lauxlib.h Get into it, compile and install. The installation path is /opt/pyrame/ : .. code:: bash tar -xf pyrame_latest.tgz cd pyrame make install To compile the documentation, go into docs and make: .. code:: bash cd docs make install The documentation will be accessible at /opt/pyrame/doc/index.html Web bindings ============ If you are using SELINUX, disable it. For Scientific-Linux 6.6 and CentOS 7, set SELINUX=permissive or SELINUX=disabled in /etc/selinux/config. Then reboot. In order to use the *XMLHttpRequest* to Pyrame binding do: if using Scientific-Linux 6.6: .. code:: bash pyrame/xhr/install_xhr_sl6_apache2.sh if using CentOS 7: .. code:: bash pyrame/xhr/install_xhr_centos7_apache2.sh if using a Debian-based distribution: .. code:: bash pyrame/xhr/install_xhr_debian8_apache2.sh Kernel ====== It is important to adjust the TCP socket options in the kernel for recycling quickly the tcp sockets. This can be done once: .. code:: bash echo 1 > /proc/sys/net/ipv4/tcp_tw_recycle echo 1 > /proc/sys/net/ipv4/tcp_fin_timeout or definitively .. code:: bash cp -f pyrame/launcher/99-pyrame.conf /etc/sysctl.d/ First start =========== Pyrame can now be started on systemd distributions: .. code:: bash systemctl restart pyrame For other distributions: .. code:: bash /etc/init.d/pyrame restart You can see the log with command .. code:: bash pyrlog if you supply an argument to pyrlog, it will filter the log with the argument (like grep)