FreeBSD Server Administration

April 07, 2005

How to Transfer a Website Effectively

Tar command is the most effective way to transfer a website between servers:

1. On old server
Package DB data
# cd /var/db/mysql/db_name/
# tar cvzf /home/account_name/accountdb.tar.gz *

Package all files under the account's home directory.
% cd /home/account_name
% tar cvzf account.tar.gz *

2. On new server
Add a new user with the same account name, also create a database for it.

Get the gz file with ftp from the old server and unpack it.
% cd /home/account_name
% tar xvf account.tar.gz

Unpack DB data.
# cd /var/db/mysql/db_name/
# tar xvf /home/account_name/accountdb.tar.gz

The website should be ready after updating named and Apache configuration file.

Posted by FreeBSD Newbie at 08:11 PM | Comments (0)

November 18, 2004

Monitor Your Server

You might want to monitor your server since you have to take care of it yourself, here are two websites which offer free service, they will send you email in case your server is inaccessible:
siteuptime.com

Update(Mar. 3rd, 2005): After using both service for three months, I removed one because of reliability. siteuptime.com is very reliable, never failed to report when the server is inaccessible, nor gave error report when server is fine.

Posted by FreeBSD Newbie at 05:01 PM | Comments (0)

November 04, 2004

Redirect Output to Email

If you prefer to reading long document or output on Windows, output redirect does this job well, for example,
# mysqladmin variables | mail yourname@domain.com

But I don't know why the following command doesn't work, only got an empty message.
# man crontab | mail yourname@domain.com
(Update: please read comments for explanation)

Posted by FreeBSD Newbie at 01:50 PM | Comments (2)