Version 3.0
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
-
Open a browser window to:
https://services.renegadeinternet.com/download/
-
Enter your Customer ID and E-mail Address into the form.
-
Select the operating system your server is running from the Platform list box.
-
Select the Install package for a clean installation from the Package list box.
-
Click on the Download Package button to proceed.
-
Check your e-mail and you should receive an e-mail with a download link within a few minutes.
Tip
When 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
-
Open a browser window to:
http://www.oracle.com/technetwork/java/javase/downloads/
-
Click on the Java Download graphic for Java Platform (JDK).
-
Click on the Accept License Agreement radio button on the next page.
-
Then click on the download link for Windows x86 if you have a 32-bit system or
Windows x64 if you have a 64-bit system.
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
-
Download the JavaMail 1.4 library from
http://www.oracle.com/technetwork/java/javamail-1-4-140512.html
-
Download the JAF 1.1 library from
http://www.oracle.com/technetwork/java/jaf11-139815.html
MySQL Database Server
-
Open a browser window to:
http://dev.mysql.com/downloads/mysql/
-
Select Microsoft Windows for the Platform.
-
Download MySQL 5.5.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
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
-
Open a browser window to one of the following, depending on your chosen version of MySQL:
-
Download the ZIP Archive package.
Apache Tomcat Server
-
Open a browser window to:
http://tomcat.apache.org/download-70.cgi
-
Scroll down to the listing for Tomcat 7.0.x.
-
Download the Binary Distribution labeled Core: 32-bit/64-bit Windows Service Installer.
Step #2: Installation
Java Development Kit
-
Run the jdk-{version}-windows-x86.exe or jdk-{version}-windows-x64.exe executable that you
downloaded in Step #1.
-
When prompted for the installation directory, you should enter:
C:/JDK -- do not enter a directory name
with spaces!
Note
MySQL Database Server
-
Run the mysql-{version}-winx64.msi executable that you
downloaded in Step #1.
-
Select that you want to perform a Custom installation.
-
When prompted for the installation directory, you should enter:
C:/MySQL -- do not enter a directory name
with spaces!
-
Allow the installer to complete and then proceed with configuration.
-
Select that you want to perform a Detailed configuration. Proceed to the next step.
-
Select the configuration for Server Machine for optimal performance. Proceed to the next step.
-
Select the Non-Transactional for the database usage to enable MyISAM type tables. Proceed to the next step.
-
Select the Manual setting and enter 100 concurrent connections. Proceed to the next step.
-
Leave Enable TCP/IP Networking and Strict Mode enabled. Proceed to the next step.
-
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.
-
Leave Install as Window Service enabled. Proceed to the next step.
-
Enter a root password, which will be used to allow administrator access to MySQL. Proceed to the next step.
-
Press the Execute button to deploy MySQL with your new configuration.
Tip
If you are experiencing SQLException: Out of resources when opening file errors from MySQL, try
adding open_files_limit=65535 to your C:/MySQL/my.ini file in the [mysqld]
section and then restart the MySQL service to resolve the issue.
If you know that you're going to be uploading GIF, JPG, PNG or SWF files that exceed 1 MB in size or you are
experiencing SQLException: Got a packet bigger than 'max_allowed_packet' bytes errors from MySQL,
try adding max_allowed_packet=16M to your C:/MySQL/my.ini file in the [mysqld]
section and then restart the MySQL service to resolve the issue.
Note
Apache Tomcat Server
-
Run the apache-tomcat-{version}.exe executable that you
downloaded in Step #1.
-
When prompted for the installation directory, you should enter:
C:/Tomcat -- do not enter a directory name
with spaces!
-
You should choose to do a Full installation in order to install the
Windows service to start Tomcat automatically when Windows starts.
-
It's also recommended that you uncheck the following packages so that they are not installed:
- Documentation
- Manager
- Host Manager
- Examples
-
When prompted for the HTTP port you should enter 80, which is the standard HTTP port.
-
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
Edit the C:/Tomcat/conf/logging.properties file and change the following log handlers
from INFO to SEVERE level:
1catalina.org.apache.juli.FileHandler.level = SEVERE
2localhost.org.apache.juli.FileHandler.level = SEVERE
3manager.org.apache.juli.FileHandler.level = SEVERE
4host-manager.org.apache.juli.FileHandler.level = SEVERE
java.util.logging.ConsoleHandler.level = SEVERE
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.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
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
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 Service
-
Click on the Start menu and go to All Programs > Apache Tomcat > Configure
-
Click on the Java tab.
-
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.
-
Then enter a value of 128 in the Thread Stack Size
field.
-
Click on the Shutdown tab.
-
Enter a value of 60 for the Timeout to ensure that Tomcat is always given
a chance to perform a clean shutdown.
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\Tomcat7
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 Number | Protocol | Allow Input | Allow Output | Client/Source Address | Destination Address | Used By |
25 | TCP | Yes | Yes | Any | Any | SMTP |
80 | TCP | Yes | Yes | Any | Any | HTTP |
443 | TCP | Yes | Yes | Any | Any | HTTPS |
3306 | TCP | Yes | Yes | localhost | localhost | MySQL |
9000 | TCP | No | Yes | localhost | websvc1.advertpro.com websvc2.advertpro.com | AdvertPRO |
9001 | TCP | No | Yes | localhost | websvc1.advertpro.com websvc2.advertpro.com | AdvertPRO |
9002 | TCP | No | Yes | localhost | websvc1.advertpro.com websvc2.advertpro.com | AdvertPRO |
9003 | TCP | No | Yes | localhost | websvc1.advertpro.com websvc2.advertpro.com | AdvertPRO |
9004 | TCP | No | Yes | localhost | websvc1.advertpro.com websvc2.advertpro.com | AdvertPRO |
9005 | TCP | No | Yes | localhost | websvc1.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
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 GeoIP City database,
you should install that prior to running the AdvertPRO setup utility.
-
GeoIP Country Installation
-
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
-
Open a browser window to:
http://ads.yoursite.com/servlet/setup
-
Follow the setup utility instructions.
-
Make sure to follow the post-install instructions given by the setup utility too!
Note
It may take about 30 seconds from the time you start Apache Tomcat for it to automatically
deploy AdvertPRO the first time.