Learn / eZ Publish / The eZ publish Web Server Environment

The eZ publish Web Server Environment

The web server environment

The web server environment includes the operating system and third-party applications that eZ publish requires in order to run. In addition to an operating system (preferably Linux), eZ publish requires the following components:

  • Apache web server
  • PHP
  • Alternative PHP Cache (APC)
  • ImageMagick or GD

One or more of these components may already be installed on your Linux server. Before building and installing the components as described below, check for previously installed versions.

Request model on the server side

This diagram shows the process by which URL requests are handled by an eZ publish server:

Database

eZ publish content objects are stored in a database. While eZ publish can use MySQL, PostgreSQL or Oracle, MySQL is the preferred database for optimal performance. MySQL can either be installed on the same server as eZ publish or on another server. When running eZ publish in a clustered environment (that is, load balanced over multiple web servers) we recommend that you run a Squid reverse proxy cache in front of eZ publish.

Installing and configuring MySQL will be the topic of an upcoming article. For general instructions, refer to the documentation.

Intel ICC compiler

The Intel ICC Compiler automatically optimizes and parallelizes code to take best advantage of Intel processors. You can get better performance results with Apache, PHP and APC if they are compiled for Intel processors with ICC.

The Intel ICC Compiler for Linux is proprietary software and requires a valid license . For more information and for trial versions, refer to http://www.intel.com/software/products/compilers/clin/. Refer to the INSTALL file included with the distribution for installation instructions.

To compile Apache, PHP and APC with ICC (as described in the following sections), you must export the CC environment variable:

shell> export CC=/opt/intel/cc/9.0/bin/icc

Before you run the configure script, make sure that the CC variable is exported correctly. Be sure that you remove any config.cache files before running configure, and run make clean after configuring before compiling.

ICC results

We compared the results of compiling Apache, PHP and APC with the ICC compiler versus compiling with the GNU C Compiler (GCC). All tests were done with 50 000 articles in the database. The test case was listing a folder with 5 000 articles sorted by publishing time, displaying ten articles at a time. MySQL was configured with a read cache in this configuration, and was only taking 1.5% of the processing time. Therefore, most of the time was used for PHP processing on the web server.

The tests were done with three configurations

  1. Template compilation and view cache disabled
  2. Template compilation enabled and view cache disabled
  3. Template compilation enabled and view cache enabled
  Case 1 Case 2 Case 3
GCC template total 0.9589 seconds 0.5147 seconds 0.0480 seconds
ICC template total 0.7713 seconds 0.4184 seconds 0.0396 seconds
Template difference 19.57% 18.72% 17.39%
GCC pageviews 2.760 4.79 33.24
ICC pageviews 3.15 5.33 35.33
Page difference 12.73% 11.32% 6.28%

We see that the performance gain in the template processing is quite good, up to almost 20%. The performance increase in the pageview is almost 13% faster; this indicates that the more processing the page requires, the bigger the performance improvement gained by using the ICC compiler. The total increase in performance measured with actual pageviews, including transfer from server to client is faster regardless of the page size, but it is especially noticeable when cache is disabled (which requires more serverside processing).

Apache is the web server application that handles incoming requests for content. Depending on the kind of request, it will either serve content itself or pass the request to PHP. For example, if you request an image it might be served directly from Apache, while PHP scripts are executed by the PHP module. In the case of eZ publish there is a combination of these request types.

Obtaining Apache

The Apache web server is free software and can be downloaded from http://httpd.apache.org/download.cgi

Apache versions

There are two main versions of Apache currently in use: 1.3 and 2. Apache 1.3 is recommended, as PHP running on that version is the most stable and mature.

A non-threaded web server is recommended, because there could be problems related to PHP extensions and the libraries it links to with scripts that run in a threaded environment. The reason for this is that not all libraries that PHP uses are thread safe and under heavy traffic problems might occur.

If you cannot use Apache 1.3, make sure to use the "prefork" version of Apache 2, not the "worker" version. The "worker" version is a Multi-Processing Module implementing a hybrid multi-threaded multi-process web server. By using threads to serve requests, it is able to serve a large number of requests using less system resources than a process-based server. For more information about Apache 2 with a threaded MPM, refer to

http://www.php.net/manual/en/faq.installation.php#faq.installation.apache2.

