OpenX Ad Server: Beginner's Guide

By Murat Yilmaz
    Advance your knowledge in tech with a Packt subscription

  • Instant online access to over 7,500+ books and videos
  • Constantly updated with 100+ new titles each month
  • Breadth and depth in over 1,000+ technologies
  1. Introduction and Installation of OpenX Ad Server

About this book

OpenX is the world's leading independent ad server and it provides you with the simple tools you need to make money from advertising. Although OpenX is a fast, robust ad serving solution to power all of your digital advertising, it can be challenging to get beyond the basics and build an advertising system that meets your needs perfectly.

This practical guide gives you a hands-on experience on using OpenX Ad Server, helping you develop feature-rich and professional advertising solutions for web sites with world-class ad serving functionality. The book explores the powers of OpenX Ad Server and provides you with impressive ad server solutions.

OpenX Ad Server Beginner's Guide will help you gain control over all the advertising needs of your blogs and web sites on a centralized ad-serving platform, for much easier management than traditional with methods. You will be able to run your own ads and sell your ad space to advertisers at the same time. You will learn how to serve ads according to origin of the visitors using GeoTargeting features. Combined with OpenX Channels, you will maximize your online revenue with relevant ads. This book also tells you how you can integrate other popular Ad networks like Google AdSense, Amazon and so on. Using OpenX for multiple accounts, tracking the success of ad campaigns using statistics, and reports are also discussed in detail.

Publication date:
March 2010
Publisher
Packt
Pages
300
ISBN
9781849510202

 

Chapter 1. Introduction and Installation of OpenX Ad Server

Learning the essentials of online advertising with a sample will give you a very useful projection about what you can benefit using the OpenX Ad Server. It will provide you a strong foundation to get the most out of OpenX Ad Server main features.

As the majority of web hosting service providers do not have one-click installation for OpenX, we have to install OpenX on our own in most cases. Installing OpenX Ad Server is not a difficult task and follows a standard procedure just like other PHP and MySQL-based open source software. On the other hand, there are some important key points that we should be careful about:

In this chapter, we shall learn about:

  • A brief introduction to OpenX Ad Server

  • The system requirements needed to install OpenX Ad Server

  • How to download and upload OpenX files to a web server

  • How to set file and folder permissions

  • How to create a MySQL database and user

  • How to complete installation with the wizard

This chapter is suggested for reading even if you are a tech-savvy computer user, as you can eliminate the possible problems while installing OpenX Ad Server.

Basics of OpenX Ad Serving

OpenX Ad Server system was designed to manage all aspects of an online advertising business efficiently. Here, we will briefly look at the main OpenX terms and their interaction with each other.

An advertiser is the person (people) or organization who owns the banners that you will display in your advertisement serving environment (blogs, websites, e-mail newsletters, and so on).

A campaign is a set of banners that is targeted to promote a service or product(s) typically.

A banner is a creative content that will be displayed as an advertisement. The most common banner formats are images png, jpg, gif, animated gifs, text links, JavaScripts, Texts, HTML, and Flash (SWF) files.

An advertiser can have multiple campaigns and each campaign can have any number of banners inside. The following sample diagram shows the relationship among the terms— advertiser, campaign, and banner:

A website is the representation of publisher side on OpenX system where advertisements will be shown.

A zone is a predefined placeholder in a website to show banners. A website can have multiple zones.

Banners or campaigns can be connected to zones in OpenX Ad Server environment. Here is a sample connection diagram:

An ideal advertisement statement is the complete presentation of a banner using all the terms and target parameters.

For example, an iPhone case manufacturer (Fictitious Cases) wants to start a campaign for their latest leather case Model X on several blogs.

Now, let's define a sample ideal advertisement statement using several parameters.

The advertiser, Fictitious Cases wants to start iPhone Leather Case Model X campaign. The campaign will be activated next week on Monday at 10:00 automatically. The campaign will end in 120 days and banners will automatically expire from the system after 120 days. If the campaign reaches 10,000 clicks or 4,000,000 impressions before 120 days, the campaign will end up automatically as well as will not wait until the end date.

