Version 3.5

AdvertPRO - Linux Installation


Linux Distributions

There are many different distributions of Linux based operating systems. Every distribution has its own recommended way of installing and configuring packages. Some parts of these instructions assume that you are working with a Linux distribution that has RPM support, which includes the popular CentOS and Red Hat Linux. For other distributions, you may need to refer to their specific Java and MySQL installation instructions.

Apache HTTPD

If you are running Apache HTTPD to host other web sites or applications on the same server as AdvertPRO is going to be installed on, please follow these alternate instructions for configuring Apache Tomcat to connect with Apache HTTPD using the mod_proxy_ajp module: Apache + mod_proxy_ajp + Tomcat Installation


If you are running Nginx to host other web sites or applications on the same server as AdvertPRO is going to be installed on, please follow these alternate instructions for configuring Apache Tomcat to connect with Nginx using the ey_balancer module: Nginx + ey_balancer + Tomcat Installation

Step #1: Download Files


  1. Open a browser window to:
  2. Enter your Customer ID and E-mail Address into the form.
  3. Select the operating system your server is running from the Platform list box.
  4. Select the Install package for a clean installation from the Package list box.
  5. Click on the Download Package button to proceed.
  6. Check your e-mail and you should receive an e-mail with a download link within a few minutes.

Tip Tip

If you download the install package on Windows, depending upon the browser you use, the file may be renamed from advertpro-{version}.war to advertpro-{version}.zip since WAR files are essentially ZIP files so you may need to rename the file back to advertpro-{version}.war after downloading if this occurs!

Java Development Kit

  1. Open a browser window to:
  2. Click on the Java Download graphic for Java Platform (JDK).
  3. Click on the Accept License Agreement radio button on the next page.
  4. Then click on the RPM download link for Linux x86 if you have a 32-bit system or Linux x64 if you have a 64-bit system.

Note Note

JDK 1.4, 1.5 (5.0) and 1.6 (6.0) are also supported, however we recommend using JDK 7.0 (1.7.x) for new installations.

Java Libraries

  1. Download the JavaMail 1.4 library from
  2. Download the JAF 1.1 library from

MySQL Database Server

In most cases your distribution of Linux probably already has MySQL included with it. We recommend using that version of MySQL rather than trying to remove it and install a different version. The reason being that the developer of your distribution has certified that version of MySQL to be stable with it.

For users of CentOS or Red Hat Linux downloading and installing MySQL is as easy as running the following command:

yum install mysql mysql-server

If you use a different version of Linux or prefer to manually download MySQL and install it you may obtain it using the following instructions.

  1. Open a browser window to:
  2. Select your version of Linux for the Platform.
  3. Download the following MySQL 5.5.x packages making sure to choose (x86, 32-bit) packages for 32-bit systems or if you have a 64-bit system instead choose the (x86, 64-bit) packages:

Note Note

We fully support the MySQL 4.0, 4.1, 5.0 and 5.1 series, however we recommend using MySQL 5.5 for new installations.

MySQL Connector/J JDBC Driver

  1. Open a browser window to one of the following, depending on your chosen version of MySQL:
  2. Download the TAR Archive package.

Apache Tomcat Server

  1. Open a browser window to:
  2. Scroll down to the listing for Tomcat 7.0.x.
  3. Download the Binary Distribution labeled Core: tar.gz.

Step #2: Installation

Java Development Kit


rpm -i jdk-{version}-linux-i586.rpm


rpm -i jdk-{version}-linux-x64.rpm

Note Note

You will find more complete installation instructions here:

MySQL Database Server

rpm -i MySQL-server-community-{version}.x86_64.rpm
rpm -i MySQL-client-community-{version}.x86_64.rpm
rpm -i MySQL-devel-community-{version}.x86_64.rpm
rpm -i MySQL-shared-community-{version}.x86_64.rpm
rpm -i MySQL-shared-compat-{version}.x86_64.rpm

Note Note

You will find more complete installation instructions here:

Apache Tomcat Server

