This Server

From Playful Exploration
Revision as of 00:07, 1 November 2018 by Peter (talk | contribs) (→‎Bash commands)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Installed Components

Click this link to get a SSL report of this server: https://www.ssllabs.com/ssltest/analyze.html?d=playfulexploration.com .

Adobe SVG Viewer plugin (for Internet Explorer) or use Firefox, Opera or Safari instead.

Backup strategy

Postulates

  • More important than having a very fancy backup mechanism is to have some backup mechanism

States and Status

Adobe SVG Viewer plugin (for Internet Explorer) or use Firefox, Opera or Safari instead.

Strategy A: Simple ZIP

Using ssh:

 # backup changes of files and folders
 #mkdir /backup
 rsync -av --relative /var/www/html/wiki/LocalSettings.php /var/www/html/wiki/extensions/ /var/www/html/wiki/htmlets/ /backup/mediawiki/
 # export the wikimedia database
 mysqldump -uroot --single-transaction --databases mediawiki >/backup/mediawiki/wiki_mysql_database.sql
 # zip it
 zipfile="mediawiki_$(date +'%Y%m%d-%H%M%S').zip"
 pushd /backup/; zip -r $zipfile mediawiki/*; popd
 echo "The latest backup is in /backup/$zipfile"

Now navigate to https://www.playfulexploration.com/backup and download the zip file.

Cost Structure

Product Cost Detail
Virtual Private Server $6.99 / month OVH
  • 1 vCore 2.4 GHz
  • 4 GB RAM
  • 20 GB SSD Local RAID 10
  • 1 static IP, all ports open
  • 100 Mbps Bandwidth
  • Control Panel
> Virtual Private Server $13.49 / month OVH
  • 2 vCore 2.4 GHz
  • 8 GB RAM
  • 40 GB SSD Local RAID 10
  • 1 static IP, all ports open
  • 100 Mbps Bandwidth
  • Control Panel
> .COM Domain Name $12 / year Google
  • domain privacy
  • full control over all DNS records
  • awesome control panel
> Software $0 all open source :]

After the VPS upgrade the RAM automatically increased but the disk size needed manual fixing requiring two steps (source):

  • Increase the partition to use the extra sectors added:
fdisk /dev/vda
> u
> p
(this will print all of the partitions, we will refer to the data later)
> d 1
(this will display "Selected partition 1" and delete the first partition)
> n
(select "p" for primary partition)
(partition number should be 1, but make sure it matches the number displayed in print command)
(first sector should be 2048, but make sure it matches the "Start" column displayed in print command)
(and set last sector to the default value)
> a
(type "1" to make new first partition bootable)
> w
(this will write the new partitions and exit fdisk)
shutdown -r 0
  • Increase the filesystem size to use the extra partition space that's now available:
(connect to VM after it reboots, if it has resized partition but not filesystem then run resize2fs)

Bash commands

Install a new extnsion (replace the *tar.gz path):

docker exec -it playfulexploration_wiki bash
curl https://extdist.wmflabs.org/dist/extensions/VisualEditor-REL1_31-6f55941.tar.gz | tar -xz -C /var/www/html/extensions
chown -R www-data:www-data /var/www/html/extensions


Free disk space by trimming log file archives:

find /var/log/* -name *.gz -type f -mtime +100 -exec rm {} \;

Free disk space by dropping caches:

free && sync && echo 3 > /proc/sys/vm/drop_caches && free

See also: http://askubuntu.com/questions/5980/how-do-i-free-up-disk-space

Alternatives