The banners will be shown on the top 728x90 pixel zone of gadget blog A, on the right 125x125 zone of the mobile phone review site B, and as a text link on the zone defined at the end of each blog post of site A.

They have added three 728x90 banners namely A1, A2, and A3; two 125x125 banners namely B1 and B2; and one text link as "Buy Super Model X here" namely C1.

As the company is selling its cases to only US customers, the website visitors coming from other countries will not be able to see these ads, thus advertiser's inventory of clicks or impressions will not be spent. The banners in the campaign will be shown to website visitors only in US working hours.

The advertiser thinks that each visitor should only see a banner maximum of three times. So, if a banner reaches this impression count for a visitor, another banner will be shown instead. So, if the banner A1 is shown three times for a unique visitor, A2 or A3 will be shown on next impression.

The advertiser thinks that A1 banner is much appealing than A2 and A3, and sets a higher banner impression weight, 3 for A1, 1 for A2 and A3. So, A1 as three times more chances of being shown than the others.

The following diagram shows this Sample campaign:

OpenX Ad Server allows defining a detailed campaign like in this example. We will learn how to implement an example similar to this and more in OpenX system in further chapters and see how OpenX is the vital solution to manage an advertisement network.

 

Basics of OpenX Ad Serving


OpenX Ad Server system was designed to manage all aspects of an online advertising business efficiently. Here, we will briefly look at the main OpenX terms and their interaction with each other.

An advertiser is the person (people) or organization who owns the banners that you will display in your advertisement serving environment (blogs, websites, e-mail newsletters, and so on).

A campaign is a set of banners that is targeted to promote a service or product(s) typically.

A banner is a creative content that will be displayed as an advertisement. The most common banner formats are images png, jpg, gif, animated gifs, text links, JavaScripts, Texts, HTML, and Flash (SWF) files.

An advertiser can have multiple campaigns and each campaign can have any number of banners inside. The following sample diagram shows the relationship among the terms— advertiser, campaign, and banner:

A website is the representation of publisher side on OpenX system where advertisements will be shown.

A zone is a predefined placeholder in a website to show banners. A website can have multiple zones.

Banners or campaigns can be connected to zones in OpenX Ad Server environment. Here is a sample connection diagram:

An ideal advertisement statement is the complete presentation of a banner using all the terms and target parameters.

For example, an iPhone case manufacturer (Fictitious Cases) wants to start a campaign for their latest leather case Model X on several blogs.

Now, let's define a sample ideal advertisement statement using several parameters.

The advertiser, Fictitious Cases wants to start iPhone Leather Case Model X campaign. The campaign will be activated next week on Monday at 10:00 automatically. The campaign will end in 120 days and banners will automatically expire from the system after 120 days. If the campaign reaches 10,000 clicks or 4,000,000 impressions before 120 days, the campaign will end up automatically as well as will not wait until the end date.

The banners will be shown on the top 728x90 pixel zone of gadget blog A, on the right 125x125 zone of the mobile phone review site B, and as a text link on the zone defined at the end of each blog post of site A.

They have added three 728x90 banners namely A1, A2, and A3; two 125x125 banners namely B1 and B2; and one text link as "Buy Super Model X here" namely C1.

As the company is selling its cases to only US customers, the website visitors coming from other countries will not be able to see these ads, thus advertiser's inventory of clicks or impressions will not be spent. The banners in the campaign will be shown to website visitors only in US working hours.

The advertiser thinks that each visitor should only see a banner maximum of three times. So, if a banner reaches this impression count for a visitor, another banner will be shown instead. So, if the banner A1 is shown three times for a unique visitor, A2 or A3 will be shown on next impression.

The advertiser thinks that A1 banner is much appealing than A2 and A3, and sets a higher banner impression weight, 3 for A1, 1 for A2 and A3. So, A1 as three times more chances of being shown than the others.