Some of the major differences between the 1.3 and 2.0 versions of Apache are:

  • Multi-Processing Modules (MPMs): The server ships with a selection of Multi-Processing Modules (MPMs) that are responsible for binding to network ports on the machine, accepting requests, and dispatching children to handle the requests. For maximum eZ publish stability and compatibility, Apache 2 should be run in "prefork" mode with PHP.
  • New Apache API: The API for modules has changed significantly in version 2.0. Many of the module-ordering and module-priority problems from 1.3 are fixed. 2.0 handles much of this automatically, and module ordering is now done per-hook to allow more flexibility. Also, new calls have been added that provide additional module capabilities without patching the core Apache server.
  • Apache module enhancements: The server ships with the new and enhanced modules including:
    • mod_ssl: This module is an interface to the SSL/TLS encryption protocols provided by OpenSSL.
    • mod_deflate: This module allows supporting browsers to request that content be compressed before delivery, saving network bandwidth.
    • mod_proxy: The proxy module has been completely rewritten to take advantage of the new filter infrastructure and to implement a more reliable, HTTP/1.1 compliant proxy. In addition, new <Proxy> configuration sections provide more readable (and internally faster) control of proxied sites; overloaded <Directory "proxy:..."> configuration are not supported. The module is now divided into specific protocol support modules including proxy_connect, proxy_ftp and proxy_http.

Installing Apache

If your Linux distribution does not include Apache, or does not include the version you need, you can compile Apache from source. Before you start, make sure that you have access to the root account.

The basic commands you must execute to compile and install Apache 1.3 from source are:

shell> cd /usr/local/src
shell> gunzip < /PATH/TO/apache_xxx.tar.gz | tar xvf -
shell> cd apache_xxx
shell> ./configure --prefix=/usr/local/apache --enable-module=so --enable-module=rewrite
shell> make
shell> su -
shell> make install
shell> /usr/local/apache/bin/apachectl start

These commands perform the actions described below

1. Choose the directory under which you want to unpack the distribution, and then change location into it. In the following example, we unpack the distribution under /usr/local/src.

shell> cd /usr/local/src

2. Obtain an Apache distribution from http://httpd.apache.org/download.cgi.

3. Unpack the source file, which creates the installation directory. This example shows how to unpack the distribution using gunzip:

shell> gunzip < /PATH/TO/apache_xxx.tar.gz | tar xvf -

The tar command creates a directory called "apache_xxx" (where "xxx" is the Apache version number). If you are using GNU tar, no separate invocation of gunzip is necessary. Instead, you can use the following command to uncompress and extract the distribution:

shell> tar zxvf /PATH/TO/apache_xxx.tar.gz

3. Change location into the installation directory:

<span>shell> cd apache_xxx</span>

4. Run the configuration script with following parameters:

shell> ./configure --prefix=/usr/local/apache --enable-module=so --enable-module=rewrite

The first parameter specifies where to install Apache. The second parameter tells Apache to compile support for loadable module support. The last parameter tells Apache to compile the rewrite function as a module. To see additional configuration options, run:

shell> ./configure -help

The configure script will take several minutes to run, as it tests for the availability of packages and prerequisites on your system and builds the Makefiles which will later be used to compile the Apache application.

5. Now you can build the Apache application by running the make command:

shell > make

6. Switch to the root user before executing the following commands:

> su -

If you do not have access to the root account, ask your system administrator for help.

7. Next, install the package under the configured installation PREFIX (as specified in the --prefix option described above):

shell> make install

8. Start the Apache HTTP server by running:

shell> /usr/local/apache/bin/apachectl start

At this point you should be able to request your first document via the URL http://localhost/. The web page you see is located in the DocumentRoot, by default /usr/local/apache/htdocs.

Stop the server by running:

shell> /usr/local/apache/bin/apachectl stop

Apache configuration instructions are described in the "Configurating Apache and PHP" section below.

Because the eZ publish CMS is written using the PHP scripting language (PHP is a recursive acronym for "PHP: Hypertext Preprocessor"), a PHP server-side engine is required. PHP is a widely used Open Source general-purpose scripting language that is especially suited for Web development and is used mainly for producing dynamic web content and server-side applications.

Obtaining PHP

PHP is free software. You can download packages either the complete source code or the pre-compiled binaries from http://www.php.net/downloads.php.

Make sure you install PHP 4.4. We recommend that your use the latest version of the 4.4 branch. Please note that eZ publish will not work correctly with PHP 5.

Building and installing PHP

If your Linux distribution does not include PHP (or does not include the correct version of PHP) you can compile PHP from source. Before you start make sure that you have access to the root account.

The basic commands you must execute to compile and install PHP 4.x.x from source are:

