Windows Server 2008 R2 Help?

Use this forum for questions regarding installation, upgrading and configuration of OpenEMM

Moderator: moderator

trident50
Posts: 1
Joined: Tue Oct 18, 2011 1:08 am

Windows Server 2008 R2 Help?

Post by trident50 »

Hello,

Does OpenEMM run on Windows Server 2008?

I went through downloading and installing all the required apps - tomcat 6 (and tried 7), Python, Mysql....and I just keep getting error after error - and I've been trying to resolve them and each time I do - I progress one step and another error comes up. Right now I'm getting a tomcat error when I run the setup - it says tomcat not found - even though I put the correct path in the config file.

Also - the config file has no page breaks - it's 5 lines extending across about 10 screens of scrolling.

Is there any DETAILED, step by step, complete, documentation on how to install and configure this package?

I've seen quite a few posts of people just giving up on this - is it really this hard? ;)

Thanks for any help!
Rob
Brandon
Posts: 2
Joined: Mon Oct 24, 2011 2:15 pm

Re: Windows Server 2008 R2 Help?

Post by Brandon »

Yes... I spent months trying to get it to work on my server 2008... Thank GOD you can run a Virtual Box on Server 2008 :)
Tim Brown
Posts: 2
Joined: Wed Nov 16, 2011 12:42 pm

Re: Windows Server 2008 R2 Help?

Post by Tim Brown »

Yes it is possible, but and its a very very big but, it is very tricky.

First off, don't use notepad to edit the config files, it does not handle line breaks properly. Use http://notepad-plus-plus.org/ it is infinitely better.

It took a day to install and it is mostly working, we think the problem is RAM, and are upgrading to 2GB at the moment. This will be updated once we have tested with 2GB. We had a few additional issues because we were running Plesk with another email application.

A big point to note, if you are using another email management program to handle your server emails and you need that, then give up or get a new server, you need to sacrifice it in order to run Open EMM. Port 25 is required and we could not find anything in the config file to change it.

Here is the condensed version.

Step 1)
Preparation
==========

Ensure your server has a minimum of 2GB RAM and that out of that you are not running anything else. Initially we installed with only 1GB RAM and whilst most of the site worked, certain issues with Java came up and in the logs it showed the process killing its self due to lack of memory. It has now been discovered that it was a MySQL configuration issue. Not enough memory was being allocated. This was probably due to the Plesk installation. We have included the config file below.

Server Spec Used:
1&1 VS XL
2.1Ghz Quad Core with 8 Threads
2GB RAM
40GB Hard Drive (32GB free after installs)
Server 2008 R2
Plesk 11
1 .co.uk Domain

Get rid of any other email handling software that can take port 25!!!!!!!! <- very important!

Ensure you have access to windows Environment Variables Control Panel -> System -> Advanced System Setting -> Advanced -> Environmental Variables

Ensure your firewall will accept inbound port 8080 requests - Control Panel -> Windows Firewall -> Advanced Setting -> Inbound Rules -> Web Server (HTP) -> set the ports to 80, 8080

Make sure that you have the default windows SMTP service installed and running

Ensure you have access to the iis management console

Step 2)
Additional Software
================

If you are running 64bit, then install 64bit versions, it will save time in the long run.

Install MySQL latest version, and do make sure you remember the su password. If you are running plesk then it changes it and you will have to dig to find it.
http://dev.mysql.com/downloads/
Ensure that your my.ini file has at least the following configuration, although the location of your MySQL installation will need changing to the correct directory:

Please note that I have added the following markers in to help make things clearer. Just copy and paste the content in between the markers and not the markers themselves.

=====Start of File Content=====
===========================


===========================
======END of File Content=====

=====Start of File Content=====
===========================

[mysqld]
port=3306
basedir=C:\\Parallels\\Plesk\\Databases\\MySQL
datadir=C:\\Parallels\\Plesk\\Databases\\MySQL\\Data
default-character-set=latin1
default-storage-engine=INNODB
innodb_log_buffer_size=2048K
innodb_buffer_pool_size = 4096K
innodb_additional_mem_pool_size = 4096K
innodb_log_buffer_size=2048K
innodb_thread_concurrency=4
innodb_flush_log_at_trx_commit=1
innodb_log_file_size=10M
max_connections=150
max_user_connections=30
thread_cache_size=0
thread_stack = 8M
read_buffer_size = 1024K
read_rnd_buffer_size = 1024K
binlog_cache_size=32768
sort_buffer_size = 1024K
net_read_timeout=30
net_retry_count=10
net_write_timeout=30
thread_concurrency = 8
old_passwords=1
open_files_limit = 350
[client]
port=3306

