13.09.2016 Views

PHP and MySQL Web Development 4th Ed-tqw-_darksiderg

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

358 Chapter 15 E-commerce Security Issues<br />

Packets can be filtered by their type, source address, destination address, or port information.<br />

Some packets are merely discarded; other events can be set to trigger log entries<br />

or alarms.<br />

Data Backups<br />

You cannot underestimate the importance of backups in any disaster recovery plan.<br />

Hardware <strong>and</strong> buildings can be insured <strong>and</strong> replaced, or sites hosted elsewhere, but if<br />

your custom-developed web software is gone, no insurance company can replace it<br />

for you.<br />

You need to back up all the components of your website—static pages, scripts, <strong>and</strong><br />

databases—on a regular basis. Just how often you back up depends on how dynamic<br />

your site is. If it is all static, you can get away with backing it up when it has changed.<br />

However, the kinds of sites we talk about in this book are likely to change frequently,<br />

particularly if you are taking orders online.<br />

Most sites of a reasonable size need to be hosted on a server with RAID, which can<br />

support mirroring.This covers situations in which you might have a hard disk failure.<br />

Consider, however, what might happen in situations in which something happens to the<br />

entire array, machine, or building.<br />

You should run separate backups at a frequency corresponding to your update volume.These<br />

backups should be stored on separate media <strong>and</strong> preferably in a safe, separate<br />

location, in case of fire, theft, or natural disasters.<br />

Many resources are available for backup <strong>and</strong> recovery.We concentrate on how you<br />

can back up a site built with <strong>PHP</strong> <strong>and</strong> a <strong>MySQL</strong> database.<br />

Backing Up General Files<br />

You can back up your HTML, <strong>PHP</strong>, images, <strong>and</strong> other nondatabase files fairly simply on<br />

most systems by using backup software.<br />

The most widely used of the freely available utilities is AMANDA, the Advanced<br />

Maryl<strong>and</strong> Automated Network Disk Archiver, developed by the University of Maryl<strong>and</strong>.<br />

It ships with many Unix distributions <strong>and</strong> can also be used to back up Windows<br />

machines via SAMBA.You can read more about AMANDA at http://www.am<strong>and</strong>a.<br />

org/.<br />

Backing Up <strong>and</strong> Restoring Your <strong>MySQL</strong> Database<br />

Backing up a live database is more complicated than backing up general files.You need<br />

to avoid copying any table data while the database is in the middle of being changed.<br />

Instructions on how to back up <strong>and</strong> restore a <strong>MySQL</strong> database can be found in<br />

Chapter 12,“Advanced <strong>MySQL</strong> Administration.”

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!