Archive for the ‘Hosting’ Category

FileZilla passive mode on Windows Server 2003

Thursday, February 7th, 2008

This took me a while to figure out so posting for any future server setups I have to do.

To enable passive mode in FileZilla FTP server on win2003 you need to do the following:

1 - Open a small range of ports in your windows firewall
Firstly make sure port 21 is open.
You can do this under Control Panel -> Windows Firewall -> Exceptions tab -> Add Port
Enter 21 as the port number and FTP as the description ensuring TCP is selected and OK.

Then you need to do the same with a range of ports typically of a much higher number, you can do this using the same approach but that will take a long time to add them, alternatively, create a new textfile called passiveopen.bat and paste in the following:

CODE:
  1. Echo OFF
  2.  
  3. ECHO OPENING FIREWALL PORTS
  4. FOR /L %%I IN (6500,1,6550) DO NETSH FIREWALL ADD PORTOPENING TCP %%I FTPPort%%I
  5.  
  6. REM iisreset
  7.  
  8. ECHO FINISHED
  9. Pause

save then open command prompt (start, run, "cmd" enter)
and type the path and filename of that textfile (E.g. "c:\passiveopen.bat") which will open the ports 6500 to 6550 for you.

2 - Open the same ports on your router/other firewalls
Depending on your setup you might need to open the same ports on your router and any other hardware and software firewalls you have running.

3 - Tell FileZilla to use those ports for passive mode
In FileZilla server click Edit -> Settings
Select Passive Mode Settings from the menu on the left and enter the ports in the custom ports range box.

Et voila! passive mode should now be firing on all cylinders. Simple and obvious but thought I'd share in case anyone else doesn't want to dig through the docs and isn't too familiar with how passive mode works.

Simple batch file backup

Saturday, August 18th, 2007

I've just setup a very simple backup system that works over FTP. Windows only I'm afraid but i'm sure the equivilent isn't too hard on other platforms.

Tools
Firstly I used two very simple free/open source command line tools:
SSLFTP - simple FTP tool that works in passive mode or over secure connections.
and
7-zip - an open source zip file archiver.

Download and install the above on the machine you wish to backup from.

FTP Script
I then wrote the following script file to handle the FTP (saved as ftpscript.txt):

open ftpusername:ftppassword@ftp.host.address
del backup7.zip
rename backup6.zip backup7.zip
rename backup5.zip backup6.zip
rename backup4.zip backup5.zip
rename backup3.zip backup4.zip
rename backup2.zip backup3.zip
rename backup.zip backup2.zip
put c:\backupscripts\backup.zip
bye

All this is doing is taking a copy of seven days worth of backups and deleting the oldest then uploading the newest backup.

Backup Script
To decrease the time taken to FTP everything I use the following batch file to keep three days worth of backups locally, zip the files I want to backup and call the above FTP script (saved as daily.bat):

delete backup3.zip
rename backup2.zip backup3.zip
rename backup.zip backup2.zip
7z a -tzip d:\backupscripts\backup.zip d:\inetpub\wwwroot\
7z a -tzip d:\backupscripts\backup.zip d:\DB_Backup\
7z a -tzip d:\backupscripts\backup.zip d:\other_folders_to_keep\
sslftp -run ftpscript.txt

The 7z lines mean the following:
7z - execute the 7-zip exe
a - add files
-tzip - archive file type of zip
d:\backupscripts\backup.zip - archive to add to (will create if does not exist)
d:\backupscripts\backup.zip d:\other_folders_to_keep\ folder/files to add to archive

And thats it! All you do then is setup a scheduled task (Start, Settings, Control Panel, Scheduled Tasks) to run every night and you're done!

What no FTP?
If you don't have any FTP space you can backup across a network/internet connection and setup a PC as an FTP server using the excellent FileZilla.

UPDATE: see comments for some notes from William who suggests some alternative syntax if you have issues with the above and a more logical sequence to protect against things going wrong mid-process.

Shout about GOOD service

Friday, October 6th, 2006

I recently involved myself in the sharing of frustrations about shocking customer service from banks and telecoms providers in the UK with Aral.

Today I had some troubles with one of our customer's emails apparently not being received, we use MDaemon mail server. I hit a brick wall and called the guys at ZenSoftware who we purchased the software through... in fact I called them three times and emailed them once. Every time they told me exactly what I needed to know. The one time I called and couldn't get through they returned my call within 10 minutes and my email was also responded to almost immediately.

I figure people don't tend to shout about good customer service so have decided to start mentioning positive experiences as well as bad.

Problems sending mails to AOL and similar

Tuesday, August 8th, 2006

AOL, the wonderful company that they are, require any mail to be sent to them to be from a server with a valid reverse DNS lookup (ptr) record. If you're finding emails bouncing back from AOL (and some others) make sure your mail server's domain name server has an an appropriate ptr record setup.

This is actually a fairly resonable anti-spam measure, however try finding out from AOL that's the problem isn't so reasonable. Anyway posting this as we've had this issue a couple of times and would make for a good reference.

To check you have an appropriate reverse dns setup, goto www.dnsstuff.com and enter the IP of your mailserver into the 2nd field in the middle. at the bottom if you're okay it should say:
Answer:

83.98.149.130 PTR record: mail.moov2.com. [TTL 172800s] [A=83.98.149.130]

if not you'll get some message saying no reverse lookup or similar.