Installation instruction¶
These are instructions for installing micala software for those people who want to hack on the code. We are currently running it on Windows Server 2008 and Windows 7 Enterprise (both 64-bit).
Please contact us by email if you cannot install correctly the software.
1. Install git and clone the repository¶
Install GIT. You can download it from the official website, it is free and available for all the platforms.
Create a directory where micala will live, e.g. C:micala or /home/slickwillie/micala. We’ll call this micalaHome from now on. And we’ll pretend your username is slickwillie.
In GNU/Linux, open a terminal and cd to micalaHome. In Windows, right-click on micalaHome and select Git Bash to start a terminal.
Type the following:
git clone git://micala.git.sourceforge.net/gitroot/micala/micala
cd micala
git checkout -b v0.4 remotes/origin/v0.4
git checkout -b slickwillie-developer-branch
exit
You have just cloned the entire git repository, so you now have an exact copy on your own machine of the git repository on the Sourceforge server (this is called “origin”). Then you created a local branch v0.4 that is a copy of the v0.4 branch on origin. Finally, you created a new local branch (which is an exact copy of v0.4) where you can make your changes. Every time you want to create a new feature, you should set up a new local branch. When your feature is ready, you will push your branch to origin and wait for it to be integrated.
After some time has passed, and there are changes to the origin repository, you can update your local repository with the latest changes as follows:
git checkout v0.4
git pull origin
git checkout slickwillie-developer-branch
git rebase v0.4
Doing it this way will not obliterate anything you have done, as long as you do it in your own local branch.
Note
Please refer to Development practices section for more information on how to configure GIT.
2. Install necessary software¶
Big packages
Now that you have downloaded, you can proceed to install all the software needed.
Python 2.7.1 from Python website. Don’t use version 3 of Python.
MySQLdb 5.1 from mysql.com
Create a new database
Edit the file /micala/monitoring/db_init/micala_init.bat.sample changing user e password values for db connection. Rename this file deleting ‘.sample’
Run micala_init.bat to import tables structure and datas in the db. WARNING: IF THE DATABASE EXISTS, THIS WILL DELETE IT!
Ensure that etc/conf.py and other config files are excluded in GIT.
Edit etc/conf.py with your local development (or production) db parameters. Edit also db backup parameters.
Open MySql command prompt, and write this command:
CALL CreateLectureLatestStatus();
Wait for the procedure ending. This procedure creates a new table needed by Micala.
WebServer: you can use Apache or IIS for example. We are currently using IIS with CGI, you can find the configuration instruction with Python here:
Go to Control Panel, Programs. On the Sidebar, click on “Turn Windows features on or off”: a new menu appears. Select ISS (Internet Information Service) feature and select CGI under ISS, WWWServices, Application Development Features. Press OK. ISS will be installed.
Then go to Control Panel, System and Security, Administrative Tools, click on Internet Information Services (IIS) Manager to manage sites. Create a new Site with right-click in Sites, Add Website...
Set a Website name, and point the Physical path to “C:micalaHomemicalamonitoringweb_interface”.
- Click on the name of the newly created website, and then on the button “Handler Mappings”. Click on “Add Script Map...” and fill
- Request path: *.py
- Executable: C:Python27Python.exe %s %s (you have to insert the right Python path)
Click yes on the next screen
Start the website and try it to test if ISS is set up correctly.
Download and install with Administrator rights also MySQLdb for Python. Because of installation problem with Python scripts on Windows, it’s better to find a msi installation. At this link you can find it (last check 31/08/2011)
Other third party utilities
- ffmpeg.exe, used everywhere in micala. Make sure that you get a copy with x264 lib compiled.
- mysqldump.exe [Program Files (x86)MySQLMySQL Server 5.1binmysqldump.exe] to backup the database
- plink.exe (part of the Putty package) or your ssh utility of choice (used if you need to execute command from Win to Unix machines)
- pscp.exe (part of the Putty package) or your scp utility of choice (used if you need to transfer command from Win to Unix machines)
- tar.exe (GNU Tar for Windows http://gnuwin32.sourceforge.net/packages/gtar.htm)
- libiconv-2.dll (used by tar, convert between character encodings download)
- libintl-2.dll (used by tar, library for native language support download)
- ffdshow, AviSynth, DevilLib, MatroskaSplitter (you can easily find them Googleing...)
3. Set environment variables¶
Add Python to your system path adding the below string to PATH System Environment Variables:
;c:\python27;c:\python27\scripts
You need to create a new System (Global) Environment Variable so Python knows where to find the conf.py and micala.py modules.
Windows
Go to Control Panel -> System -> Advanced System Settings -> Environment Variables -> System Variables and add this line:
PYTHONPATH=micalaHome\micala\etc
(replace micalaHome appropriately)
GNU/Linux
Add this line to your .bashrc file:
export PYTHONPATH=micalaHome/micala/etc
(replace micalaHome appropriately)
4. Other libraries¶
To install the following Python libraries, use SetupTools for Python 2.7. Then launch Console or Command Prompt with Administrator rights and type the commands:
easy_install mako
easy_install pil
easy_install lxml
easy_install python-ldap
easy_install numpy
Mako is template system engine used by the monitoring web interface. PIL is Python Image Library. lxml is a powerful Python lib to manage xml files. LDAP you need only in case for security policies, in case you have to restrict some folder according to user/group privileges: if your lectures will be all public, don’t install this.
Numpy is used with OpenCV. Download OpenCV image library used by the analyzing script.
jQuery
We can not distribute jQuery because it uses the GPL license. You need to get it yourself and exclude them from GIT. Place the jQuery file here:
micalaHome/monitoring/web_interface/js/jquery-1.5.min.js
Download jQuery UI from here and place the file here:
micalaHome/monitoring/web_interface/js/jquery-ui-1.8.6.custom.min.js
Put jQuery UI CSS file with images folder here:
micalaHome/monitoring/web_interface/css/jquery-ui-css/jquery-ui-1.8.6.custom.css
Download jQuery UI Tools from here selecting only Tooltip library, and place the file here:
micalaHome/monitoring/web_interface/js/jquery.tools.min.js
5. Set up the micala configuration file¶
6. Optional¶
SSL Certificate (Testing server)
If you don’t want to use SSL, skip this step and change web interface links.
To get access to HTTPS pages in the admin section, you need a valid SSL certificate. For your development environment you can use a Self-Signed Certificate. Here the procedure for Windows and IIS:
Download SelfSSL (part of IIS Resource KIT) from Microsoft Website, and install it.
Open a Command Prompt with Administrator rights. Locate the SelfSSL.exe file in C:Program Files (x86)IIS ResourcesSelfSSL
Write this command, replacing your domain name instead of mydomain.com, /S parameter with your website unique ID (find it con IIS Manager, default is 1) and /V parameter with the number of days that the certificate will be valid:
selfssl.exe /T /N:CN=mydomain.com /S:2 /V:1000
If error appears, ignore it. Check if the certificate is correctly created going to Microsoft Management Console, Certificates Snap-in (from File menu, Add/Remove Snap-in) and watching inside the folder Personals and then Certificates. Your domain name certificate should be present here.
Come back to IIS Manager, check if present under Server Certificates.
Right-click on your website, then Edit Bindings..., add a new site binding using HTTPS type, port 443 and selecting your certificate.
Now HTTPS pages of Micala should work.
For a full guide with screenshots, follow this link