Type of installation

Note: This article is for an old version of OpenX.

The latest OpenX documentation can be found at the following URLs:

There are a number of ways to deploy OpenX. Choose the type of installation that is most appropriate for your resources and anticipated advertising traffic:

Running your website and OpenX on one web server

To run OpenX and your website on one web server, you can install OpenX in a subdirectory on the same virtual host as your website. For example, if you are using Apache, you can install OpenX in the htdocs folder.

If your website is built with PHP, you can use a local mode invocation tag to deliver banners. See also: Zone tags for information about invocation tags.

Local mode invocation

If you use local mode invocation, OpenX sets cookies using the same domain as your website because cookies set by a domain name can only be read by scripts running under that domain name. You can configure many domains on the same virtual host and OpenX will set cookies using the correct domain name.

There is a limit to the number of cookies you can set for a particular domain name and it can occur that older cookies are replaced (deleted) by new ones when the limit is reached. This limitation can also affect cookies which are set by your own website. If you are encountering problems with cookies, it is likely that your installation has to high a volume for this type of installation.

If you run OpenX on a different virtual host with a separate domain name, you cannot use local mode invocation. However, other types of remote invocation will work. Running on a different domain name will prevent any issues with reaching cookie limits on your website.

Running OpenX on a dedicated server

If you install OpenX on a dedicated server, you can use all invocation tag types except local mode. You can anticipate significant speed improvements with this installation.

Running OpenX on more than one server

It is possible to install more than one copy of OpenX in order to distribute the load over more than one web server. This strategy has some administrative overheads that should be considered.

  • No provision is currently available for automatic distribution of configuration settings or uploaded banner images to multiple copies.
  • You must use a single MySQL database server for all the installed copies of OpenX, so while the load of delivery is distributed over multiple servers, the database load is not.
  • It is not possible to use shared memory or files for the delivery cache, because the delivery cache must be shared between all the servers and the database method is currently the only method that supports this.

It is possible to use MySQL replication to distribute the load over multiple MySQL database servers, but only with modification to the OpenX source code.

If you already use a simple load balancer and multiple servers to serve your website, you can install a copy of OpenX on a subdirectory on each web server. Or you can use multiple dedicated servers running OpenX and balance the load between them.

With OpenX, you can store banners in the MySQL database or on a web server. Database storage is slow but very easy to manage. Web server storage is much faster but can require additional configuration. If you are using multiple servers and storing banners on them, you have two options:

  • Upload the banners to a different server which serves the banner images for all the ad servers.
  • Upload the banners to a directory on one of the ad servers and create a process to synchronize the uploaded images with the other ad servers. If you do not synchronize the images, the images can be requested from the wrong server and the user will see a broken image instead of a banner.

    OpenX has two methods of storing configuration settings. Settings which are used by the delivery engine are stored in a configuration file. Other settings, used primarily by the administrator interface, are stored in the database. The settings which are stored in the database are automatically shared between multiple servers, but the settings which are stored in the configuration file are not. If you change a setting which is important to the delivery engine you will need to modify openx/var/conf.php file on all the servers you are running.

    If you use a load balancer it is not clear on which server the settings will be changed in the first place. It is wise to disable the administrator interface on all but one server and use a different domain name which only points to the server with the administrator interface to change settings. For example: ad.OpenX.com (192.168.1.0) points to the load balancer which forwards the requests to adserver1.OpenX.com (192.168.1.1) and adserver2.OpenX.com (192.168.1.2). The administrator interface is disabled on ad2.OpenX.com, so you have to use adserver1.OpenX.com to manage the inventory or change configuration settings.