===========================
======END of File Content=====

Install Python 2.7
http://www.python.org/getit/
Install Python 2.7 MySQL link
http://www.codegood.com/
Set the following security permissions for python.exe and pythonw.exe
Properties -> Compatibility -> Change Settings for all users -> Run this program as administrator
I know that this is a tad dangerous and you can change it to the iisuser once you have finished, but during setup set all your file and folder permissions to everyone -> full access. It will save you a lot of heart ache in the long run.

Install JDK 6 u29 or above
http://www.oracle.com/technetwork/java/ ... 13648.html
Set the following environmental variables:
JAVA_HOME = C:\Program Files\Java\jdk1.6.0_29\
PATH = C:\Program Files\Java\jdk1.6.0_29\bin

Install Tomcat 6 (Not the service!)
http://tomcat.apache.org/download-60.cgi
I would advise c:\tomcat as the directory as it will make your life easier later on
Set the following environmental variables:
CATALINA_HOME = C:\tomcat\
TOMCAT_HOME = C:\tomcat\
Again, I know that this is a tad dangerous and you can change it to the iisuser once you have finished, but during setup set all your file and folder permissions to everyone -> full access. It will save you a lot of heart ache in the long run.

maschoff has pointed out an important omission on our part, so thanks for that :D

In answer to your question, the isapi_redirect.dll is used to allow IIS to redirect request to Tomcat in a production environment. If you are using your server with a domain and have IIS handling the DNS work, IIS will not know how to pass over the port 8080 request to Tomcat. This part of the configuration is not necessary for localhost solutions, but it is for production servers. This is the hardest part of the install and will require a lot of time on the Tomcat website if it does not go smoothly. There are way too many things that can go wrong at this point for us to list them. We have condensed it down to what eventual worked on our server, but as we have plesk, this does change one or two things from a standard install.

Next you will need to create a folder called ISAPI so it looks like c:\tomcat\isapi\

Download and place "isapi_redirect.dll" in this folder.
http://tomcat.apache.org/download-connectors.cgi
You will also need a properties file called "isapi_redirect.properties"

The content need to be:

=====Start of File Content=====
===========================

extension_uri=/jakarta/isapi_redirect.dll

# You'll need to make sure the following are the correct dir's:
log_file=C:\tomcat\logs\isapi_redirect.log

#debug, info, warn, error or trace
log_level=info

# Paths to the relevant worker files
worker_file=C:\tomcat\conf\workers.properties
worker_mount_file=C:\tomcat\conf\uriworkermap.properties

===========================
======END of File Content=====

You will now need to go to C:\tomcat\conf\ and add the following 2 files:

workers.properties

=====Start of File Content=====
===========================

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Note that the distributed version of this file requires modification
# before it is usable.
#
# Reference documentation: http://tomcat.apache.org/connectors-doc ... rkers.html
#
# As a general note, the characters $( and ) are used internally to define
# macros. Do not use them in your own configuration!!!
#
# Whenever you see a set of lines such as:
# x=value
# y=$(x)\something
#
# the final value for y will be value\something

# Define two status worker:
# - jk-status for read-only use
# - jk-manager for read/write use
worker.list=jk-status
worker.jk-status.type=status
worker.jk-status.read_only=true

worker.list=jk-manager
worker.jk-manager.type=status

# We define a load balancer worker
# with name "balancer"
worker.list=balancer
worker.balancer.type=lb
# error_escalation_time: seconds, default = recover_time/2 (=30)
# Determines, how fast a detected error should switch from
# local error state to global error state
# Since: 1.2.28
worker.balancer.error_escalation_time=0

# - max_reply_timeouts: number, default=0
# If there are to many reply timeouts, a worker
# is put into the error state, i.e. it will become
# unavailable for all sessions residing on the respective
# Tomcat. The number of tolerated reply timeouts is
# configured with max_reply_timeouts. The number of
# timeouts occuring is divided by 2 once a minute and the
# resulting counter is compared against max_reply_timeouts.
# If you set max_reply_timeouts to N and the errors are
# occuring equally distributed over time, you will
# tolerate N/2 errors per minute. If they occur in a burst
# you will tolerate N errors.
# Since: 1.2.24
worker.balancer.max_reply_timeouts=10



