Apr 222011
 

Previously, we installed the Advertising Manager plugin for WordPress. We showed how to integrate advertisements from Google AdSense into your website. But this same plugin supports other advertising networks as well. Since OpenX is the first competitor to AdSense, we now elaborate on the installation and configuration of this alternative ad manager and marketplace.

While the Google advertising proposition consists of two separate products — AdSense
for publishers
and AdWords for advertisers — OpenX provides the software for a complete marketplace where publishers and advertisers can meet. So the platform is used by publishers, advertisers and intermediaries. Several websites and several campaigns managed by several intermediaries can be supported by the same server.

Downloading OpenX Source

Although OpenX offers various packages, including hosted solutions, we install the open source version: OpenX Source. There is also a free hosted version available, OpenX OnRamp, but that is basically an online demo that does not allow you to use any plugins.

After filling out this marketing data collection form (we always lie when forced to leave our mail address, phone number, and turnover), we are allowed to download the sources, in this case of version 2.8.7.

Installing OpenX Source

Now we are ready to install the software package. We start by unzipping the package in our web directory:

tar -zxvf .../openx-2.8.7.tar.gz

and creating a symbolic link:

ln -s openx-2.8.7 openx

This way, we can access our OpenX installation using:

http://www.example.com/openx/

But first, we have to open up a few directories for writing by the web server:

cd openx/
find ./var/ -type d -print0 | xargs -0 chmod 777
find ./var/ -type f -print0 | xargs -0 chmod 666
find ./www/images/ -type d -print0 | xargs -0 chmod 777
find ./www/images/ -type f -print0 | xargs -0 chmod 666
find ./plugins/ -type d -print0 | xargs -0 chmod 777
find ./plugins/ -type f -print0 | xargs -0 chmod 666
find ./www/admin/plugins/ -type d -print0 | xargs -0 chmod 777
find ./www/admin/plugins/ -type f -print0 | xargs -0 chmod 666

Or using file access control lists:

cd openx/
find ./var/ -type d -print0 | xargs -0 setfacl -m u:apache:rwx
find ./var/ -type f -print0 | xargs -0 setfacl -m u:apache:rw-
find ./www/images/ -type d -print0 | xargs -0 setfacl -m u:apache:rwx
find ./www/images/ -type f -print0 | xargs -0 setfacl -m u:apache:rw-
find ./plugins/ -type d -print0 | xargs -0 setfacl -m u:apache:rwx
find ./plugins/ -type f -print0 | xargs -0 setfacl -m u:apache:rw-
find ./www/admin/plugins/ -type d -print0 | xargs -0 setfacl -m u:apache:rwx
find ./www/admin/plugins/ -type f -print0 | xargs -0 setfacl -m u:apache:rw-

Problems with the Configuration

Now the rest of this installation can be performed through our web browser:

http://www.example.com/openx/

Unfortunately, the OpenX interface (both of the website and of the software application) is not correctly displayed in our web browser (Mozilla Firefox on Linux): there appears to be a problem with the CSS stylesheets.

Some googling learns that this is caused by the Adblock Plus addon. After disabling the ad blocker for these particular sites, we can move on.

But then there is another problem: as soon as we start using the application, the interface stalls. Looking at our web logs, we find out that the Apache HTTP daemon crashes at a segmentation fault when the installer script is working on the plugins. It appears to be caused by a libphp5 call to libc.

[Sat Feb 05 17:29:55 2011] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations
[Sat Feb 05 17:30:04 2011] [notice] child pid 4460 exit signal Segmentation fault (11)
[Sat Feb 05 17:30:29 2011] [notice] caught SIGTERM, shutting down
[Sat Feb 05 17:30:30 2011] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sat Feb 05 17:30:31 2011] [notice] Digest: generating secret for digest authentication ...
[Sat Feb 05 17:30:31 2011] [notice] Digest: done
[Sat Feb 05 17:30:31 2011] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
[Sat Feb 05 17:30:31 2011] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations
*** glibc detected *** /usr/sbin/httpd: double free or corruption (!prev): 0x00002b5c73220380 ***
======= Backtrace: =========
/lib64/libc.so.6[0x2b5c5e75d30f]
/lib64/libc.so.6(cfree+0x4b)[0x2b5c5e75d76b]
/etc/httpd/modules/libphp5.so(_efree+0xbc)[0x2aaaba3b130c]
/etc/httpd/modules/libphp5.so(zend_hash_destroy+0x7b)[0x2aaaba3d25eb]
/etc/httpd/modules/libphp5.so(destroy_zend_class+0x55)[0x2aaaba3c0d85]
/etc/httpd/modules/libphp5.so[0x2aaaba3d22a2]
/etc/httpd/modules/libphp5.so(zend_hash_reverse_apply+0x59)[0x2aaaba3d23a9]
/etc/httpd/modules/libphp5.so(shutdown_executor+0x42d)[0x2aaaba3bd94d]
/etc/httpd/modules/libphp5.so(zend_deactivate+0x97)[0x2aaaba3c89d7]
/etc/httpd/modules/libphp5.so(php_request_shutdown+0x1fa)[0x2aaaba38b0aa]
/etc/httpd/modules/libphp5.so[0x2aaaba4459e4]
/usr/sbin/httpd(ap_run_handler+0x7a)[0x2b5c5c7f0a4a]
/usr/sbin/httpd(ap_invoke_handler+0x78)[0x2b5c5c7f3ed8]
/usr/sbin/httpd(ap_process_request+0x1a8)[0x2b5c5c7fe938]
/usr/sbin/httpd[0x2b5c5c7fbb70]
/usr/sbin/httpd(ap_run_process_connection+0x72)[0x2b5c5c7f7cd2]
/usr/sbin/httpd[0x2b5c5c802789]
/usr/sbin/httpd[0x2b5c5c802a1a]
/usr/sbin/httpd(ap_mpm_run+0x78d)[0x2b5c5c80327d]
/usr/sbin/httpd(main+0x7e8)[0x2b5c5c7dde48]
/lib64/libc.so.6(__libc_start_main+0xf4)[0x2b5c5e708994]
/usr/sbin/httpd[0x2b5c5c7dd199]