The following diagram shows this Sample campaign:

OpenX Ad Server allows defining a detailed campaign like in this example. We will learn how to implement an example similar to this and more in OpenX system in further chapters and see how OpenX is the vital solution to manage an advertisement network.

 

Main features of OpenX Ad Server


The following are the main features of OpenX Ad Server:

  • Free to use without any limitations

  • Provides detailed statistics on vital advertising elements such as clicks, impressions, and so on

  • Easy-to-use interface to compare advertisement performances and find under-functioning advertisements

  • Easily place, replace, and pull out banners on multiple websites with a few clicks

  • Advanced advertisement targeting according to country, date, IP Address, and so on

  • Content targeting functions to show relevant advertisements automatically

  • Well suits to sell advertisement space on blogs and websites

  • Allows defining multiple logins for management to both publishers or advertisers with customizable user rights

  • Online statistics and e-mail reporting

  • Data is available to third party tools like Excel

 

System requirements


While the book is being written, the latest OpenX release is 2.8.3, and the system requirements are valid for this version. Previous versions may have the same or fewer requirements.

We must download and install OpenX Ad Server on our own or on a shared web hosting solution. OpenX system runs on an Apache web server running with Linux. We will also need PHP and one of the supported database servers: MySQL or PostgreSQL. MySQL is the preferred database server as it is easier to manage and work more efficiently with OpenX. Some users suggested running OpenX on a Windows server with a PHP-enabled mode, but as it is not officially supported by OpenX and open to errors, we suggest following an ideal LAMP solution (Linux, Apache, MySql, and PHP). The following table shows the requirements list for installing OpenX:

Linux

Linux is essential and standard to work with OpenX Ad Server. Some other Unix-based systems can also run OpenX Ad Server but are not supported officially.

Apache server

An Apache server is required. The majority of modern web hosting solutions have the latest versions of Apache server, so it is not an issue.

PHP

As OpenX Ad Server is written in PHP language, it needs PHP installation.

Although PHP version 5.2 or newer is recommended, 5.1.4 version or any greater version is also supported.

PHP settings and parameters

OpenX uses default PHP server settings, but as some server administrators change these settings, it is wise to check whether the following parameters are set before the installation process:

  • memory_limit

    Minimum 128 MB at the root settings is required for 2.8.3 version. This is a must for OpenX installation and operation. Write to your web server technical support to be sure, as not many web hosts can provide this requirement as a default.

  • magic_quotes_runtime

    Off.

  • safe_mode

    Off.

  • register_argc_argv

    Must be on if you want to run maintenance via command line.

  • file_uploads

    Needs to be turned on to allow HTTP file uploads.

  • mysql, ZLib, FTP, GD, openSSL extensions

    These extensions are needed for several functions to operate correctly.

MySQL

It is the default OpenX Ad Server database. Although MySQL 5.0 is recommended,. MySQL 4.1 and greater versions are also supported

SMTP Server

Required for sending reports by e-mail.

 

Installing OpenX


Make sure that your web hosting solution meets all the listed requirements before starting the installation steps. The easiest way of determining this is by sending the requirements list to web server technical support. We will complete installing OpenX using the following steps:

  • Downloading OpenX from http://openx.org

  • Uploading OpenX files to web host

  • Creating MySQL database and a user for OpenX

  • Using OpenX installation wizard

  • Making first login to OpenX management interface

Now, let's start exploring each section in detail.

Downloading OpenX

Downloading the latest version of OpenX Ad Server is an easy and straightforward task. Let's see how we can achieve that.

 

Time for action - downloading OpenX


In this section, we are going to download OpenX files.

  1. 1. Browse to the http://www.openx.org/ad-server/download link. This link will open a web page where we can choose one from three types of compressed files - zip, .tgz, and .bz2. The download page will look like this:

  1. 2. We have chosen default .zip file download option. On the next Thank you for downloading OpenX page, we save the file in the hard drive instead of opening with the built-in ZIP file support of Windows Vista or WinRAR.