shell> cd /usr/local/src
shell> gunzip < /PATH/TO/php-4.x.x.tar.gz | tar xvf -
shell> cd php-4.x.x
shell> ./configure --with-apxs=/usr/local/apache/bin/apxs --with-config-file-path=/usr/local/apache/conf --with-mysql --enable-memory-limit --enable-mbstring --with-ttf --with-gd --with-jpeg-dir --enable-gd-native-ttf --with-png-dir --with-freetype-dir --with-zlib --with-dom --enable-exif
shell> make
shell> su -
shell> make install

A more detailed description of the steps for compiling and installing PHP 4.x.x from source follows:

1. Choose the directory under which you want to unpack the distribution, and then change location into it. In the following example, we unpack the distribution under /usr/local/src.

shell> cd /usr/local/src

2. Obtain a PHP distribution from http://www.php.net/downloads.php.

3. Unpack the source file, which creates the installation directory. This example shows how to unpack the distribution using gunzip:

shell> gunzip < /PATH/TO/php-4.x.x.tar.gz | tar xvf -

The tar command creates a directory called "php-4.x.x" (where "4.x.x" is the PHP version number). If you are using GNU tar, no separate invocation of gunzip is necessary. Instead, you can use the following command to uncompress and extract the distribution:

4. Change location into the installation directory:

shell> cd php-4.x.x

5. Run the configuration script with following parameters:

./configure --with-apxs=/usr/local/apache/bin/apxs --with-config-file-path=/usr/local/apache/conf --with-mysql --enable-memory-limit --enable-mbstring --with-ttf --with-gd --with-jpeg-dir --enable-gd-native-ttf --with- png-dir --with-freetype-dir --with-zlib --with-dom --enable-exif

These parameters are interpreted as follows:

--with-apxs=/usr/local/apache/bin/apxs

Compiles PHP as a shared module for Apache. This means that you will get a libphp4.so file that you will load into Apache as a dynamic module.

--with-config-file-path=/usr/local/apache/conf

Tells PHP to look for the php.ini configuration file in /usr/local/apache/conf.

<span>--with-mysql</span>

Compiles PHP with support for MySQL. If you have compiled MySQL yourself or if MySQL is located outside the default PATH on your system, you should specify --with-mysql=/PATH/TO/MYSQL to make sure that PHP is compiled using the correct version of MySQL. You will be able to check this with the phpinfo(); command when PHP is running. We highly recommend that you specify the path to the MySQL installation due to the fact that the client library available in PHP 4.4 is not up-to-date.

--enable-memory-limit

This options enables the ability to change the memory_limit allowed for each PHP script in the php.ini file. By default, the memory limit is set to 8 MB. Instructions for increasing the memory limit are included in the "Configurating Apache and PHP" section. When PHP is compiled with this option, you can see how much memory is used on eZ publish page processing by viewing the debug output. This option also helps prevent buggy scripts from consuming all available memory on a server.

You can also disable the memory limit for a slight performance increase, since PHP then does not have to check if the memory limit has been exceeded.

--enable-mbstring

This enables the multibyte string functions in PHP that are used by eZ publish for multibyte character sets.

--with-ttf / --with-freetype-dir  --with-jpeg-dir --enable-gd-native-ttf --with-png-dir

These configuration options are used with --with-gd to enable GD functionality for Freetype 1.x (--with-ttf), Freetype 2 (--with-freetypedir), JPEG support (--with-jpeg-dir), TrueType support (--enable-gd-native-ttf) and PNG support (--with-png-dir).

--with-gd

This option enables the GD Image functions in PHP. You must enable this if you intend to use eZ publish to create and manipulate image files in a variety of different image formats (for example, if you would like to use the gallery in eZ publish to resize images). You will also need this function to use the text-to-images function.

--with-zlib

This option enables the zlib compression functions in PHP that are used by eZ publish to transparently read and write gzip (.gz) compressed files.

--with-dom

This option enables the domxml extension that allows eZ publish to operate on an XML document with the DOM API. This will speed up performance, especially for multilingual sites where large XML translation files are used.

--enable-exif

With the exif extension enabled, eZ publish is able to work with image metadata. It can read metadata of pictures taken from digital cameras by working with information stored in the headers of the JPEG and TIFF images.

To see additional configuration options, run:

shell> ./configure --help

The configure script will take several minutes to run, as it tests for the availability of packages and prerequisites on your system and builds the Makefiles which will later be used to compile PHP.

6. Now you can build the PHP application by running the command:

shell > make