# Now we add members to the load balancer
# First member is "node1", most
# attributes are inherited from the
# template "worker.template".
worker.balancer.balance_workers=node1
worker.node1.reference=worker.template
worker.node1.host=localhost
worker.node1.port=8109
# Activation allows to configure
# whether this node should actually be used
# A: active (use node fully)
# D: disabled (only use, if sticky session needs this node)
# S: stopped (do not use)
# Since: 1.2.19
worker.node1.activation=A

# Second member is "node2", most
# attributes are inherited from the
# template "worker.template".
worker.balancer.balance_workers=node2
worker.node2.reference=worker.template
worker.node2.host=localhost
worker.node2.port=8209
# Activation allows to configure
# whether this node should actually be used
# A: active (use node fully)
# D: disabled (only use, if sticky session needs this node)
# S: stopped (do not use)
# Since: 1.2.19
worker.node2.activation=A

# Finally we put the parameters
# which should apply to all our ajp13
# workers into the referenced template
# - Type is ajp13
worker.template.type=ajp13

# - socket_connect_timeout: milliseconds, default=0
# Since: 1.2.27
worker.template.socket_connect_timeout=5000

# - socket_keepalive: boolean, default=false
# Should we send TCP keepalive packets
# when connection is idle (socket option)?
worker.template.socket_keepalive=true

# - ping_mode: Character, default=none
# When should we use cping/cpong connection probing?
# C = directly after establishing a new connection
# P = directly before sending each request
# I = in regular intervals for idle connections
# using the watchdog thread
# A = all of the above
# Since: 1.2.27
worker.template.ping_mode=A

# - ping_timeout: milliseconds, default=10000
# Wait timeout for cpong after cping
# Can be overwritten for modes C and P
# Using connect_timeout and prepost_timeout.
# Since: 1.2.27
worker.template.ping_timeout=10000

# - connection_pool_minsize: number, default=connection_pool_size
# Lower pool size when shrinking pool due
# to idle connections
# We want all connections to be closed when
# idle for a long time in order to prevent
# firewall problems.
# Since: 1.2.16
worker.template.connection_pool_minsize=0

# - connection_pool_timeout: seconds, default=0
# Idle time, before a connection is eligible
# for being closed (pool shrinking).
# This should be the same value as connectionTimeout
# in the Tomcat AJP connector, but there it is
# milliseconds, here seconds.
worker.template.connection_pool_timeout=600

# - reply_timeout: milliseconds, default=0
# Any pause longer than this timeout during waiting
# for a part of the reply will abort handling the request
# in mod_jk. The request will proceed running in
# Tomcat, but the web server resources will be freed
# and an error is send to the client.
# For individual requests, the timeout can be overwritten
# by the Apache environment variable JK_REPLY_TIMEOUT.
# JK_REPLY_TIMEOUT since: 1.2.27
worker.template.reply_timeout=300000

# - recovery_options: number, default=0
# Bit mask to configure, if a request, which was send
# to a backend successfully, should be retried on another backend
# in case there's a problem with the response.
# Value "3" disables retries, whenever a part of the request was
# successfully send to the backend.
worker.template.recovery_options=3

===========================
======END of File Content=====

and uriworkermap.properties

=====Start of File Content=====
===========================

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# uriworkermap.properties - IIS
#
# This file provides sample mappings for example wlb
# worker defined in workermap.properties.minimal
# The general syntax for this file is:
# [URL]=[Worker name]

