o create archive, use tar command.

To add all files and directories from current directory to arcive, including hidden files and folders

$ sudo cd /var/www
$ sudo tar -pczf www.tar.gz .

Option p is for preserving file permissions, c is to create new archive, f means, that following is the archive name, whateve you put after f should be a name of the new archive file, z is for compression. A is to archive whole directory including hidden files and folders. Optionally it is a good idea sometimes to use v argument for verbose, tar -pczvf name.of.the.tar.gz.