Version 9 (modified by forgacs, 2 years ago)

--

Installing MediaMosa

Unpack you MediaMosa

  • Unpack it to your web directory (typically /var/www/your-site or /srv/www/your-site).

Set up Database

We advice using  MySQL v5.1, or use MySQL variant like  MariaDB.

MediaMosa is currently untested with  PostgreSQL.

Use the database mediamosa example below to create your database 'mediamosa' with user 'mediamosa' before proceeding.

# The password entries below needs to be changed.

# Create the database.
CREATE DATABASE mediamosa DEFAULT CHARSET=utf8;

# Create localhost access for user 'mediamosa'.
CREATE USER 'mediamosa'@'localhost' IDENTIFIED BY 'mediamosa';

# Now grant usage for user 'mediamosa' on the 'mediamosa' database.
GRANT USAGE ON mediamosa.* TO 'mediamosa'@'localhost' IDENTIFIED BY 'mediamosa' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;

GRANT ALL ON mediamosa.* TO 'mediamosa'@'localhost';

You may change the 'mediamosa' database prefix and the database user name.

If you want to migrate your current MediaMosa v1.7 database to the new 2.x version, you have to create or have a database user, which has enough rights to read your current v1.7 databases.

Mount point

Create a mount point with read / write rights for Apache user (www-data), eg. /srv/mediamosa

Apache

Insert the vhost setup below into the new file /etc/apache2/sites-available/your-site, where your-site is the name of your MediaMosa site:

<VirtualHost *:80>
    ServerName !server_name_clean
    ServerAlias admin.!server_name_clean www.!server_name_clean
    ServerAdmin webmaster@!server_name_clean
    DocumentRoot !document_root
    <Directory !document_root>
        Options FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>

    ErrorLog /var/log/apache2/!server_name_clean_error.log
    CustomLog /var/log/apache2/!server_name_clean_access.log combined
    ServerSignature On

    Alias /server-status !document_root
    <Directory !document_root/serverstatus>
        SetHandler server-status
        Order deny,allow
        Deny from all
        Allow from 127.0.0.1
     </Directory>

    # ticket
    Alias /ticket !mount_point/links
    <Directory !mount_point/links>
      Options FollowSymLinks
      AllowOverride All
      Order deny,allow
      Allow from All
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerName app1.!server_name_clean
    ServerAdmin webmaster@!server_name_clean
    DocumentRoot !document_root
    <Directory !document_root>
        Options FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>

    ErrorLog /var/log/apache2/app1.!server_name_clean_error.log
    CustomLog /var/log/apache2/app1.!server_name_clean_access.log combined
    ServerSignature On
</VirtualHost>

<VirtualHost *:80>
    ServerName app2.!server_name_clean
    ServerAdmin webmaster@!server_name_clean
    DocumentRoot !document_root
    <Directory !document_root>
        Options FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>

    ErrorLog /var/log/apache2/app2.!server_name_clean_error.log
    CustomLog /var/log/apache2/app2.!server_name_clean_access.log combined
    ServerSignature On
</VirtualHost>

<VirtualHost *:80>
    ServerName upload.!server_name_clean
    ServerAdmin webmaster@!server_name_clean
    DocumentRoot !document_root
    <Directory !document_root>
        Options FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>

    <IfModule mod_php5.c>
        php_admin_value post_max_size 2008M
        php_admin_value upload_max_filesize 2000M
        php_admin_value memory_limit 128M
    </IfModule>

    ErrorLog /var/log/apache2/upload.!server_name_clean_error.log
    CustomLog /var/log/apache2/upload.!server_name_clean_access.log combined
    ServerSignature On
</VirtualHost>

<VirtualHost *:80>
    ServerName download.!server_name_clean
    ServerAdmin webmaster@!server_name_clean
    DocumentRoot !document_root
    <Directory !document_root>
        Options FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>

    ErrorLog /var/log/apache2/download.!server_name_clean_error.log
    CustomLog /var/log/apache2/download.!server_name_clean_access.log combined
    ServerSignature On
</VirtualHost>

<VirtualHost *:80>
    ServerName job1.!server_name_clean
    ServerAdmin webmaster@!server_name_clean
    DocumentRoot !document_root
    <Directory !document_root>
        Options FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>

    ErrorLog /var/log/apache2/job1.!server_name_clean_error.log
    CustomLog /var/log/apache2/job1.!server_name_clean_access.log combined
    ServerSignature On
</VirtualHost>

<VirtualHost *:80>
    ServerName job2.!server_name_clean
    ServerAdmin webmaster@!server_name_clean
    DocumentRoot !document_root
    <Directory !document_root>
        Options FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>

    ErrorLog /var/log/apache2/job2.!server_name_clean_error.log
    CustomLog /var/log/apache2/job2.!server_name_clean_access.log combined
    ServerSignature On
</VirtualHost>
  • In the default Apache2 docroot configuration, set the 'AllowOverride' parameter to 'All'. This enables so-called Clean URLs to be used for the REST services, i.e. without ?q= syntax.

Enable the website:

sudo a2ensite your-site

Restart Apache:

sudo /etc/init.d/apache2 restart

PHP

  • In the PHP configuration file php.ini, set memory_limit = 128M.

Start your new site

  • Load your new site, chose the Mediamosa profile and follow the instruction.

Cron

Set up your cron. The cron will be used trigger MediaMosa every minute for background jobs. The setup for cron is required for MediaMosa to run properly.

Modify your cron using crontab:

  • crontab -e
  • Add this line at the bottom:
  • '* * * * * /usr/bin/wget -O - -q -t 1 --header="Host: your-host-name" http://localhost/cron.php?cron_key=your-cron-key
  • You can check your cron key on this page: admin/reports/status