Category: ‘Apache’

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>
 DocumentRoot /var/www/vhosts/
 ScriptAlias /cgi-bin/ /var/www/vhosts/
 # php_admin_value safe_mode 1
 php_admin_value open_base_dir /var/www/vhosts/
 php_admin_value sendmail_from
 ErrorDocument 404 /404.html
 SetEnvIf Request_URI "^/check\.txt$" dontlog
 SetEnvIf Request_URI "^/$" dontlog
 ErrorLog "|/usr/sbin/cronolog --symlink=/var/log/httpd/ \ 
 CustomLog "|/usr/sbin/cronolog --symlink=/var/log/httpd/ \
            /var/log/httpd/" combined env=!dontlog

Step 3 – Install OpenX


cd /var/www
mkdir -p /vhosts/
tar jxvf openx-2.8.11.tar.bz2
mv openx-2.8.11/* vhosts/
service httpd start 

Make sure to set correct folder permissions:
chmod -R a+w /var/www/vhosts/ 
chmod -R a+w /var/www/vhosts/ 
chmod -R a+w /var/www/vhosts/ 
chmod -R a+w /var/www/vhosts/ 
chmod -R a+w /var/www/vhosts/ 
chmod -R a+w /var/www/vhosts/ 
chmod -R a+w /var/www/vhosts/ 

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/
iptables -D OUTPUT 1

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