mv apache-tomcat-{version}.tar.gz /usr/local
cd /usr/local
tar -xzvf apache-tomcat-{version}.tar.gz
mv apache-tomcat-{version} tomcat
rm -rf apache-tomcat-{version}.tar.gz
cd tomcat
chmod 755 bin/*.sh
cd webapps
rm -rf *
mkdir ROOT

Apache Tomcat APR Library

yum install apr-devel
yum install gcc
yum install make
yum install zlib-devel
cd /usr/local/tomcat/bin
tar -xzf tomcat-native.tar.gz
cd tomcat-native*
cd jni/native
./configure --with-java-home=/usr/java/latest --with-apr=/usr/bin/apr-1-config --with-ssl=no
make install

Java Libraries

unzip javamail-{version}.zip
cp javamail-{version}/mail.jar /usr/local/tomcat/lib/mail.jar
unzip jaf-{version}.zip
cp jaf-{version}/activation.jar /usr/local/tomcat/lib/activation.jar

MySQL Connector/J JDBC Driver

tar -xzvf mysql-connector-java-{version}.tar.gz
cd mysql-connector-java-{version}
cp mysql-connector-java-{version}-bin.jar /usr/local/tomcat/lib/mysql.jar


cp advertpro-{version}.war /usr/local/tomcat/webapps/ROOT
cd /usr/local/tomcat/webapps/ROOT
/usr/java/latest/bin/jar -xf advertpro-{version}.war
rm -f advertpro-{version}.war

Step #3: Configuration

Environment Variables

export JAVA_HOME=/usr/java/latest
export PATH=$PATH:$JAVA_HOME/bin

Note Note

Consult your operating system documentation to figure out where you need to put system wide environment variables. On most RPM compatible systems, these export commands can be defined in the /etc/profile file. We recommend placing these commands at the very end of that file and also run them in your existing shell so that you don't need to log out and then log back in again for them to take effect!

MySQL Settings

Replace the entire contents of the /etc/my.cnf with the following recommended configuration:

port = 3306
socket = /var/lib/mysql/mysql.sock

port = 3306
socket = /var/lib/mysql/mysql.sock
datadir = /var/lib/mysql
max_connections = 384
key_buffer_size = 64M
table_open_cache = 256
thread_cache_size = 8
bulk_insert_buffer_size = 16M
join_buffer_size = 1M
read_buffer_size = 2M
read_rnd_buffer_size = 2M
sort_buffer_size = 4M
max_allowed_packet = 16M
max_heap_table_size = 32M
tmp_table_size = 32M
query_alloc_block_size = 16384
query_cache_limit = 1M
query_cache_size = 32M
query_cache_type = 1
query_prealloc_size = 16384
myisam_sort_buffer_size = 64M
server-id = 1
symbolic-links = 0

basedir = /var/lib
user = mysql

err-log = /var/log/mysqld.log
pid-file = /var/run/mysqld/

max_allowed_packet = 16M


key_buffer = 128M
read_buffer = 2M
write_buffer = 2M
sort_buffer = 128M

key_buffer = 128M
read_buffer = 2M
write_buffer = 2M
sort_buffer = 128M


Note Note

These settings are for MySQL 5.5.x, which is the version we recommend using for new installations. However, they are also compatible with and can be used with the MySQL 5.1.x, 5.0.x and 4.1.x versions. If you are using an even older version of MySQL, please contact technical support for configuration guidance if needed.

Apache Tomcat Environment

Edit /usr/local/tomcat/bin/ and add the following after the comments/instructions at the top.

# Tomcat Home.

# Java Home.

# Change -Xms and -Xms if necessary to allocate more or less memory.
# It is important that they have the same value for optimal performance.
# Note that on some operating systems you may need to increase the value of
# -Xss to 512k or higher (do not exceed 1024k) if you experience stability
# problems or start seeing stack overflow exceptions in your application
# server logs.
# If you've changed -Xms and -Xms, you should change -XX:NewSize and
# -XX:MaxNewSize to have values equal to half of the -Xms and -Xmx
# values.
# Suggested values based on available physical server memory (RAM):
#  2 GB RAM    -Xms1024m     -Xmx1024m     -XX:NewSize=512m     -XX:MaxNewSize=512m
#  4 GB RAM    -Xms2048m     -Xmx2048m     -XX:NewSize=1024m    -XX:MaxNewSize=1024m
#  8 GB RAM    -Xms4096m     -Xmx4096m     -XX:NewSize=2048m    -XX:MaxNewSize=2048m
# 16 GB RAM    -Xms8192m     -Xmx8192m     -XX:NewSize=4096m    -XX:MaxNewSize=4096m
# 32 GB RAM    -Xms16384m    -Xmx16384m    -XX:NewSize=8192m    -XX:MaxNewSize=8192m
CATALINA_OPTS="$CATALINA_OPTS -server -Xms512m -Xmx512m -Xss256k -XX:+DisableExplicitGC"
CATALINA_OPTS="$CATALINA_OPTS -XX:NewSize=256m -XX:MaxNewSize=256m"

# If you're using a multi processor system, uncomment the following
# options and set the value of -XX:ParallelGCThreads equal to the
# number of processors that are in your system.
#CATALINA_OPTS="$CATALINA_OPTS -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=80"
#CATALINA_OPTS="$CATALINA_OPTS -XX:SurvivorRatio=128 -XX:MaxTenuringThreshold=0"

# APR Connector JNI Library
CATALINA_OPTS="$CATALINA_OPTS -Djava.library.path=/usr/local/apr/lib"

# Uncomment the following options to help debug garbage collection
# related performance problems.
#CATALINA_OPTS="$CATALINA_OPTS -verbose:gc -Xloggc:/usr/local/tomcat/logs/gc.txt -XX:+PrintGCDetails"

# Java Options.
JAVA_OPTS="$JAVA_OPTS -Djava.awt.headless=true"

# Raise open file limit and stack size.
ulimit -n 524288
ulimit -s 2048

Apache Tomcat Settings

Edit the /usr/local/tomcat/conf/ file and change the following log handlers from INFO to SEVERE level: = SEVERE = SEVERE = SEVERE = SEVERE
java.util.logging.ConsoleHandler.level = SEVERE

Replace the entire contents of the /usr/local/tomcat/conf/server.xml with the following recommended configuration:

<?xml version="1.0" encoding="utf-8"?>

<Server port="8005" shutdown="SHUTDOWN">

  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="off" />
  <Listener className="org.apache.catalina.core.JasperListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />

    <Resource name="UserDatabase" auth="Container"
              description="User database that can be updated and saved"
              pathname="conf/tomcat-users.xml" />

  <Service name="Catalina">

    <Connector protocol="org.apache.coyote.http11.Http11AprProtocol"

    <Engine defaultHost="localhost" name="Catalina">

      <Host name="localhost" appBase="webapps" unpackWARs="true">

        <Context docBase="ROOT" path="" privileged="false" swallowOutput="true" />


      <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>




Tip Tip

For high traffic sites, you should increase the values of the maxThreads and pollerSize options. If you have 8GB of RAM it's suggested to increase them to 2048 and 8192. When you have 16GB of RAM or more it's recommended to set them to 4096 and 16384.

Note Note

These settings are for Tomcat 7.0.x, which is the version we recommend using. If you are using an older version of Tomcat, please contact technical support for configuration guidance if needed.

Apache Tomcat Startup

Create /etc/rc.d/init.d/tomcat using the following recommended settings.

# Startup script for the Tomcat Web Server
# chkconfig: 345 92 16
# description: Tomcat is a World Wide Web server.  It is used to serve \
#              HTML, JSP, and servlets, and CGI if needed.
# processname: java


case "$1" in
        rm -rf $CATALINA_HOME/work
        mkdir $CATALINA_HOME/work
        sleep 45
        killall -9 java
        sleep 2
        rm -rf $CATALINA_HOME/work
        mkdir $CATALINA_HOME/work
        sleep 45
        killall -9 java
        sleep 2
        echo $"Usage: tomcat {start|restart|stop}"
        exit 1

exit 0

Note Note

Consult your operating system documentation to figure out where you need to put startup scripts. On most RPM compatible systems, either /etc/rc.d/init.d/tomcat or /etc/init.d/tomcat will work.

Run Level Configuration

chmod 755 /etc/rc.d/init.d/mysqld
/sbin/chkconfig --add mysqld
/sbin/chkconfig --level 2345 mysqld on
/sbin/chkconfig --list mysqld
chmod 755 /etc/rc.d/init.d/tomcat
/sbin/chkconfig --add tomcat
/sbin/chkconfig --level 345 tomcat on
/sbin/chkconfig --list tomcat

Note Note

Again, consult your operating system documentation here. The chkconfig commands may not be available on your operating system, in which case you'll need to manually link your startup script to the proper run levels. Most RPM compatible systems have the chkconfig command.

Firewall Configuration

AdvertPRO needs the following ports to be open in your firewall in order to function properly:

Port NumberProtocolAllow InputAllow OutputClient/Source AddressDestination AddressUsed By

Failure to open the aforementioned ports in your firewall will cause the AdvertPRO setup utility to abort.

Step #4: Startup

MySQL Database Server

/etc/rc.d/init.d/mysql start

Apache Tomcat Server

/etc/rc.d/init.d/tomcat start

Step #5: Finishing Up

MySQL Database

Log in to the MySQL client of your choosing and execute the following SQL queries to create the AdvertPRO database and user to access it.

GRANT ALL PRIVILEGES ON advertpro.* TO advertpro@"localhost" IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON advertpro.* TO advertpro@"localhost.localdomain" IDENTIFIED BY 'password';

Warning Warning

It is strongly recommended that you grant all privileges except for Grant to the database. However, if desired the Create_view, Show_view, Create_routine, Alter_routine, and Execute privileges are unused and may be revoked. Do not revoke any other privileges as doing so will prevent the normal operation of AdvertPRO!

Keep in mind that the database will be created using the default MySQL character set, which is specified by the character_set_system option in the my.cnf configuration file. For older versions of MySQL the option is named character_set instead. By default MySQL uses the Latin1 character set, so if you wish to use UTF-8 to support non-Latin1 characters create the MySQL database using this command unless you already changed the default MySQL character set to UTF-8:

CREATE DATABASE advertpro CHARACTER SET utf8 COLLATE utf8_general_ci;

When the AdvertPRO setup utility asks you for the JDBC URL you should changed it to specify that you want to use UTF-8 unless again you already changed the default MySQL character set to UTF-8 as the driver will always use the default MySQL character set regardless of the character set of your database:


GeoIP Database

If you have purchased the GeoIP Country or GeoIP City database, you should install that prior to running the AdvertPRO setup utility.

  1. GeoIP Country Installation
  2. GeoIP City Installation

There are also free versions of GeoIP Country and City that you can download for evaluation purposes, but you should bear in mind that they are not as accurate as the paid versions!

AdvertPRO Setup

  1. Open a browser window to:
  2. Follow the setup utility instructions.
  3. Make sure to follow the post-install instructions given by the setup utility too!

Note Note

It may take about 30 seconds from the time you start Apache Tomcat for it to automatically deploy AdvertPRO the first time.