7. Switch to the root user before executing the following commands:

shell> su -

If you don't have access to the root account, ask your system administrator for help.

8. Next, install the package by running:

shell> make install

If there were no errors, PHP should be installed on your system. However, PHP requires some configuration, described in the next section, to make it work with Apache and MySQL.

Apache module (mod_php)

PHP can work as an Apache module or in CGI mode. For maximum performance we recommend that you install PHP as an Apache module. The difference between between the two is the execution method. When PHP is installed as CGI, for each script execution the server must load and start a PHP CGI process, which slows down the start up phase of the script's execution. For maximum performance and compatibility it is highly recommend that PHP is installed as an Apache module instead of CGI for eZ publish CMS.

PHP Command Line Interface (CLI)

Since version 4.3.0, PHP supports a new SAPI type (Server Application Programming Interface) named CLI ("Command Line Interface"). CLI's main focus is on developing shell (or desktop) applications with PHP. Note that CLI and CGI are different SAPIs, although they do share many of the same behaviors.

The CLI SAPI was released for the first time with PHP 4.2.0, but was still experimental and had to be explicitly enabled with the --enable-cli option when running ./configure. Since PHP 4.3.0 the CLI SAPI is no longer experimental and the option --enable-cli is on by default.

The PHP Command Line Interface is requirement for eZ publish to run the eZ publish PHP scripts from command line and access to all eZ publish features and do maintenance. For more information about the PHP CLI SAPI, refer to the PHP manual: http://php.net/manual/en/features.commandline.php

Apache and PHP are now installed in the system. Before you start using them you must make some configuration changes in the Apache and PHP configuration files.

PHP configuration

During the PHP installation we told PHP to look in the /usr/local/apache/conf directory for the php.ini configuration file. However, this file does not yet exist. Run the following command to create a new empty configuration file for PHP:

Recommended PHP configuration (php.ini) for eZ Publish

This section shows the recommended contents of the php.ini file located in the /usr/local/apache/conf directory.

; Safe Mode

safe_mode = Off

 
; Magic quotes for incoming GET/POST/Cookie data.
magic_quotes_gpc = Off

; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc.
magic_quotes_runtime = Off

register_globals = Off

allow_call_time_pass_reference = Off

; Maximum amount of memory a script may consume (xMB)
memory_limit = 64M

; Maximum execution time of each script, in seconds
max_execution_time = 90