After two months, no solution had came up, so we decided to upgrade to PHP version 5.2, after which this problems was "solved".

Configuring OpenX Source

On to the configuration of OpenX Source. Or, if something went wrong — typically when the web server is testing the directories you were supposed to open up before for writing — you will get an overview of the tests performed and what remains to be fixed before you can continue.

After agreeing on the GNU license, we are presented with a screen asking us for our OpenX Market account data (or register for a new account at OpenX.org).

However, another issue causes the registration at the OpenX website to fail:

We were unable to reach the OpenX Market account registration service
at this time. In order to continue with the installation process,
you may continue without registering or you may try registering again
on the form below. 

Note: if you continue without registering, you will need to register
with OpenX later in order to be able to serve ads from OpenX Market.

An error occurred while associating your OpenX.org account
(Code 103: OA_XML_RPC_Client: Connection to RPC server
api.pc.openx.com:443 failed. )
The problem may be caused by an improper configuration of your OpenX Ad
Server or your web server or by the lack of a required PHP extension.
If the problem persists, please contact OpenX publisher support for
assistance.

So we continue without registering. If we do not register later on, we will not be able to integrate with the OpenX Market.

After confirmation, we can move on to setting up the database. Both MySQL and PostgreSQL are supported.

We can create the database itself upfront, but there is no need to. If it is not yet defined, the OpenX installer will take care of that. But we do have to grant access to the database user:

mysql -u root -p
mysql> CREATE DATABASE oxdb;
mysql> GRANT alter,create,create temporary tables,delete,drop,index,insert,lock tables,select,update ON oxdb.* TO oxdbuser@localhost IDENTIFIED BY '**********';
Query OK, 0 rows affected (0.22 sec)
mysql> quit;

Last step is the creation of the OpenX administrator's account:

After which the installer completes the installation. You will receive an alert if any problems occurred during the final installation. Check out the logs in openx/var/install.log for the details.

Another Attempt at OpenX Market

The next click brings us to the OpenX Market configuration screen, asking us to register with OpenX after all. You can reach this screen later by clicking My Account -> OpenX Market.

Another attempt to register still does not succeed:

The problem may be caused by an improper configuration of your
OpenX Ad Server or your web server or by the lack of a required
PHP extension.
If the problem persists, please contact OpenX Market publisher support
for assistance.

Trying to reach the OpenX RPC server from our web browser:

https://api.pc.openx.com/

results in a time out, suggesting that the OpenX interface is currently not available. A query like this should result in a REST (error) response.

When we tried two days later, we did manage to connect to the OpenX RPC server. So this actually was a temporary problem with the OpenX infrastructure.

Getting Started

Now we are ready to explore the OpenX administrator's interface, where we can set up accounts for publishers and advertisers, integrate websites (zones and channels) and set up campaigns.

But first we have to remove the install file for security:

rm openx/www/admin/install.php

  4 Responses to “Installing the OpenX Advertisement Manager”

  1. […] PortalBuilders.pro Building Professional Portals Skip to content HomeAboutContact ← Installing the OpenX Advertisement Manager […]

  2. […] had already installed the OpenX advertisement server before. Now we want to integrate the ad management system into a Drupal […]

  3. […] databases (made available as data files) can be integrated into OpenX using the openXMaxMindGeoIP […]

  4. […] OpenX comes with most of the Interactive Advertising Bureau‘s standard formats predefined. The only one missing is the Half Page Ad (300 x 600 pixels). […]

Leave a Reply