Differences
This shows you the differences between two versions of the page.
internet:self-hosting [2011/12/24 14:52] cyril |
internet:self-hosting [2013/09/19 16:40] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Website Self Hosting ====== | ||
- | |||
- | ===== IP ===== | ||
- | |||
- | Dynamic DNS service if you don't have a static IP. | ||
- | |||
- | ===== Hardware ===== | ||
- | |||
- | Any old machine, or even better an old laptop (less power, less noise, less room). | ||
- | |||
- | ==== Flash cache ==== | ||
- | |||
- | Solutions for hybriding flash drives and hard drives have been experimented to save power on laptops, but it is quite complex in the general case and there is no final-user implementation yet, and the gains are limited on an everyday use machine. However it is a lot more efficient and simple on a server, as there are a lot less interactions with users and the panel of activities is largely reduced. Hence you only have to put on flash disk a few directories and files that the system regularly write to (the cache in RAM is enough for reading), and the disk can remain spun down for hours or days if you don't start unusual applications. | ||
- | |||
- | You need an USB stick or SD Card of at least 2GB (4GB is advised), and init scripts to mount and fetch during early boot process, and unmount and flush during late shutdown process. For instance I wrote those for Gentoo: [[init_fcache|/ | ||
- | |||
- | The main directories you need to take care of are: | ||
- | * ''/ | ||
- | * ''/ | ||
- | * ''/ | ||
- | |||
- | For files, create a '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * for GDM: set '' | ||
- | * for SSHD: set '' | ||
- | * for SU: set '' | ||
- | * for the rest: set '' | ||
- | |||
- | You can use a script similar to this one to monitor what files are being used and add them to the cache (you can then grep " | ||
- | <code sh> | ||
- | #!/bin/sh | ||
- | |||
- | dmesg -c | ||
- | rm -f / | ||
- | #sudo sysctl vm.block_dump=1 | ||
- | echo 1 > / | ||
- | watch "dmesg -c >> / | ||
- | echo 0 > / | ||
- | </ | ||
- | |||
- | If you want to monitor if your drive remains spun down, you can use the following command: | ||
- | <code sh> | ||
- | hdparm -C /dev/sda | ||
- | </ | ||