Share » Learn » eZ Publish » The eZ publish Web Server Environment

The eZ publish Web Server Environment

Friday 04 August 2006 1:41:00 pm

  • Currently 3 out of 5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

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.

36 542 Users on board!

Tutorial menu

Printable

Printer Friendly version of the full article on one page with plain styles

Author(s)