/admin/*=wlb
/manager/*=wlb
/jsp-examples/*=wlb
/servlets-examples/*=wlb
/examples/*=wlb

# Optionally filter out all .jpeg files inside that context
# For no mapping the url has to start with exclamation (!)

!/servlets-examples/*.jpeg=wlb

#
# Mount jkstatus to /jkmanager
# For production servers you will need to
# secure the access to the /jkmanager url
#
/jkmanager=jkstatus

===========================
======END of File Content=====

Reboot

In IIS manager you will need to add the following configuration:

[Computer Name] -> ISAPI and CGI restrictions -> Add..

Path = C:\tomcat\ISAPI\isapi_redirect.dll
Description = Tomcat
Allow extension path to execute = Tick

Next

[Computer Name] -> Sites -> Default Website/[Domain Name] -> ISAPI Filters -> Add..

Name = Tomcat
Filter = C:\tomcat\ISAPI\isapi_redirect.dll

Next

[Computer Name] -> Sites -> Default Website/[Domain Name] -> Add Virtual Directory

Name = Jakarta
Path = C:\tomcat\ISAPI\

Ensure that execute, read and write permissions are enabled on all filters and virtual directories you have just set up

Reboot

Start tomcat to test it is working.

Open your server browser and go to http:\\localhost:8080

You should see the tomcat "congratulations" page. If not then check the tomcat help files as there and a million and one reasons the blasted thing does not work.

Step 3
Open EMM
========

Extract to c:\openemm

Open the config file

c:\openemm\bin\openemm.py in anything other than notepad

If you have installed tomcat to c:\tomcat then change:

tomcathome = r'C:\tomcat'

else use the path to your install directory. please dont forget the small 'r' at the beginning and also make sure that directory structure is properly formatted.

Set the file and folder permissions to everyone -> full access

This is for testing

If your MySQL su username is not the default one then you can change it in the config file, there are four instances of it you will need to change.

The default is "root", you will need to change this to whatever your SU admin username is.

For some MySQL installs, especially on x64 machines, you will need to change the registry key that the setup is looking for.

The default is:

'SOFTWARE\MySQL AB'

Under my install it was at:

'SOFTWARE\Wow6432Node\MySQL AB'

There are two instances of this.

Reboot

Do not run the tomcat startup.bat file. the OpenEMM will start it for you.

Run c:\openemm\setup.bat

Hopefully you will have a clean setup, more than likely not. The output is fairly usless, but if you see any errors with py calls in the, then that is execution permissions.

The logs can be located in c:\openemm\var\log\

You will need these.

Once you have fought your way through the setup reboot

Once you are back up then run:

c:\openemm\start.bat

If this works then tomcat will fire up another console window. That is the point when you know you are getting there.

Problems:

.py issues, check your execution permissions as described in the python setup
.py issues referencing port, your port 25 is in use by another application, you need to get rid of that application

Hanging once you have started. I.e. it does not say anything like "running" after "found database". This is an issue with openemm not being able to find Tomcat. Check you config file, check that the path is correct and that the 'r' is in there. From all the research done this is where most people fall down, we were no exception, having missed the ':' in the 'c:\' of the path, by getting muddled up in all the configuration files flying around.

Tomcat, this will be a configuration issue with either tomcat or your path in the openemm config file is not correct. check those.

Once you have it running, if you get errors on the overview page saying something on the lines of "General Failure, please check you input", then this is a MySQL issue. There is not enough memory being allocated to one of the parts of MySQL. To fix this we quadrupled all memory allocations until it worked, see the my.ini file in the setup part of this. A great tool for checking and modifying your MySQL install is Workbench, which can be found here: http://www.mysql.com/products/workbench/

This is the SQL that needs the memory and causes the problem:

select count(*)
from
(
SELECT *,
case when senddate is null
then 0
else 1
end as send_null
FROM
(
SELECT a.mailing_id
, a.shortname
, a.description
, min(c.change_date) senddate
, m.shortname mailinglist
FROM
(
mailing_tbl a
LEFT JOIN
mailing_account_tbl c
ON
(
a.mailing_id=c.mailing_id
AND
c.status_field='W'
)
)
LEFT JOIN
mailinglist_tbl m
ON
(
a.mailinglist_id=m.mailinglist_id
AND
a.company_id=m.company_id
)
WHERE a.company_id = 1
AND a.deleted<>1
AND a.is_template=1
AND mailing_type in (0)
GROUP BY a.mailing_id
, a.shortname
, a.description
, m.shortname
) openemm
ORDER BY send_null ASC
, senddate DESC
, mailing_id DESC
) agn

Use this for testing in Workbench as you tweak your settings, remembering to restart the MySQL server after each change, once this runs cleanly, the overview error goes away.

Here is what it says in the official guide that comes with OpenEMM:

=====Start of File Content=====
===========================

3 IF YOU INSTALL FOR THE FIRST TIME
===================================

3.1 Start "setup.bat" from the home directory and follow the instruction on the screen. The super user password of the MySQL database has to be entered twice, first time to create the OpenEMM database, second time to fill it with the required database structure and content. To create the CMS database you have to enter the super user password twice as well.

3.2 After that you can change the default values for the redirection domain. This is typically "http://" followed by the name of your system (not "localhost" in a production environment) followed by the default port ":8080", e.g. for a server "www.domain.com" the redirect domain would be http://www.domain.com:8080". (Do not forget "http://" or ":8080"!)

3.3 To enable handling of incoming bounce mails not only for instant bounces (which works out of the box) but also for delayed bounces and
autoresponder mails you have to set the mailloop domain to a FQDN (Fully Qualified Domain Name) which points to the machine OpenEMM runs on. You can
find out the hostname of your machine with 'hostname', entered in the command line mode (Start -> Programs -> Accessories -> Command Prompt). Add
your domain name and TLD (Top Level Domain) to the hostname to get the FQDN (like news.openemm.org).

When you send e-mails and want to take advantage of the bounce management for delayed bounces there are two possibilities for the format of the sender
address:

A.) Use whatever address you like. Set up a bounce filter in OpenEMM (see user manual) to forward the filtered response to a feedback e-mail address of
your choice (different from the sender address, of course). Implement a forward mechanism to forward incoming mail sent back to the sender address
to the e-mail address generated by the bounce filter (like ext_1@news.openemm.org). The flow for responses of your e-mails works like this:

sender address -> filter-generated address (to filter out bounces) -> feedback address

B.) Use an e-mail address with the sender hostname (like newsletter@news.openemm.org) Since no real e-mail addresses exist for the sender hostname, normally it would not be possible to reply to an e-mail with this ender address. To forward responses to a valid e-mail address you have to define a bounce filter with an e-mail feedback address of your choice. The e-mail address generated by the bounce filter has to be defined as an alias in directory C:\OpenEMM\conf\bav in a new file named bav.conf-local. Example:

news@news.domain.com alias:ext_1@news.domain.com

The flow for responses of your e-mails works like this:

sender address -> bav.conf-local -> filter-generated address -> feedback address

3.4 You can enter a smart relay host. This may be useful for dial-up users to send the mail via their ISP. You can either just enter the domain or IP address or you can prefix this address by a <user>:<password> pair, separated by a '@'. If you want to remove a previous entry, just enter a hyphen '-'. An example for an ISP with domain 'mail.isp.com' using the username 'user' and the password 'pass' must be entered in this form:

user:pass@mail.isp.com

===========================
======END of File Content=====

Once you have had the heart attack of getting it running on http:\\localhost:8080 you need to try and access it through your external browser. If you cant then check your firewall, this is more than likely the problem.

There are two locations for the log files:

c:\openemm\logs

and

c:\openemm\vars\logs\

During the installation its the vars\logs that are the ones that will give you the errors you need. Once you have it running its the \logs that will be your friend.

Just a note of caution, whilst this looks simple, this is very much the cut down version, we were both hindered and helped by the fact that it had plesk installed. I have left out all the failed attempts, the back tracking and the shear frustration caused by the Tomcat/IIS elements just not working. If you are having an issue with a setting that you think should have taken then reboot, this method solved problems on more than one occasion. In the end, each installation will be different for each person, I only hope that this can help someone in some way.

Once it is up and running it is a truly fantastic tool and all credit to the developers for creating such a fantastic piece of software.

Update:
========

Just a little tip for anyone who is testing and something goes very horribly wrong and it starts to send out an email you don't want and you cant find a way of canceling it:

Go to

C:\OpenEMM\var\spool\QUEUE

This is the generated emails list. If you have set it to build first then send, then just delete this list. If you have not then you will need to flush this list as it generates each time and pray like mad that you have caught it all. This was a 50,000 send mistake I made, although thankfully I found the queue before it hit 200,000!

Update 2:
========

It is very important to back up your openemm.py file once you have got it all working, please please please remember to do this. If something goes wrong, this is the only file, configuration wise, that is the pain to setup. For some reason best known to its self my installation decided that it no longer liked Dyn tags, so I went and deleted all the files and folders in the directory, after having backed up the MySQL I dumped those out as well. In restoring the system to its original self I found that this was the only file I needed.
Last edited by Tim Brown on Mon Dec 19, 2011 4:15 pm, edited 9 times in total.
maschoff
Site Admin
Posts: 2608
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany
Contact:

Re: Windows Server 2008 R2 Help?

Post by maschoff »

Thanks a lot for sharing your experience with Windows Server 2008 R2! For those of us who are not all to familiar with Windows, could you please describe the purpose of the DLL "isapi_redirect.dll"? Thanks again!
OpenEMM Maintainer
Tim Brown
Posts: 2
Joined: Wed Nov 16, 2011 12:42 pm

Re: Windows Server 2008 R2 Help?

Post by Tim Brown »

Hi maschoff, I have updated the help file with the description of what it does. Hope it helps.
maschoff
Site Admin
Posts: 2608
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany
Contact:

Re: Windows Server 2008 R2 Help?

Post by maschoff »

Yes, it does. Thanks a lot!
OpenEMM Maintainer
Post Reply