Category: ‘Openx’

Installing Openx

August 28, 2013 Posted by admin

This is a quick guide to walk you through installing openx adserver

Step 1 – Setup Database and Create User

mysqladmin create openx
mysql -Bse "create user 'openx'@'localhost' identified by 'PassWord'"
mysql -Bse "grant all privileges on \`openx\`.* to 'openx'@'localhost'"
mysqladmin flush-privileges

Step 2 – Configure Apache and PHP5

 

Set date.timezone “America/New_York”

echo "date.timezone=America/New_York" >> /etc/php.ini

 

<VirtualHost *:80>
 ServerName ads.linuxdriven.us
 ServerAlias adserver.linuxdriven.us adsadmin.linuxdriven.us
 DocumentRoot /var/www/vhosts/ads.linuxdriven.us
 ScriptAlias /cgi-bin/ /var/www/vhosts/ads.linuxdriven.us/cgi-bin/
 # php_admin_value safe_mode 1
 php_admin_value open_base_dir /var/www/vhosts/ads.linuxdriven.us
 php_admin_value sendmail_from ads@linuxdriven.us
 ErrorDocument 404 /404.html
 ServerAdmin ads@linuxdriven.us
 SetEnvIf Request_URI "^/check\.txt$" dontlog
 SetEnvIf Request_URI "^/$" dontlog
 ErrorLog "|/usr/sbin/cronolog --symlink=/var/log/httpd/ads.linuxdriven.us/error.log \ 
            /var/log/httpd/ads.linuxdriven.us/%Y/%m/%d/error.log"
 CustomLog "|/usr/sbin/cronolog --symlink=/var/log/httpd/ads.linuxdriven.us/access.log \
            /var/log/httpd/ads.linuxdriven.us/%Y/%m/%d/access.log" combined env=!dontlog
</VirtualHost>

Step 3 – Install OpenX

 

cd /var/www
mkdir -p /vhosts/ads.linuxdriven.us
wget http://download.openx.org/openx-2.8.11.tar.bz2
tar jxvf openx-2.8.11.tar.bz2
mv openx-2.8.11/* vhosts/linuxdriven.us/
service httpd start 

Make sure to set correct folder permissions:
chmod -R a+w /var/www/vhosts/ads.linuxdriven.us/var 
chmod -R a+w /var/www/vhosts/ads.linuxdriven.us/var/cache 
chmod -R a+w /var/www/vhosts/ads.linuxdriven.us/var/plugins 
chmod -R a+w /var/www/vhosts/ads.linuxdriven.us/var/templates_compiled 
chmod -R a+w /var/www/vhosts/ads.linuxdriven.us/plugins 
chmod -R a+w /var/www/vhosts/ads.linuxdriven.us/www/admin/plugins 
chmod -R a+w /var/www/vhosts/ads.linuxdriven.us/www/images 

Navigate over to your droplet's IP address or domain if it has already propagated. You should see the OpenX Installer:

Step 4 – Disable your Dashboard and Allow Outgoing SSL Connections:

sed -i 's/dashboardEnabled.*$/dashboardEnabled=0/' /var/www/vhosts/ads.linuxdriven.us/var/ads.linuxdriven.us.conf.php
iptables -D OUTPUT 1

cd /var/www/vhosts/ads.linuxdriven.us/
sudo find . -type f -exec chmod 644 '{}' \; 
sudo find . -type d -exec chmod 755 '{}' \;