Requirements
To install ViMP, you need a dedicated server running any Linux operating system (Debian Squeeze recommended), a web server (Apache2), PHP and a MySQL database.
We recommend the following minimum hardware configuration:
- Dual-Core processor or better with at least 2.5 GHz
- At least 4 GB RAM
- At least 250 GB Disk space (SATA-II or SAS). For additional data security, we recommend using a RAID controller.
The following software is required to run ViMP:
- Apache2: Version 2.2 recommended & mod_rewrite must be enabled
-
PHP: At least version 5.2.7 & GD, mysql, XSL and cURL extensions must be installed &
PHP CLI (Command Line Interface) must be installed
- MySQL: At least version 5.0 required & InnoDB storage engine is required
-
Transcoding: MEncoder / MPlayer 1.0RC2 or newer ,FFmpeg ,Additional codec packages & Ruby and FLVTool2
Preparing the server:
Update server (not used on production servers)
apt-get update
apt-get upgrade
apt-get dist-upgrade
To install Apache2, simply run:
apt-get install apache2
Now, enable mod_rewrite:
a2enmod rewrite
/etc/init.d/apache2 restart
To install PHP5, run:
apt-get install libapache2-mod-php5
Then, install the additional packages:
apt-get install php5-cli php5-mysql php5-gd php5-xsl php5-curl
To install the MySQL database server, run the following commands:
apt-get install mysql-server
When prompted for a root password, Make sure to remember the password or write it down in a safe place, you’ll need this password later.
Transcoding: First, add the additional multimedia packages to the package source list of the operating system. Therefore create a configuration file in /etc/apt/sources.list.d:
touch /etc/apt/sources.list.d/debian-multimedia.org.list
Once the file is created, open it with an editor and add the following lines:
# Debian Multimedia Repository
deb http://www.debian-multimedia.org stable main non-free
deb-src http://www.debian-multimedia.org stable main non-free
deb ftp://ftp.debian-multimedia.org stable main non-free
deb-src ftp://ftp.debian-multimedia.org stable main non-free
Next, the keyring of debian-multimedia.org has to be installed:
apt-get update
apt-get install debian-multimedia-keyring
Now install the packets of the transcoding software:
apt-get install mplayer mencoder ffmpeg flvtool2
Next, let’s install the essential codec package for MEncoder. This package provides basic binary codecs for video decoding and encoding. Please check what kind of architecture (32 Bit or 64 Bit) your system has and only install the package for your architecture.
Installation on 32-Bit systems:
apt-get install w32codecs
Configuration:
Once all packages are installed, some configuration settings need to be adjusted.
Apache2
If you are planning to install your video website in a sub-directory (e.g. http://http://www.myportal.com/community) skip this section and follow the instructions in the appendix section Installing ViMP into a sub-directory.
We recommend creating a new virtual host in a separate directory for this installation. Therefore we will first create the directories:
mkdir -p /var/www/myportal/data
mkdir -p /var/www/myportal/logs
chown -R www-data:www-data /var/www/myportal
Now create the configuration file for this virtual host:
cd /etc/apache2/sites-available
touch
myportal
Once you have created the file, open it in your favorite editor and create the VirtualHost entry:
<VirtualHost *:80>
DocumentRoot “/var/www/myportal/data/web”
ServerName
myportal.com
ServerAlias http://www.myportal.com
<Directory “/var/www/myportal/data/web”>
AllowOverride All
RewriteEngine On
Options -Indexes FollowSymLinks
</Directory>
ErrorLog /var/www/myportal/logs/error.log
CustomLog /var/www/myportal/logs/access.log combined
LogLevel error
</VirtualHost>
Save the file and close the editor. We will now enable the virtual host:
a2ensite myportal
/etc/init.d/apache2 reload
PHP
First, adjust the values for the PHP Apache2 module. Open /etc/php5/apache2/php.ini in your favorite editor. Then locate the following entries and change their values to the indicated values:
- upload_max_filesize: 1024M
- post_max_size: 1024M
-
memory_limit: 512M
Once you are done, save and close the file. Then change the settings for PHP CLI by opening /etc/php5/cli/php.ini and change the values as indicated above.
When you are done, restart Apache2 to load the new configuration:
/etc/init.d/apache2 restart
MySQL
First, let’s create a database for the community:
mysqladmin -p create myportal
When prompted for a password, enter the root password you have chosen while installing MySQL.
Next we’ll create a designated user for this database. Therefore enter the MySQL console:
mysql -u root –p
Next, enter the following SQL queries. Please note that all queries must be terminated with a semicolon:
mysql > CREATE USER myportal@localhost IDENTIFIED BY ‘<password>’;
GRANT ALL PRIVILEGES ON myportal.* TO myportal;
FLUSH PRIVILEGES;
mysql >exit
Please replace <password> by a strong password and remember it. It will be needed later during the installation.
Installation
Now that all programs are configured, we can install ViMP. Therefore the ViMP download package needs to be on the server. Copy the archive containing ViMP into the directory we have created before (/var/www/myportal/data). Then, extract the archive:
cd /var/www/myportal/data
tar xvzf vimp.framework-<version>.tar.gz
This will extract all files into the current directory. Once you are done, delete the archive:
rm vimp.framework-<version>.tar.gz
If you have modified ViMP, copy all files to the /var/www/myportal/data directory.
Then make the symfony file executable:
chmod +x symphony
Now
Installation of the SourceGuardian PHP extension:
We assume that a virtual host has been set up and points to the directory /var/www/myportal/data.
Extract the PHP extension to a temporary directory:
mkdir /tmp/loader
cd /tmp/loader
tar xfz /var/www/myportal/data/data/loader.tar.gz
Now the PHP extension is located in this directory, including different files for different operating systems. Select the operating system and PHP version that fits for your server and copy the file into the lib directory of PHP:
cp Linux_x86-32/ixed.5.2.lin /usr/lib/php5/20060613+lfs/
Next you need to tell PHP, that it must load the extension. Therefore create a configuration file in /etc/php5/conf.d:
cd /etc/php5/conf.d/
touch sourceguardian.ini
Once the file is created, open it with an editor and add the following lines:
[sourceguardian]
zend_extension=/usr/lib/php5/20060613+lfs/ixed.5.2.lin
Save the file and close the editor. Then restart Apache2:
/etc/init.d/apache2 restart
Next, run the framework:init
task by adding the above DSN:
./symfony framework:init mysql://myportal:<password>@localhost/myportal
After that you need to set up the cronjob which converts uploaded videos into the needed formats. Edit the crontab:
crontab –e
And add the following line at the bottom:
*/1 * * * * /var/www/myportal/data/scripts/sync_new_uploads.sh > /dev/null 2>&1
This will execute the sync script every minute. If no new media files are found, the script simply terminates without any further actions.
Basic usage
The installation is complete now. Point your browser to http://http://www.myportal.com to see your video website in action.
The in it task automatically creates three users representing the three access roles:
- admin (password: admin) as administrative user
- moderator (password: moderator) as moderator user
- user
(password: user) as basic user