What just happened?

We have downloaded the OpenX files in the form of a compressed file on our computer. Now, we are ready to upload the files to the web host.

Pop quiz - understanding system requirements

  1. 1. After you have asked your web hosting technical support to increase PHP memory_limit value in root settings to 128 MB, they replied that they have temporarily increased this value from 32 MB to 128 MB. You have installed OpenX 2.8.3 successfully and they have decreased memory_limit value to 32 MB again. Will newly installed OpenX 2.8.3 system continue to work?

    1. a. Yes

    2. b. No

  2. 2. Which of the following sets is required officially for OpenX Ad Server to install and work correctly?

    1. a. Windows Vista, SQL Server, .Net

    2. b. Linux, Apache, MySQL, Perl

    3. c. Linux, Apache, MySQL, PHP

    4. d. Linux, Apache, SQL Server, PHP

Uploading OpenX files

There are two common methods for uploading files to a web host:

  • Using cPanel file manager utility

    Apply this method if you want to install OpenX on a subdirectory on your domain— for example, http://yourwebsite.com/openx

  • Using FTP client

    Apply this method if you want to install OpenX system on your root domain—for example, http://yourwebsite.com

We will explain both methods with examples.

Note

Installing OpenX on a subdirectory is a better option, as we can hide the installation from search engines and from people who browse to our site directly.

Decide which method to choose and apply one of the actions accordingly. Let's start with the suggested method.

 

Time for action - uploading OpenX using cPanel file manager


This is the first method of uploading OpenX files to web host. Many modern web hosting solutions include a control panel called as cPanel and we can use cPanel file manager utility to directly upload a ZIP file to web host and decompress the files there easily.

  1. 1. Open File Manager utility at cPanel.

  1. 2. Web Root (public_html/www) is the default selection. Click on the Go button.

  1. 3. Click on the Upload link and choose OpenX zip file using the Browse button on the next screen.

  1. 4. After the upload completes, return to the main cPanel File Manager screen.

  1. 5. Right-click on the file and select Extract.

  1. 6. It will open a pop-up window. Just click Extract File(s) button to decompress ZIP file into the root web folder.

    All files are extracted to a folder named openx-2.8.3. As a result, OpenX Ad Server will be reachable at http://yourwebsite.com/openx-2.8.3.

    As it is not a good path name, it is bett er to rename the folder with something easier such as openx to reach at http://yourwebsite.com/openx once all installation steps are complete.

  1. 7. Right-click on folder name and choose Rename option.

  1. 8. Rename the file as openx as shown in the following screenshot:

What just happened?

OpenX files are now on the web host in a subdirectory. OpenX Ad Server will be reachable at http://yourwebsite.com/openx after completion of all the remaining installation steps.

Note

If you have already completed uploading OpenX files to a subdirectory using cPanel file manager tool already, skip the following action and continue reading setting file permissions.

 

Time for action - uploading OpenX using an FTP client


This is the second method of uploading files to a web server. In this section, we will learn how to decompress the OpenX files in a local folder and upload to the root of web server using an FTP Client.

  1. 1. Right-click on the previously downloaded OpenX file and click on Extract Here option.

    As a result, we will have a folder named openx-2.8.3 with the structured folders and files inside. Please note that the folder name will be different depending on the OpenX version we downloaded.

  2. 2. Upload the all files and subfolders in openx-2.8.3 folder to the web host. We use a free FTP client software called as CoreFTP, which can be downloaded from http://www.coreftp.com/.

    Choose the all files and folders on the left pane and drag-and-drop into the right pane where the web root folder exists. In most cases, it is /www folder. The following screenshots show the process before dragging and dropping the files and after uploading the files to the website root:

  3. 4. Note that it is a time consuming process as there are many files in the OpenX system. Wait until all the files are uploaded to the web server.

What just happened?

We have uploaded all OpenX files and subfolders to web root. So, our OpenX system will be reachable at http://yourwebsite.com after completion of all installation steps.

Pop quiz - uploading OpenX files

