MAJ terminée. Nous sommes passés en version 14.6.2 . Pour consulter les "releases notes" associées c'est ici :

Commit 39e7927e authored by HERBERT Ryan's avatar HERBERT Ryan
Browse files

Adding some specs for manual installation of the server and linking it to the browser

parent b223e9ee
......@@ -24,6 +24,162 @@ These installation instruction are for Ubuntu server 14.04
The process for installing Vidjil server together with a real web server
will be detailed in the future.
** Detailed manual server installation and browser linking
ssh, zip unzip, tar, openssh-server, build-essential, python, python-dev,
mysql, apache2, libapache2-mod-wsgi, python2.5-psycopg2, postfix, wget,
python-matplotlib, python-reportlab, mercurial, git
For simplicity this guide will assume you are installing to /home/www-data
Download and unzip web2py. Copy the contents of web2py to the server/web2py
folder of you Vidjil installation
(in this case /home/www-data/vidjil/server/web2py) and give ownership to www-data:
chown -R www-data:www-data /home/www-data/vidjil
You can run the following commands to make sure all the apache modules you need
are activated:
a2enmod ssl
a2enmod proxy
a2enmod proxy_http
a2enmod headers
a2enmod expires
a2enmod wsgi
a2enmod rewrite # for 14.04
In order to setup the SSL encryption a key to give to apache. The safest option
is to get a certicate from a trusted Certificate Authority, but for testing
purposes you can generate your own:
mkdir /etc/apache2/ssl
openssl genrsa 1024 > /etc/apache2/ssl/self_signed.key
chmod 400 /etc/apache2/ssl/self_signed.key
openssl req -new -x509 -nodes -sha1 -days 365 -key /etc/apache2/ssl/self_signed.key > /etc/apache2/ssl/self_signed.cert
openssl x509 -noout -fingerprint -text < /etc/apache2/ssl/self_signed.cert > /etc/apache2/ssl/
Given that Vidjil is a two-part application, one that serves routes from a server
and one that is served statically, we need to configure the apache to do so.
Therefore we tell the apache to:
- Start web2py as a wsgi daemon (allows apache to serve the application).
- Reserve two virtual hosts (one to be served with ssl encryption, and one not).
- We configure the first host to serve static content and prevent overriding
by the sever (otherwise all routes are redirected through web2py) and to follow symlinks
this allows us to symlink to our browser app in the /var/www directory and keep both parts
of Vidjil together.
- The second is set to use SSL encryption, and only serve very specific folders statically (such
as javascript files and images because we don't want to create a controller to serve that kind of data)
you can replace your apache default config with the following
(/etc/apache2/sites-available/default.conf - remember to make a backup just in case):
WSGIDaemonProcess web2py user=www-data group=www-data processes=1 threads=1
<VirtualHost *:80>
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
ScriptAlias /cgi/ /usr/lib/cgi-bin/
<Directory /usr/lib/cgi-bin/>
Options Indexes FollowSymLinks
Options +ExecCGI
#AllowOverride None
Require all granted
AddHandler cgi-script cgi pl
<Directory /home/www-data/vidjil/browser>
AllowOverride None
CustomLog /var/log/apache2/access.log common
ErrorLog /var/log/apache2/error.log
<VirtualHost *:443>
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/self_signed.cert
SSLCertificateKeyFile /etc/apache2/ssl/self_signed.key
WSGIProcessGroup web2py
WSGIScriptAlias / /home/www-data/vidjil/server/web2py/
WSGIPassAuthorization On
<Directory /home/www-data/vidjil/server/web2py>
AllowOverride None
Require all denied
Require all granted
AliasMatch ^/([^/]+)/static/(?:_[\d]+.[\d]+.[\d]+/)?(.*) \
<Directory /home/www-data/vidjil/server/web2py/applications/*/static/>
Options -Indexes
ExpiresActive On
ExpiresDefault "access plus 1 hour"
Require all granted
CustomLog /var/log/apache2/ssl-access.log common
ErrorLog /var/log/apache2/error.log
Now we want to activate some more apache mods:
a2ensite default # FOR 14.04
a2enmod cgi
Restart the server in order to make sure the config is taken into account.
And create some symlinks to avoid splitting our app:
ln -s /home/www-data/vidjil/server/browser /var/www/browser
ln -s /home/www-data/vidjil/server/browser/cgi/align.cgi /usr/lib/cgi-bin
Now we need to configure the database connection parameters:
- create a file called conf.js in /home/www-data/vidjil/browser.js containing:
var config = {
\"cgi_address\" : \"default\",
/*database */
\"use_database\" : true,
\"db_address\" : \"default\",
\"debug_mode\" : false
This tells the browser to access the server on the current domain.
- copy vidjil/server/web2py/applications/vidjil/modules/
to vidjil/server/web2py/applications/vidjil/modules/
and change the value of DB_ADDRESS to reference your database.
//TODO detail user creation
You can now access your app
* Testing the server
If you develop on the server, or just want to check if everything is ok, you
should launch the server tests.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment