Installing ZendTo on Windows
This document describes very briefly how to run ZendTo on a Windows 2008R2 Server. It should be easily applicable to later versions of Windows Server. All version numbers given are the latest at the time of writing (Autumn 2012).
Requirements
Installation
Setup MySQL
- Setup MySQL's root@localhost password
- Using the mysql command line create ZendTo user and database:
mysql> CREATE DATABASE zendto;
mysql> GRANT ALL PRIVILEGES ON zendto.* TO zendto@localhost IDENTIFIED by 'password';
mysql> FLUSH PRIVILEGES;
- Import Database:
mysql --user=zendto --password='password' zendto < zendto.MySQL
Setup phpmyadmin
- Extract phpmyadmin folder into web root of website
- Configure config.inc.php's blowfish secret
- From IIS website's Home page, navigate to the phpmyadmin folder on the left then select IP Address and Domain Restrictions.
- Enter in only the IP/Subnets that will be allowed to view phpmyadmin
Setup IIS6 SMTP Service
- In IIS6 Manager right click on SMTP and select properties.
- Under Access only anonymous should be checked
- Under the Relay button only 127.0.0.1 should be checked, "Only the list below" should be selected.
Setup IIS Website
- From IIS website's Home page:
- Click on Limits on right and set timeout to 3600 and hit ok
- In PHP Manager:
- View php recommendations and apply all
- Set runtime limits:
Maximum Post Size: 2040M
Maximum Upload File Size: 2020M
Maximum Execution Time: 7200
Maximum Files to Upload: 20
Maximum Input Time: 7200
Memory Limit: 300M
- Open PHP.ini from the PHP Manager. At the end:
[PHP_APC]
extension=php_apc.dll
[APC]
apc.rfc1867 = on
apc.max_file_size = 2000M
apc.slam_defense = 0
apc.enable_cli = 1
apc.ttl = 7200
apc.shm_size = 256M
apc.cache_by_default = off
apc.rfc1867_freq = 1M
apc.mmap_file_mask = "C:\windows\temp\apc.XXXXXX"
apc.shm_segments = 1
apc.optimization = 0
apc.user_ttl = 7200
apc.num_files_hint = 1024
- Confirm Time Zone is correct
- Enable PHP Extensions in PHP Manager: APC, bz2, curl, exif, fileinfo, gd2, gettext, gmp, ldap, mbstring, mysql, openssl, pdo_mysql, xmlrpc
- Setup website in IIS for transfer.domain.local (with header for transfer. domain.com)
- Request and install SSL certificate
- Bind SSL certificate to website, setup rewrite rule for SSL:
<rule name="Redirect to HTTPS" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
</rule>
- Extract zendto.tgz file into web root of website
Setup ClamAV
- Extract clamav for windows into a <web root of website>/clamav
- Copy out clamd.conf, freshclam.conf from the conf_examples and
- Comment out the "Example" line near the top
- Define Pidfile location
- Run freshclam.exe elevated As Administrator to get intial sync of definitions
- Install a Task in Task Scheduler as SYSTEM with highest privileges and set task to run every 4 hours for freshclam.exe
Setup RRDTool
Extract RRDTool for Windows into <web root of website>/rrdtool.
Setup ZendTo Website
- Set IUSR user to be able to write to the following directories (and create if not found):
data
data/dropoffs
data/rrd
data/temp
cache
clamav
- Set IUSR user to be able to read to the following directories and subfiles/folders:
www
lib
bin
sbin
config
templates*
rrdtool
- Configure preferences.php file: (C:\\inetpub\\wwwroot\\transfer.domain.com\\ )
define('NSSDROPBOX_BASE_DIR'
define('NSSDROPBOX_LIB_DIR'
define('NSSDROPBOX_DATA_DIR'
define('MYZENDTO','FALSE');
- Define RRDTool's path without a semi-colon or it will fail
define('RRD_DATA_DIR','\\inetpub\\wwwroot\\transfer.domain.com\\data\\rrd\\');
define('RRD_DATA',RRD_DATA_DIR.'zendto.rrd');
define('RRDTOOL','C:\\inetpub\\wwwroot\\transfer.domain.com\\rrdtool\\rrdtool.exe');
- Define MySQL instance variables in $NSSDROPBOX_PREFS
- Define real progress bar, local subnet array('10.10.') & RECAPTCHA Public and Private keys: https://www.google.com/recaptcha/admin/create
- Define LDAP lookup settings and default email domain & its Regular expression
- Define clamav as quiet "--quiet" with the correct path
Setup Tasks for Daily Processing
- Open a Command Prompt as administrator
- Navigate to sbin folder and run rrdInit.php to generate the rrd files in data/rrd:
php.exe rrdInit.php <preferences.php>
- Open Task Scheduler and make the following tasks:
- "File clean up"
- <path to php>\php.exe <path to>\cleanup.php <path to>preferences.php
- "rrdUpdates"
- <path to php>\php.exe <path to>\rrdUpdate.php <path to>\preferences.php
- "Stats"
- <path to php>\php.exe <path to>stats.php <path to>\preferences.php
- "Purge failed transfers"
- forfiles -p "C:\windows\temp" -s -m php*.tmp -d -0 -c "cmd /c del @path"
- forfiles -p "C:\windows\temp" -s -m upload*.txt -d -0 -c "cmd /c del @path"
- All Tasks happen at midnight, daily
- Make sure all tasks are created for Windows 2008 R2, Windows 7 or double quotes in the command line options will be converted to the wrong ASCI and all tasks will fail with 0x1