There are a number of ways to deploy OpenX. Choose the type of installation that is most appropriate for your resources and anticipated level of advertising traffic:
- For new users with a modest publishing requirement, the easiest solution is to run your website and OpenX on the same web server.
- If you have a high volume of traffic you can run OpenX on a dedicated server to speed performance.
- If you plan to serve millions of ads you can run multiple copies of OpenX to spread the load of delivery.
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 Types for information about invocation tags.
Local mode invocation
If you use local mode invocation OpenX sets cookies using the same domain as your website. This is 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 deleted and replaced by new ones when the limit is reached. This limitation can also affect cookies that are set by your own website. If you are encountering problems with cookies it is likely that your installation has too 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 OpenX under a different domain name will avoid any problems 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 type of 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 repercussions 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.
Note: OpenX 2.8 offers the capability to use shared memory or files for the delivery cache. Adminstrators who wish to do so can download memcached and enable it via the user interface's Plugins menu.
It is also 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.
OpenX allows you to 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 they might be requested from the wrong server. This will result in the user seeing 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 stored in the configuration file are not. If you change a setting that is important to the delivery engine you will need to modify the 'openx/var/conf.php' file on all the servers you are running.
If you use a load balancer it might not be clear on which server the settings will be changed in the first place. It is wise when changing settings 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. 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.




