-
Notifications
You must be signed in to change notification settings - Fork 0
Install Movim
This tutorial describes the different steps you need to take to deploy Movim on your webserver. It can be followed from version 0.9 (included).
Movim requires some dependencies to be setup properly.
- A fully working webserver like Apache or Nginx ([http://nginx.org/en/docs/http/websocket.html](version 1.3.13 minimal))
- Root access by SSH with access to the webserver user (most of the time via the user www-data)
- A database server like MySQL or PostgreSQL with a schema for Movim
- PHP 5.3 minimum with :
- Curl (package ''php5-curl'')
- PHP ImageMagick and GD for the picture processing (package ''php5-imagick'' and ''php5-gd'')
- And the database PHP driver (package ''php5-pgsql'' or ''php5-mysqlnd'')
It's mandatory to understand the general architecture of the project to a certain extent before trying to deploy it.
When you use Moving, it acts as an intermediary between the user's browser and his/her XMPP server. All the data that is sent and received by these two parties are managed by the Movim core, some of them are also saved in a database (for cache purposes).
From the browser perspective, all communication with Movim is done using WebSockets (except the "default" page loading). These sockets are proxied through your web-server to the Movim daemon. On the XMPP side Movim is connecting using pure TCP connections (like every XMPP client).
So all these streams will be managed by the Movim daemon. This daemon needs to be launched with the same user and rights as the web-server (most of the time using the www-data
user).
The Movim source code is not available in a packaged version for now, please follow the next paragraph. You simply have to clone it from git and put it on your web server. The package contains everything to make Movim run on your system.
The next part is only required for those who want to install the development version. If you took the Movim package from the repository please jump to the next chapter and go directly to the Deployment section.
The development version of Movim only comes with the core of the project. To install the dependencies you need to install a couple of version control systems to download the source codes from the different source repositories.
# Install Git and Mercurial so the composer can clone the dependencies into your project
apt-get install git mercurial
Git is required to properly get the source code from the official repository. We recommend to execute the following commands with the www-data
user (which is the common user for most of the GNU/Linux web servers).
cd /var/www/ # Server directory
sudo -s -u www-data # We use the web-server user
git clone https://github.com/edhelas/movim.git # We copy the source code from the repository
cd movim
Movim requires several dependencies to work properly. These libraries are managed using https://getcomposer.org/. You can install Composer in the Movim directory using the following command.
curl -sS https://getcomposer.org/installer | php
Now you will be able to install the dependencies.
# Finally install your project's dependencies
php composer.phar install
You can also update your current Movim instance with the following lines (check anyway if the updates do not include any incompatibilities with your current version).
cd /var/www/movim/
git pull # To update the Movim source-code
php composer.phar install # To update the libraries
If the update come with some database changes, please check in the Administration Panel (Database tab) if Movim ask you to update it.
This part of the tutorial can be followed for the stable and testing installation. They need to be applied in the correct order.
Movim needs to have the right to create some folders in its root folder to be deployed properly. You can easily fix this with something like theses few lines. You don't need to apply theses rights recursively, only the root folder needs to be writable.
# Use the root user to do the chown
chown www-data movim/
As soon as Movimhas the correct write rights, it will create several folders:
- log/ for the PHP logs
- users/ for the users pictures
- cache/ for the thumbnails and some temporary files
Movim needs to be connected to a database to work properly. Rename the example file in the config
folder to db.inc.php
and fill the fields with your current configuration.
cd movim/config/
cp db.example.inc.php db.inc.php
# Edit db.inc.php with your current configuration
To let the browser communicate with the Movim server you need to launch the daemon. It also needs to be launched using the webserver user.
sudo -s -u www-data # if you are on Ubuntu
Then launch the daemon with two mandatory parameters:
-
The public URL of Movim, for the official pod it is
http://pod.movim.eu/
, don't forget the/
at the end. -
The port used by the daemon, 8080 in our case.
cd /var/www/movim php daemon.php 8080 # we launch the daemon
If everything run fine you should see:
Movim daemon launched
Base URI : https://pod.movim.eu/
...
Encrypted Public WebSocket URL : wss://pod.movim.eu/ws/
This daemon will be killed once you close your console. Use a command like screen
(see [http://www.rackaid.com/blog/linux-screen-tutorial-and-how-to/(How To Use Linux Screen)) or tmux
to keep the console open, even after your disconnection.
When you launch the daemon, it will generate the configuration to apply to your webserver to "proxify" the WebSockets.
Theses configurations are generated and should fit your configuration.
Here is an example of generated configuration.
Enable the Proxy WebSocket module.
# a2enmod proxy_wstunnel
Add the following line to your configuration file (default-ssl.conf
if you have enabled HTTPS)
ProxyPass /ws/ ws://localhost:8080/
Add the following configuration
location /ws/ {
proxy_pass http://localhost:8080/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_read_timeout 86400s;
proxy_send_timeout 86400s;
proxy_redirect off;
}
Now that everything is setup you can configure Movim using the Admin Panel :
http://localhost/movim/?admin
Here you can change the default admin
and password
credential by your personals one.
Some of the configuration elements are only applied after the reboot of the daemon.