Store large files in OpenCms VFS

From OpenCms Wiki
Revision as of 14:17, 31 March 2010 by 87.79.94.96 (Talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

Store large files in OpenCms VFS

Check MySQL setup

First of all, you have to tell MySQL to accept larger files by setting the "max_allowed_packet" parameter in section "mysqld" of your my.ini according to your needs. If you use mysqldump to backup the OpenCms database set the same parameter in section "mysqldump". Restart MySQL.

Modify database

If you choose a setup with MySQL OpenCms comes up with two tables for online and offline content which have medium blobs to store binary files such as PDF. A medium blob can store up to 16 MB of data, so here is your limit. If you have larger files you have to modify these two tables and change mediumblob to longblob as described in the following paragraph. Please don't forget to backup OpenCms before doing so.

  • Log into MySQL
  • use opencms;
  • ALTER TABLE CMS_OFFLINE_CONTENTS MODIFY COLUMN FILE_CONTENT LONGBLOB NOT NULL;
  • ALTER TABLE CMS_CONTENTS MODIFY COLUMN FILE_CONTENT LONGBLOB NOT NULL;

RAM might be next bottleneck

In order to be able to publish larger files you also might have to configure your application server such as tomcat to use more memory by setting the parameter "-Xmx" to a higher value (384M ie.). Restart tomcat afterwards.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox