AdvertPRO - Linux Installation

Step #1: Download Files

AdvertPRO

  1. Open a browser window to: https://services.renegadeinternet.com/download/
  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.

Java Development Kit

  1. Open a browser window to: http://java.sun.com/j2se/downloads/index.html
  2. Click on the Previous Releases at the top of the page.
  3. Click on the J2SE 5.0 Downloads link at the top of the page.
  4. Click on the Download button to the right of JDK 5.0 Update 15 near the middle of the page.
  5. Accept the license agreement and continue.
  6. Download the Linux RPM in self-extracting file for the Linux Platform if your Linux distribution supports RPM. Otherwise, download the Linux self-extracting file instead if your Linux distribution does not support RPM.

Note Note

» J2SE 1.4.0, 1.4.1, and 1.4.2 are also supported, however we recommend using J2SE 5.0 (1.5.0) for new installations.

» If you happen to be using FreeBSD or Mac OS X you will need to download the JDK directly from your operating system vendor.

» If the content of the file opens in your browser, you will need to right click on the link and choose Save Target As, then select All Files for the file type and append .bin to the filename.

Java Libraries

  1. Download the JavaMail 1.4 library from http://java.sun.com/products/javamail/downloads/index.html.
  2. Download the JAF 1.1 library from http://java.sun.com/javase/technologies/desktop/javabeans/jaf/downloads/index.html.

MySQL Database Server

  1. Open a browser window to one of the following:
  2. Scroll down to the table labeled Linux x86 RPM downloads.
  3. Download the Server package.
  4. Download the Client package.
  5. Download the Shared libraries package.
  6. Download the Shared compatibility libraries package.

Note Note

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

» The older MySQL 3.23 series is also supported, but it's not recommended for new installations.

» We do not recommend using the MySQL 5.1 series as it is not stable or production quality and as such it is not supported.

MySQL Connector/J JDBC Driver

  1. Open a browser window to one of the following:
  2. Download the Source and Binaries (tar.gz) package.

Note Note

The driver for MySQL 4.0 is also compatible with the older MySQL 3.23.

Apache Tomcat Server

  1. Open a browser window to: http://tomcat.apache.org/download-55.cgi
  2. Scroll down to the listing for Tomcat 5.5.26.
  3. Download the Binary Distribution labeled Core: tar.gz.

Step #2: Installation

Java Development Kit

chmod 755 jdk-1_5_0_<version>-linux-i586-rpm.bin
./jdk-1_5_0_<version>-linux-i586-rpm.bin

Note Note

You will find more complete installation instructions here: http://java.sun.com/j2se/1.5.0/install-linux.html

MySQL Database Server

rpm -qpl MySQL-server-<version>.i386.rpm
rpm -i MySQL-server-<version>.i386.rpm
rpm -i MySQL-client-<version>.i386.rpm
rpm -i MySQL-devel-<version>.i386.rpm
rpm -i MySQL-shared-compat-<version>.i386.rpm

Note Note

You will find more complete installation instructions here: http://dev.mysql.com/doc/mysql/en/Linux-RPM.html

Apache Tomcat Server

mv apache-tomcat-<version>.tar.gz /usr/local
cd /usr/local
gunzip apache-tomcat-<version>.tar.gz
tar -xf apache-tomcat-<version>.tar
mv apache-tomcat-<version> tomcat
rm -rf apache-tomcat-<version>*
cd tomcat
chmod 755 bin/startup.sh
chmod 755 bin/shutdown.sh

Java Libraries

unzip javamail-<version>.zip
cp javamail-<version>/mail.jar /usr/local/tomcat/common/lib/mail.jar
unzip jaf-<version>.zip
cp jaf-<version>/activation.jar /usr/local/tomcat/common/lib/activation.jar

MySQL Connector/J JDBC Driver

gunzip mysql-connector-java-<version>.tar.gz
tar -xf mysql-connector-java-<version>.tar
cd mysql-connector-java-<version>
cp mysql-connector-java-<version>-bin.jar /usr/local/tomcat/common/lib/mysql.jar

Warning Warning

Do not use the mysql-connector-java-<version>-bin-g.jar version of the driver! It is a DEBUG version of the driver and is very slow.

AdvertPRO

