Book Image

TYPO3 4.3 Multimedia Cookbook

Book Image

TYPO3 4.3 Multimedia Cookbook

Overview of this book

TYPO3 is one of the world's leading open source content management systems, written in PHP, which can be used to create and customize your web site. Along with text content, you can display high quality images, audio, and video to your site's visitors by using TYPO3. It is essential to manage various types of multimedia files in content management systems for both editors and the users on the frontend of the site.The book gives you a step-by-step process for organizing an effective multimedia system. It also gives solutions to commonly encountered problems, and offers a variety of tools for dealing with multimedia content. The author's experience in large-scale systems enables him to share his effective solutions to these problems.If you choose to work through all the recipes from the beginning, you will start by setting up a basic web site set up, aimed at future expansion and scalability. Next, you will cover the basics of digital asset management—a major topic important in all enterprises. You can organize user groups because next you will be creating accounts for users and assigning permissions. Then you will jump into metadata—text information describing the multimedia objects—and learn how it can be manipulated in TYPO3. You will embed multimedia on your site when you have read the various methods for embedding mentioned in this book. Before you finish the book you will learn about some advanced topics, such as external API integrations and process automation.
Table of Contents (13 chapters)
TYPO3 4.3 Multimedia Cookbook
Credits
About the Author
About the Reviewers
Preface

Setting up a multithreaded environment


TYPO3 is an enterprise content management system, so it is thread safe—meaning two instances of the script can be executed simultaneously, and they will run in parallel without interfering with each other. Therefore, Apache can be set up with mod_fcgid and PHP processes will be allowed to run in parallel.

Note

This setup is not recommended if you have a server with only one or two core processor.

How to do it...

  1. 1. Install components of the server:

    Shell> apt-get install libapache2-mod-fcgid apache2-mpm-worker php5-cgi Shell> a2enmod actions Shell> a2enmod fcgid
    
  2. 2. Replace contents of /etc/apache2/mods-available/fcgid.conf with:

    <IfModule mod_fcgid.c> AddHandler fcgid-script .fcgi SocketPath /var/lib/apache2/fcgid/sock IPCConnectTimeout 60 IPCCommTimeout 256 BusyTimeout 256 ProcessLifeTime 256 </IfModule>
    
  3. 3. Modify site configuration, by default located in /etc/apache2/sites-available/default

  4. 4. Add the following to the virtual host definition:

    Alias /fcgi-bin/ /var/www/fcgi-bin.d/
    Action php-fcgi /fcgi-bin/php-fcgi-wrapper
    
  5. 5. Add the following lines to the directory definition for /var/www/:

    AddHandler fcgid-script .php
    FCGIWrapper /usr/bin/php-cgi .php
    
  6. 6. While there, modify the Options, adding +ExecCGI. Your final site configuration should look like this:

    <VirtualHost *:80>
    ServerAdmin webmaster@localhost
    Alias /fcgi-bin/ /var/www/fcgi-bin.d/
    Action php-fcgi /fcgi-bin/php-fcgi-wrapper
    DocumentRoot /var/www/
    <Directory /var/www/>
    AddHandler fcgid-script .php
    FCGIWrapper /usr/bin/php-cgi .php
    Options Indexes FollowSymLinks MultiViews +ExecCGI
    AllowOverride None
    Order allow,deny
    allow from all
    </Directory>
    </VirtualHost>
    

    Note

    Refer to the Apache manual for descriptions of some of the options listed above, as well as other configuration options.

  7. 7. Create the executable link to PHP CGI module:

    Shell> mkdir /var/www/fcgi-bin.d Shell> ln s /usr/bin/php5-cgi /var/www/fcgi-bin.d/php-fcgi-wrapper
    

How it works...

apache2-mpm-worker package, downloaded in the first command line call, is designed to run several threads simultaneously. PHP CGI binary is installed in the same statement.

We then enable the fcgid Apache module, and adjust its configuration. Most installations need to increase the timeout; otherwise, you will be looking at an Internal Server Error if the page rendering takes too long. To further complicate the diagnosis, timeouts are not recorded in logs. We increase the values of IPCConnectTimeout, IPCCommTimeout, and BusyTimeout, along with the ProcessLifeTime. Depending on your configuration, you may need to increase these values further.

Now, when a request comes in to Apache, the PHP CGI process will be launched to handle it. With multiple simultaneous requests, multiple processes will be launched, and run parallel to each other, handling individual requests.

Note

If you have multiple clients using this server, they can have separate PHP processes, and not interfere with each other (for security purposes). You can find more information on configuring this set up at http://typo3.org/development/articles/using-php-with-mod-fcgid/.

See also

  • Creating a scalable architecture

  • Setting up an NFS share