I wrote a batch file to
* Dump MySQL databases and Subversion repositories
* Zip those files using 7 zip
* Email them using Blat
This was all working fine until my attachments reached about 5mb. At this point, I started receiving funny looking messages like this
begin 644 archive-2008-21-12-15-54.zip
M4$L#!`H``````,-^E3D````````````````(````4W1A9VEN9R]02P,$%```
M``@`PWZ5.66F^"0XN`,`V@H+`"P```!3=&%G:6YG+V%V:64M<F5P;W-I=&]R ...
Blat was automatically splitting large messages into multiple parts.
Suppressing this functionality using -nomps stopped the mail from being sent at all!
Checking my log revealed
Blat v2.6.2 w/GSS encryption (build : Feb 25 2007 12:06:19)
Message is too big to send. Please try a smaller message.
MailEnable was advertising an attachment size limit of 5mb.
If you are using MailEnable, you can alter the attachment size limit by opening MailEnable Administrator, clicking on "MailEnable Management", "Servers", "localhost" (or your server name), "Connectors", and right clicking on "SMTP". The message size limit setting is on the Inbound tab.
When setting up this blog on my new VPS, I had some trouble configuring PHP 5 on IIS6. I have installed PHP on Windows/IIS successfully a number of times in the past so this came as a surprise.
For the first time I was installing on an x64 operating system, and this does make a difference to the installation process.
Running PHP on 64-Bit Windows from the IIS Admin Blog noted the first issue was "trying to load a 32-bit application (in this case PHP) inside a 64-bit worker process"
In order to configure IIS to run in 32-bit mode you need to execute the following command :
cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs
SET W3SVC/AppPools/Enable32bitAppOnWin64 1
There are a number of helpful steps and screenshots available at http://www.iisadmin.co.uk/?p=14
Secondly, I added PHP5 to my list of Web Service Extensions.
* Navigate to the IIS Manager in whichever management console you prefer (I usually run compmgmt.msc)
* Open the Web Service Extensions panel
* Etiher click "Add a new Web service extension..." or right click in the current pane and click on the context menu item of the same name.
* Type a sensible extension name such as PHP5 into the "Extension name" box
* Click Add and navigate to your copy of php5isapi.dll
* Check "Set extension status to Allowed"
* Click OK
The IIS Admin blog has an alternative way to do this (on the command line). From the article How To Install PHP on IIS 6.0:
cscript iisext.vbs /AddFile c:\PHP\php5isapi.dll 1 PHPISAPI 1 “PHP ISAPI”
Restart IIS if necessary, and PHP5 should be ready to go.
http://svn.spears.at/ is a straightforward guide to installing multiple subversion repositories and serving them via Apache.
I ran into one problem during installation - I downloaded a zip file containing subversion from tigris.org, and unzipped it into my Program Files\Subversion directory. The Apache service would not start. Since I was not using the installer I also had to add Program Files\Subversion\bin to my PATH.
The error in the event log appeared as:
Event Type: Error
Event Source: Apache Service
Event Category: None
Event ID: 3299
Date: 12/20/2008
Time: 5:19:33 PM
User: N/A
Computer: ********
Description:
The Apache service named reported the following error:
>>> httpd.exe: Syntax error on line 127 of C:/.../Apache2.2/conf/httpd.conf: Cannot load C:/.../Apache2.2/modules/mod_dav_svn.so into server: The specified module could not be found
This was despite it existing in the Apache2.2/modules directory.
When nesting batch files, you must use the CALL command
first.bat
echo Begin first.bat
CALL second.bat
echo End first.bat
If the "CALL" command is not used, "echo End first.bat" will never be executed.
for /f "tokens=2,3,4,5,6 delims=/: " %%a in ("%date% %time%") do set timestamp=%%c-%%b-%%a-%%d-%%e
mysqldump -u DatabaseUsername -pPassword TheDatabaseName > C:\Archive\TheDatabaseName-%timestamp%.sql
References: http://technet.microsoft.com/en-au/library/bb490909.aspx
This currently points to the "for" article under Command Line reference A-Z under Windows XP in technet. Of course, by the time you click on the link, the article will have moved to a different URL.
By default, IIS logs are located in %SystemRoot%\system32\LogFiles
If you need to know the value of the environment variable %SystemRoot%, open a command prompt and type "echo %SystemRoot%"
Other environment variables are listed here http://en.wikipedia.org/wiki/Environment_variable#Examples_from_Microsoft_Windows