cp advertpro-<version>.war /usr/local/tomcat/webapps/advertpro.war

Step #3: Configuration

Environment Variables

export JAVA_HOME=/usr/java/jdk1.5.0_<version>
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 RedHat compatible systems, these variables can be defined in the /etc/profile file. We recommend placing these variables at the very end of that file.

MySQL Settings

Edit /etc/my.cnf and use the following as a template.

[client]
port            = 3306
socket          = /var/lib/mysql/mysql.sock

[mysqld]
bind-address    = 127.0.0.1
datadir         = /var/lib/mysql
port            = 3306
socket          = /var/lib/mysql/mysql.sock
skip-locking
set-variable    = max_connections=384
set-variable    = key_buffer=64M
set-variable    = table_cache=256
set-variable    = sort_buffer=4M
set-variable    = record_buffer=1M
set-variable    = max_allowed_packet=16M
set-variable    = myisam_sort_buffer_size=64M
set-variable    = thread_cache=8
server-id       = 1
old_passwords   = 1

[mysql.server]
user=mysql
basedir=/var/lib

[mysqld_safe]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

[mysqldump]
quick
set-variable    = max_allowed_packet=16M

[mysql]
no-auto-rehash

[isamchk]
set-variable    = key_buffer=128M
set-variable    = sort_buffer=128M
set-variable    = read_buffer=2M
set-variable    = write_buffer=2M

[myisamchk]
set-variable    = key_buffer=128M
set-variable    = sort_buffer=128M
set-variable    = read_buffer=2M
set-variable    = write_buffer=2M

[mysqlhotcopy]
interactive-timeout
        

Note Note

These settings are for MySQL 5.0.x (and also compatible with MySQL 4.1.x), which is the version we recommend using. If you are using an older version of MySQL, please contact technical support for configuration guidance if needed.

Apache Tomcat Environment

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

# Tomcat Home.
CATALINA_HOME="/usr/local/tomcat"

# Java Home.
JAVA_HOME="/usr/java/jdk1.5.0.x_<version>"

#
# 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.
#
CATALINA_OPTS="$CATALINA_OPTS -server -Xms512m -Xmx512m -Xss128k -XX:+DisableExplicitGC"

#
# 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.
#
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:+UseParNewGC -XX:ParallelGCThreads=4"
#CATALINA_OPTS="$CATALINA_OPTS -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=90"
#CATALINA_OPTS="$CATALINA_OPTS -XX:SurvivorRatio=128 -XX:MaxTenuringThreshold=0"

#
# 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 -Dsun.net.inetaddr.ttl=28800 -Dsun.net.inetaddr.negative.ttl=60"

# Raise open file limit.
ulimit -n 65536

# Raise stack size.
ulimit -s 2048

# RedHat 9 Workaround.
#export LD_ASSUME_KERNEL=2.2.5

Note Note

RedHat 9 users will want to uncomment export LD_ASSUME_KERNEL=2.2.5 if they experience stability problems.

Apache Tomcat Settings

Edit /usr/local/tomcat/conf/server.xml and use the following as a template.

