AdvertPRO - Windows Installation

Prerequisites

Windows Versions

There are many different versions of the Windows operating system. AdvertPRO can be run on all versions of Windows, including desktop versions like Windows XP/Vista/7. However, for best performance in production, it's recommended that you use Windows 2000/2003/2008 Server.

IIS Web Server

AdvertPRO does not require using IIS Web Server. It is only recommended that you use IIS if you need to host other web sites or applications on the same server as AdvertPRO is going to be installed on. If you must use IIS, it's suggested that you configure IIS and Apache Tomcat to listen to different IP addresses so that both of them can simultaneously use ports 80/443 for the HTTP and HTTPS protocols. Methods do exist to proxy requests from IIS to Apache Tomcat. Most commonly the Tomcat ISAPI connector is used, however, it does not currently work properly on Windows 2008 Server. The alternative would be to use the Application Request Routing module, however, its URL rewriting capabilities are too limited to support AdvertPRO. That is why we currently recommend running Apache Tomcat standalone from IIS.

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://www.oracle.com/technetwork/java/javase/downloads/
  2. Click on the Download JDK button for JDK 6.
  3. Click on the Download button on the next page.
  4. Select your Platform, which will be Windows if you have 32-bit system or Windows x64 if you have a 64-bit system and then click on the Continue button.
  5. Click on the link to download the JDK installer.

Note Note

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

Java Libraries

  1. Download the JavaMail 1.4 library from http://www.oracle.com/technetwork/java/javamail-1-4-140512.html
  2. Download the JAF 1.1 library from http://www.oracle.com/technetwork/java/jaf11-139815.html

MySQL Database Server

  1. Open a browser window to: http://dev.mysql.com/downloads/mysql/
  2. Select Microsoft Windows for the Platform.
  3. Download MySQL 5.1.x by selecting the Windows Essentials (x86, 32-bit) installer for 32-bit systems or if you have a 64-bit system instead download the Windows Essentials (x86, 64-bit) installer.

Note Note

We fully support the MySQL 4.0, 4.1 and 5.0 series, however we recommend using MySQL 5.1 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 ZIP Archive package.

Apache Tomcat Server

  1. Open a browser window to: http://tomcat.apache.org/download-60.cgi
  2. Scroll down to the listing for Tomcat 6.0.x.
  3. Download the Binary Distribution labeled Core: 32-bit/64-bit Windows Service Installer.

Step #2: Installation

Java Development Kit

  1. Run the jdk-<version>-windows-x64.exe executable that you downloaded in Step #1.
  2. When prompted for the installation directory, you should enter: C:/JDK -- do not enter a directory name with spaces!

Note Note

You will find more complete installation instructions here: http://www.oracle.com/technetwork/java/javase/index-137561.html#windows

MySQL Database Server

  1. Run the mysql-<version>-winx64.msi executable that you downloaded in Step #1.
  2. Select that you want to perform a Custom installation.
  3. When prompted for the installation directory, you should enter: C:/MySQL -- do not enter a directory name with spaces!
  4. Allow the installer to complete and then proceed with configuration.
  5. Select that you want to perform a Detailed configuration. Proceed to the next step.
  6. Select the configuration for Server Machine for optimal performance. Proceed to the next step.
  7. Select the Non-Transactional for the database usage to enable MyISAM type tables. Proceed to the next step.
  8. Select the Manual setting and enter 100 concurrent connections. Proceed to the next step.
  9. Leave Enable TCP/IP Networking and Strict Mode enabled. Proceed to the next step.
  10. If you plan to run text ads which use characters outside of the Latin1 character set, you should select Best Support for Multilingualism to use the UTF-8 character set. Proceed to the next step.
  11. Leave Install as Window Service enabled. Proceed to the next step.
  12. Enter a root password, which will be used to allow administrator access to MySQL. Proceed to the next step.
  13. Press the Execute button to deploy MySQL with your new configuration.

Note Note

You will find more complete installation instructions here: http://dev.mysql.com/doc/refman/5.1/en/windows-installation.html

Apache Tomcat Server

  1. Run the apache-tomcat-<version>.exe executable that you downloaded in Step #1.
  2. When prompted for the installation directory, you should enter: C:/Tomcat -- do not enter a directory name with spaces!
  3. You should choose to do a Full installation in order to install the Windows service to start Tomcat automatically when Windows starts.
  4. It's also recommended that you uncheck the following packages so that they are not installed:
  5. When prompted for the HTTP port you should enter 80, which is the standard HTTP port.
  6. When prompted to start Tomcat, unselect the box to do so because you will need to properly configure it before allowing it to start.

Java Libraries


unzip javamail-<version>.zip
copy javamail-<version>/mail.jar C:/Tomcat/lib/mail.jar
unzip jaf-<version>.zip
copy jaf-<version>/activation.jar C:/Tomcat/lib/activation.jar

MySQL Connector/J JDBC Driver


unzip mysql-connector-java-<version>.zip
cd mysql-connector-java-<version>
copy mysql-connector-java-<version>-bin.jar C:/Tomcat/lib/mysql.jar

AdvertPRO


cd C:/Tomcat/webapps
del ROOT
copy advertpro-<version>.war C:/Tomcat/webapps/ROOT.war

Step #3: Configuration

Apache Tomcat Settings

Replace the entire contents of the C:/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.ServerLifecycleListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />

  <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 name="Catalina">

    <Connector protocol="org.apache.coyote.http11.Http11AprProtocol"
               acceptCount="128"
               connectionTimeout="10000"
               disableUploadTimeout="false"
               enableLookups="false"
               maxKeepAliveRequests="100"
               keepAliveTimeout="15000"
               maxThreads="512"
               pollTime="2000"
               pollerSize="2048"
               useSendfile="true"
               sendfileSize="1024"
               port="80"
               redirectPort="443"
               URIEncoding="UTF-8"/>

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

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

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

      </Host>

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

    </Engine>

  </Service>

</Server>
        

When running IIS and Tomcat on the same server you must add the address="{ipaddr}" attribute to the <Connector> tag, which will tell Tomcat that it should exclusively listen to port 80 on that IP address and you should also of course configure IIS not to listen to that same IP address.

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 6.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 Service

  1. Click on the Start menu and go to All Programs > Apache Tomcat > Configure
  2. Click on the Java tab.
  3. Enter a value of at least 256 in the Initial Memory Pool field and then enter the same value in the Maximum Memory Pool field. A general rule of thumb is to allocate half the physical memory available in your server. For example, if your server has 4GB of RAM you should enter a value of 2048.
  4. Then enter a value of 128 in the Thread Stack Size field.
  5. Click on the Shutdown tab.
  6. Enter a value of 60 for the Timeout to ensure that Tomcat is always given a chance to perform a clean shutdown.

Note Note

It is also necessary to make the Tomcat service dependant on the MySQL service to ensure they are started in the correct order. This can be done by editing the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tomcat6 registry key and adding a new Multi-String Value to it named DependOnService with a value of MySQL, assuming of course that's what you've named the MySQL service.

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


          Verify the MySQL service is started and set to run automatically using the Services manager in the
          Control Panel.
        

Apache Tomcat Server


          Verify the Apache Tomcat service is started and set to run automatically using the Services manager in the
          Control Panel.
        

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.


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

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:


jdbc:mysql://localhost:3306/advertpro?useUnicode=true&characterEncoding=UTF-8

GeoIP Database

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

  1. GeoIP Country Installation
  2. GeoIP City Installation

AdvertPRO Setup

  1. Open a browser window to: http://ads.yoursite.com/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

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