Suppose that we have a very slow internet connection and want to install OpenX Ad Server on a web host without any possible interruptions on file transfer. Which upload method is more effective in terms of speed and reliability?

  1. a. Using an FTP client program

  2. b. Using cPanel file transfer utility

Setting file permissions

OpenX Ad Server system uses its several directories dynamically to create, change, and delete files when needed. Because of this, we have to be sure that correct file permissions applied on these folders.

 

Time for action - setting file permissions


Now, let's see how we will set the permissions using cPanel file manager.

  1. 1. Open CPanel and browse to /openx/var folder where we have uploaded OpenX files. Right-click on the folder name and select Change Permissions.

  1. 2. Set permission level to 777 or select read, write, execute for all members (User, Group, World). Click on Change Permissions button.

  1. 3. We must repeat this process for all the folders listed next including subfolders:

    • /openx/var

    • /openx/var/cache

    • /openx/var/plugins

    • /openx/var/templates_compiled

    • /openx/plugins

    • /openx/www/admin/plugins

    • /openx/www/images

What just happened?

We have set the necessary file and folder permissions to 777. It was needed for OpenX to install and operate correctly.

Creating a MySQL database and user

This step is needed for OpenX to connect and store all the data in a MySQL database. We will learn how to create a new database and user for this database. We will later use this information in OpenX installation wizard.

 

Time for action - creating a MySQL database and user


We will use MySQL Databases link on cPanel. Even though there can be slight differences on different versions, the main idea and flow is the same.

  1. 1. Click on MySQL Databases link on cPanel.

  1. 2. Enter a name for the database. Here, we named the database as openxdb. Then click on Create Database button.

  1. 3. If we are on a shared hosting, a prefix will be added automatically to the name we provided. This is generally the username that we used to log in to the cPanel. So, your database name will be of the username_databasename format.

  1. 4. Take a note of the database name including the prefix.

  2. 5. Now, let's create a user and assign this user to our newly created database. We go back from the database creation result page and jump to MySQL Users section. Choose a Username and Password. Repeat the password in the last textbox and be sure that the password is not very easy to guess for security (preferably a mixture of letters and numbers). We have chosen openx as username. Click on Create User button after filling in all necessary textboxes.

    Please note that a prefix will be added to user as well. Take a note of the username.

  1. 6. We need to add a user to database as the last step. Choose the newly created user and database for OpenX, then click on Add button.

  1. 7. In this step, we are going to assign privileges to the user in the database. Check All PRIVILEGES option, then click on Make Changes button to give all privileges to the user.

  1. 8. The following screenshot shows the results page after clicking on Make Changes button:

What just happened?

We have seen how to prepare a database for OpenX Ad Server. The steps included:

  • Choosing a name for the database

  • Choosing a username and providing a secure password

  • Adding user to the database

  • Adding privileges to user for the database

Now, we are ready to continue our installation by using OpenX installation wizard.

OpenX installation wizard

OpenX installation wizard is the last step before we complete the installation. It is very straightforward and OpenX installation wizard screens guide us very well.

 

Time for action - using OpenX installation wizard


Now, it is time to complete installation using OpenX Installation Wizard.

  1. 1. Let's browse to domain name where we put OpenX files. In our example, it is http://yourwebsite.com/openx. You should use your own OpenX path. We will be redirected to a "Welcome screen" automatically. Click on Continue to start.

  1. 2. Confirm the terms and privacy policy agreements. Click on I Agree button.

  1. 3. In this step, OpenX wizard is going to check system requirements automatically to ensure the integrity of the installation. The system check includes cookies, PHP settings, and file permissions.

    For example, the following screenshot shows that memory_limit was automatically increased to 128 MB from 32 MB (which is minimum working requirement for OpenX to install and operate). It is very important that our web hosting service provider must have minimum 128 MB PHP memory_limit on the root or must allow user installed program (OpenX, in this case) to increase this value.

  1. 4. As file permissions have no errors, we can go to the next screen by clicking Continue button.