<Server className="org.apache.catalina.core.StandardServer"
        debug="0"
        port="8005"
        shutdown="SHUTDOWN">

  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
            debug="0"/>

  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
            debug="0"/>

  <Listener className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"
            debug="0"/>

  <GlobalNamingResources>
    <Resource name="UserDatabase"
              auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml"/>
  </GlobalNamingResources>

  <Service className="org.apache.catalina.core.StandardService"
           debug="0"
           name="Catalina">

    <!--
      You cannot run both Apache or IIS and Tomcat on the same ports!
    -->
    <Connector acceptCount="128"
               bufferSize="2048"
               className="org.apache.coyote.tomcat5.CoyoteConnector"
               compression="off"
               connectionLinger="-1"
               connectionTimeout="30000"
               debug="0"
               disableUploadTimeout="false"
               enableLookups="false"
               maxKeepAliveRequests="0"
               maxHttpHeaderSize="8192"
               maxThreads="512"
               maxSpareThreads="480"
               minSpareThreads="32"
               port="80"
               redirectPort="443"
               URIEncoding="UTF-8"/>

    <!--
      Uncomment the following for isapi_redirect or mod_jk
    -->
    <!--
    <Connector acceptCount="128"
              className="org.apache.coyote.tomcat5.CoyoteConnector"
              debug="0"
              enableLookups="false"
              maxThreads="384"
              maxSpareThreads="48"
              minSpareThreads="16"
              port="8009"
              protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"
              protocol="AJP/1.3"
              redirectPort="8443"
              URIEncoding="UTF-8"
              useURIValidationHack="false"/>
    -->

    <Engine className="org.apache.catalina.core.StandardEngine"
            debug="0"
            defaultHost="localhost"
            mapperClass="org.apache.catalina.core.StandardEngineMapper"
            name="Catalina">

      <Host className="org.apache.catalina.core.StandardHost"
            appBase="webapps"
            autoDeploy="true"
            debug="0"
            name="localhost"
            unpackWARS="true"
            xmlValidation="false"
            xmlNamespaceAware="false">

        <Context charsetMapperClass="org.apache.catalina.util.CharsetMapper"
                 cookies="true"
                 crossContext="false"
                 debug="0"
                 docBase="ROOT"
                 mapperClass="org.apache.catalina.core.StandardContextMapper"
                 path=""
                 privileged="false"
                 reloadable="false"
                 swallowOutput="true"
                 useNaming="true"
                 wrapperClass="org.apache.catalina.core.StandardWrapper"/>

        <Context charsetMapperClass="org.apache.catalina.util.CharsetMapper"
                 cookies="true"
                 crossContext="false"
                 debug="0"
                 docBase="advertpro"
                 mapperClass="org.apache.catalina.core.StandardContextMapper"
                 path="/advertpro"
                 privileged="false"
                 reloadable="false"
                 swallowOutput="true"
                 useNaming="true"
                 wrapperClass="org.apache.catalina.core.StandardWrapper"/>

      </Host>

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

    </Engine>

  </Service>

</Server>
        

Note Note

These settings are for Tomcat 5.5.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

Edit /etc/rc.d/init.d/tomcat using the following as a template.

#!/bin/bash
#
# 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

CATALINA_HOME=/usr/local/tomcat

case "$1" in
  start)
        $CATALINA_HOME/bin/startup.sh
        ;;
  stop)
        $CATALINA_HOME/bin/shutdown.sh
        sleep 45
        killall -9 java
        sleep 2
        ;;
  *)
        echo $"Usage: tomcat {start|stop}"
        exit 1
esac

exit 0
        

Note Note

Consult your operating system documentation to figure out where you need to put startup scripts. On most RedHat 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/tomcat
chkconfig --add tomcat
chkconfig --level 345 tomcat on
chkconfig --list tomcat
/etc/rc.d/init.d/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 RedHat 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
25TCPYesYesAnyAnySMTP
80TCPYesYesAnyAnyHTTP
443TCPYesYesAnyAnyHTTPS
3306TCPYesYeslocalhostlocalhostMySQL
9000TCPNoYeslocalhostwebsvc1.advertpro.com
websvc2.advertpro.com
AdvertPRO
9001TCPNoYeslocalhostwebsvc1.advertpro.com
websvc2.advertpro.com
AdvertPRO
9002TCPNoYeslocalhostwebsvc1.advertpro.com
websvc2.advertpro.com
AdvertPRO
9003TCPNoYeslocalhostwebsvc1.advertpro.com
websvc2.advertpro.com
AdvertPRO
9004TCPNoYeslocalhostwebsvc1.advertpro.com
websvc2.advertpro.com
AdvertPRO
9005TCPNoYeslocalhostwebsvc1.advertpro.com
websvc2.advertpro.com
AdvertPRO

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

AdvertPRO

  1. Open a browser window to: http://www.yoursite.com/advertpro/servlet/setup
  2. Follow the setup utility instructions.
  3. Make sure to follow the post-install instructions given by the setup utility too!

Note Note

» This step assumes that you've already created a MySQL database and user for AdvertPRO.

» If you have purchased the GeoIP Country or City modules, you should place the database you downloaded in /usr/local/tomcat/webapps/advertpro/modules named GeoIPCountry.dat or GeoIPCity.dat, depending on which edition you actually purchased before running the setup utility.

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