; Whether to allow the treatment of URLs (like http:// or ftp://) as files.
allow_url_fopen = On

; Whether to allow HTTP file uploads.
file_uploads = On

; open_basedir, if set, limits all file operations to the defined directory
; and below. This directive makes most sense if used in a per-directory
; or per-virtualhost web server configuration file. This directive is
; *NOT* affected by whether Safe Mode is turned On or Off.
;open_basedir =

The contents of this snippet are interpreted as follows:

; Magic quotes for incoming GET/POST/Cookie data.

magic_quotes_gpc = Off

"Magic quotes" is a process that automatically escapes incoming data to the PHP script. It is preferred to code with magic quotes off and to instead escape the data as needed at runtime. eZ publish will work with this option enabled. However, it will slightly reduce performance because all input variables must be converted back to normal. Therefore we recommend that the option is turned off.

; Maximum amount of memory a script may consume (xMB)

memory_limit = 64M

The default maximum amount of memory a script may consume is 8 MB. This is too low for eZ publish to run. eZ publish needs at least 64 MB to run the Setup Wizard. Normal operation requires about 16 MB. However, we recommend that you keep the setting at 64 MB, as certain features (such as PDF export and search reindex) use more than 16 MB. Multilingual sites that store the content in Unicode (UTF-8) also require at least 64 MB.

; Maximum execution time of each script, in seconds

max_execution_time = 90

Depending on your hardware configuration, the execution time of some operations (like template compilation or parsing translation files) might take more than the default 30 seconds. We recommend that you increase the maximum execution time to at least 90 seconds. If you get output similar to the following , your max_execution_time setting is too low:

Fatal error: Maximum execution time of 30 seconds exceeded in ...

Fatal error: eZ publish did not finish its request

The execution of eZ publish was abruptly ended, the debug output is presented below.

Apache configuration

Once the PHP settings are configured, you must configure the Apache web server. Edit the httpd.conf file to load the PHP module. The Apache configuration file is located by default in the conf/ directory of the Apache installation (/ usr/local/apache/conf).

The LoadModule statement must point to the path of the PHP module on your system, usually libexec/libphp4.so under the Apache installation directory. The make install routine may have already added LoadModule for you in the httpd.conf, but check just in case.

LoadModule php4_module libexec/libphp4.so

Next we need to tell Apache to parse specific extensions as PHP scripts. The most common configuration is to tell Apache to parse the .php extension as PHP. You can assign any extension to PHP by simply adding more extensions to the list, with each extension separated by a space.

AddType application/x-httpd-php .php

It is also common to configure the .phps extension to show highlighted PHP source. This can be done as follows:

AddType application/x-httpd-php-source .phps

Virtual host configuration

By making use of virtual hosts, it is possible to have several sites running on the same server. The sites are usually differentiated by the domain name by which they are accessed. Apache will look for a specified set of domains and use different configuration settings based on the domain that is requested.

Virtual hosts are usually defined at the end of the httpd.conf configuration file, which is the main configuration file for Apache. To add a virtual host for eZ publish, copy the following lines and replace the text encapsulated by the square brackets with actual values. The next section has a real-life example of using virtual hosts.

Virtual hosts configuration example for eZ publish:

NameVirtualHost [IP_ADDRESS]

<VirtualHost [IP_ADDRESS]:[PORT]>
   <Directory [PATH_TO_EZPUBLISH]>
       Options FollowSymLinks
       AllowOverride None
   </Directory>

   <IfModule mod_php4.c>
       php_admin_flag safe_mode Off
       php_admin_value register_globals 0
       php_value magic_quotes_gpc 0
       php_value magic_quotes_runtime 0
       php_value allow_call_time_pass_reference 0
   </IfModule>

   DirectoryIndex index.php

   <IfModule mod_rewrite.c>
       RewriteEngine On
       Rewriterule ^/var/storage/.* - [L]
       Rewriterule ^/var/[^/]+/storage/.* - [L]
       RewriteRule ^/var/cache/texttoimage/.* - [L]
       RewriteRule ^/var/[^/]+/cache/texttoimage/.* - [L]
       Rewriterule ^/design/[^/]+/(stylesheets|images|javascript)/.* - [L]
       Rewriterule ^/share/icons/.* - [L]
       Rewriterule ^/extension/[^/]+/design/[^/]+/(stylesheets|images|javascripts?)/.* - [L]
       Rewriterule ^/packages/styles/.+/(stylesheets|images|javascript)/[^/]+/.* - [L]
       RewriteRule ^/packages/styles/.+/thumbnail/.* - [L]
       RewriteRule ^/favicon\.ico - [L]
       RewriteRule ^/robots\.txt - [L]
       # Uncomment the following lines when using popup style debug.
       # RewriteRule ^/var/cache/debug\.html.* - [L]
       # RewriteRule ^/var/[^/]+/cache/debug\.html.* - [L]
       RewriteRule .* /index.php
   </IfModule>

   DocumentRoot [PATH_TO_EZPUBLISH]
   ServerName [SERVER_NAME]
   ServerAlias [SERVER_ALIAS]

</VirtualHost>

The pertinent settings are interpreted as follows:

[IP_ADDRESS] The IP address of the virtual host, for example "128.39.140.28". Apache allows the use of wildcards here ("*").
[PORT] The port on which the web server listens for incoming requests. This is an optional setting; the default port is 80. The combination of an IP address and a port is often referred to as a "socket". Apache allows the use of wildcards here ("*").
[PATH_TO_EZPUBLISH] The path to the directory that contains eZ publish. This must be the absolute path, for example " /var/www/ezpublish".
[SERVER_NAME] The host or IP address that Apache should look for. If a match is found, the virtual host settings will be used.
[SERVER_ALIAS] Additional hosts / IP addresses that Apache should look for. If a match is found, the virtual host settings will be used.

Note that the mod_rewrite module must be enabled in httpd.conf in order to use the Rewrite Rules.

APC is an Open Source PHP accelerator for caching intermediate code from scripts. Intermediate code is the internal memory structures produced during compilation that are fed into the executor. APC increases the performance of PHP scripts by caching them in their compiled state, so that the overhead of compiling is almost completely eliminated. APC stores and executes compiled PHP scripts from shared memory.

Obtaining APC

APC is available as an extension for PHP from the PECL repository. You can download the latest version from the APC home page ( http://pecl.php.net/package/APC).

Installing APC

Before you start installing APC, make sure that the development tools listed in the APC prerequisites (such as autoconf and libtool) are installed on your system. Also, you may require access to the root account.

The basic commands you must execute to compile and install APC from source are:

Obtaining APC

APC is available as an extension for PHP from the PECL repository. You can download the latest version from the APC home page ( http://pecl.php.net/package/APC).

Installing APC

Before you start installing APC, make sure that the development tools listed in the APC prerequisites (such as autoconf and libtool) are installed on your system. Also, you may require access to the root account.

The basic commands you must execute to compile and install APC from source are:

shell> cd /usr/local/src
shell> gunzip < /PATH/TO/APC-x.x.x.tgz | tar xvf -
shell> cd APC-x.x.x
shell> phpize
shell> ./configure --enable-apc-mmap
shell> make
shell> su -
shell> make install

These commands are interpreted as follows:

1. Choose the directory under which you want to unpack the distribution, and then change location into it. In the following example, we unpack the distribution under /usr/local/src.

shell> cd /usr/local/src</span>

2. Obtain an APC distribution from http://pecl.php.net/package/APC.

3. Unpack the source file, which creates the installation directory. This example shows how to unpack the distribution using gunzip:

shell> gunzip < /PATH/TO/APC-x.x.x.tgz | tar xvf -

The tar command creates a directory called "APX-x.x.x" (where "x.x.x" is the APC version number). If you are using GNU tar, no separate invocation of gunzip is necessary. Instead, you can use the following command to uncompress and extract the distribution:

shell> tar zxvf /PATH/TO/APC-x.x.x.tgz

4. Change location into the installation directory:

shell> cd APC-x.x.x

5. Run phpize. phpize is a script that is included with the PHP distribution, and is by default located in /usr/local/php/bin (assuming you installed PHP in /usr/local/php).

shell> /usr/local/php/bin/phpize

The output from running phpize should look like the following:

Configuring for:
PHP Api Version:        20020918
Zend Module Api No:     20020429
Zend Extension Api No:  20050606

6. Run the configuration script with the following parameters:

shell> ./configure --enable-apc-mmap

The --enable-apc-mmap option tells the APC configuration script to use mmap instead of the default IPC shared memory support.

The configure script will take several minutes to run, as it tests for the availability of packages and prerequisites on your system and builds the Makefiles that will later be used to compile APC.

7. Now you can build the APC components by running the command:

shell > make

8. Switch to the root user to execute the following commands:

shell> su -

If you don't have access to the root account, ask your system administrator for help.

9. Next, install the package by running:

shell> make install

10. When the installation is done, make install should print the path to the extension.
Edit your php.ini and set the path to the apc.so extension:

extension="/path/to/extension/apc.so"

Now you can restart your web server (using the command /usr/local/apache/bin apachectl restart) and create a small test PHP file in your document root (by default /usr/local/apache/htdocs). The file should contain just the following line:

<?php phpinfo(); ?>

Put the test.php file in the Apache documents directory (/usr/local/apache/htdocs) and access it in the web browser via the URL http://localhost/test.php. APC should be listed in the extensions list. If APC is not shown, check the Apache error log (/usr/local/apache/logs/error.log) for possible errors.

PECL installer

Another way to install APC is to use the PECL ("PHP Extension Community Library") installer. Run sudo peclinstall APC from the shell prompt.

APC configuration

Add the following lines to your php.ini file (located by default in /usr/local/lib/php.ini):

; Load APC extension
extension=/usr/local/lib/php/extensions/no-debug-non-zts-20020429/apc.so

; This can be set to 0 to disable APC. This is
; primarily useful when APC is statically compiled
; into PHP, since there is no other way to disable
; it (when compiled as a DSO, the zend_extension
; line can just be commented-out)
; (Default: 1)
apc.enabled = 1

; The size of each shared memory segment in MB.
; By default, some systems (including most BSD
; variants) have very low limits on the size of a
; shared memory segment.
; (Default: 30)
apc.shm_size=128

APC GUI

APC comes with useful graphical monitoring tool. It provides information about the APC state, cached files, amount of used and free memory, etc. Using this APC application, you can also clear all the caches without restarting Apache. This tool is also useful for tuning memory usage.

To enable the APC application, copy apc.php from the APC-x.x.x directory to the Apache document directory (/usr/local/apache/htdocs). Access the application from a web browser via the URL http://localhost/apc.php.

The screenshot below shows the APC application:

APC application

This article has described the optimum configuration for the components with which eZ publish runs. It has discussed some of the concepts around the interactions between eZ publish and the third-party software applications that eZ publish requires, and has provided tips on installing and configuring the software in the web server environment.

Resources