Note

If the system check finds any serious error, it will stop the installation temporarily and will not let us go further until we solve the problem. If this is the case, please check the requirements list section and file permission settings again carefully.

  1. 5. In this step, we will supply the database connection information to OpenX system. Choose Database Type as MySQL. As our MySQL database and PHP files operate on the same server, we do not need to fill in Database Socket, Database Hostname, and Database Port Number fields. Check Use local socket connection option.

    Then, fill in Database Username, Database Password, and Database Name fields according to information we collected in database creation step. Leave default Advanced Settings unchanged. Then click on Continue to move to the next step.

  1. 6. If the database information is correct, an OpenX database will be created and we will see message as shown in the following screenshot:

  1. 7. Click on Continue button to define administration parameters.

  2. 9. Just leave the default settings untouched in configuration checklist step and click on Continue button. These fields are automatically detected and filled in by the system.

  1. 10. Now, it is time to define main administrator account that we will use to manage OpenX Ad Server.

    Fill in the Administrator Username and Administrator Password fields. Enter a correct e-mail address in the Administrator email Address field. We have the option to use OpenX in another language. The default is English. And finally, choose Timezone.

    It is important to choose the correct time zone as the delivery of the date-and timedependent advertisements and delivery of reports will be made using this setting by OpenX Ad Server. Continue to move on to the next step.

  1. 11. In this step, several OpenX plugins will be installed one by one automatically. These plugins are the core elements of OpenX system. The following screenshot shows that all plugins are installed correctly. Click on Continue to move to the next step.

  1. 12. Congratulations! OpenX installation is now complete. Optionally, we can join the OpenX newsletter list to get updates and security alerts. Just click on Continue to automatically log in and see the OpenX administration interface.

  1. 13. If we see a screen like the following screenshot, it means that our OpenX installation is correct and we are ready to add an advertiser and a campaign to start working.

What just happened?

We have completed the installation using OpenX wizard. The steps included the approval of policy and terms agreement, system check (PHP settings, file permissions), providing database connection information, configuration settings, opening administrator account, selecting time zone, and installing core plugins.

We have now a working, but empty OpenX Ad Server. We will begin adding advertiser and campaigns in the next chapter.

Have a go hero adding another OpenX Ad server instance

Now, it is time to test your skills in installing another instance of OpenX Ad Server at your local site http://yourwebsite.com/openxtest. Later, you can use this instance for testing purposes as well as for applying some new things on the original installation that we have completed together. Try to do the steps on your own without looking at the chapter sections at first. If difficulties occur, read again the required chapter sections.

 

Summary


It can be difficult to find a web hosting solution that suits the requirements for the latest OpenX version (2.8.3) as there is a high PHP memory_limit parameter (128 MB). Do a thorough search on Google with the phrases like OpenX hosting and so on, and e-mail host supports to ensure that they provide it. Using OpenX.org user forums can also help us to find the best OpenX web hosts.

In this chapter, we learned how to install OpenX on a web server.

Specifically, we covered:

  • Requirements

  • Downloading and uploading files

  • Setting permissions

  • Creating MySQL database and user

  • Using installation wizard

We are ready to explore the OpenX Ad Server feature by defining an advertiser and a campaign in the next chapter.

About the Author

  • Murat Yilmaz

    Murat Yilmaz is a software developer and an online entrepreneur who lives in Antalya, Turkey. He has over 10 years of experience in different IT fields, including development of web-driven solutions, large databases, and OLAP systems. He has worked in several multinational companies in Istanbul and Moscow as a consultant. He currently runs his own blog and an e-commerce and online advertising network. He holds a bachelor's degree in Computer Science from Marmara University at Istanbul. He spends his free time playing progressive rock songs, online chess, and reading scientific books.

    He has also authored two other books, OpenCart 1.4: Beginner's Guide and OpenX Ad Server: Beginner's Guide.

    Browse publications by this author
Book Title
Access this book and the full library for FREE
Access now