This Server: Difference between revisions
Jump to navigation
Jump to search
| (16 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
[[category:r2a2]] | [[category:r2a2]] | ||
== Installed Components == | |||
Click this link to get a SSL report of this server: https://www.ssllabs.com/ssltest/analyze.html?d=playfulexploration.com . | |||
<uml> | <uml> | ||
cloud WEB { | cloud WEB { | ||
| Line 22: | Line 14: | ||
component [Tomcat Server\nport: 8888] as [Tomcat] | component [Tomcat Server\nport: 8888] as [Tomcat] | ||
component [NodeJS\nport: 8080] as [NodeJS] | component [NodeJS\nport: 8080] as [NodeJS] | ||
component [Grafana\nport:3000] as [Grafana] <<Charts>> [[/wiki/?title=Install/Grafana]] | |||
package "Email" { | package "Email" { | ||
component [Postfix\nports: 25, 587, 993] as [Postfix] <<mail transfer agent>> | component [Postfix\nports: 25, 587, 993] as [Postfix] <<mail transfer agent>> | ||
| Line 29: | Line 23: | ||
} | } | ||
package "IOT" { | package "IOT" { | ||
component [Mosquitto\nport: 1883] as [Mosquitto] <<MQTT Broker>> | component [Mosquitto\nport: 1883 mqtt\nport: 8883 mqtt secure\nport: 9001 wss] as [Mosquitto] <<MQTT Broker>> [[/wiki/?title=Install/Mosquitto_Mqtt_Broker]] | ||
component [InfluxDB\nport:] as [InfluxDB] <<Time Series DB>> [[/wiki/?title=Install/InfluxDB]] | |||
} | } | ||
| Line 41: | Line 36: | ||
[Nginx] .. [MySQL] | [Nginx] .. [MySQL] | ||
[Nginx] .. [NodeJS] | [Nginx] .. [NodeJS] | ||
[Nginx] .. [Grafana] | |||
[Eth0] .. [Postfix] : smtp\nimap | [Eth0] .. [Postfix] : smtp\nimap | ||
| Line 53: | Line 49: | ||
[MySQL] .. MediaWiki_DB | [MySQL] .. MediaWiki_DB | ||
[Eth0] .. [Mosquitto] : mqtt | [Eth0] .. [Mosquitto] : mqtt\nwss | ||
[Eth0] .. [InfluxDB] : rest | |||
} | } | ||
WEB -- [Eth0] | WEB -- [Eth0] | ||
| Line 98: | Line 95: | ||
rsync -av --relative /var/www/html/wiki/LocalSettings.php /var/www/html/wiki/extensions/ /var/www/html/wiki/htmlets/ /backup/mediawiki/ | 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 | # export the wikimedia database | ||
mysqldump - | mysqldump -uroot --single-transaction --databases mediawiki >/backup/mediawiki/wiki_mysql_database.sql | ||
# zip it | # zip it | ||
zipfile="mediawiki_$(date +'%Y%m%d-%H%M%S').zip" | zipfile="mediawiki_$(date +'%Y%m%d-%H%M%S').zip" | ||
| Line 109: | Line 106: | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
! Product !! Cost !! Detail | ! !! Product !! Cost !! Detail | ||
|- | |- | ||
| Virtual Private Server || $6.99 / month || [https://www.ovh.com/us/vps/vps-ssd.xml OVH] | | || Virtual Private Server || $6.99 / month || [https://www.ovh.com/us/vps/vps-ssd.xml OVH] | ||
* 1 vCore 2.4 GHz | * 1 vCore 2.4 GHz | ||
* 4 GB RAM | * 4 GB RAM | ||
* 20 GB SSD Local RAID 10 | * 20 GB SSD Local RAID 10 | ||
* 1 static IP, all ports open | * 1 static IP, all ports open | ||
* 100 Mbps Bandwidth | |||
* Control Panel | * Control Panel | ||
|- | |- | ||
| Virtual Private Server || $13.49 / month || [https://www.ovh.com/us/vps/vps-ssd.xml OVH] | | > || Virtual Private Server || $13.49 / month || [https://www.ovh.com/us/vps/vps-ssd.xml OVH] | ||
* 2 vCore 2.4 GHz | * 2 vCore 2.4 GHz | ||
* 8 GB RAM | * 8 GB RAM | ||
* 40 GB SSD Local RAID 10 | * 40 GB SSD Local RAID 10 | ||
* 1 static IP, all ports open | * 1 static IP, all ports open | ||
* Control Panel | * 100 Mbps Bandwidth | ||
* Control Panel | |||
|- | |- | ||
| .COM Domain Name || $12 / year || [https://domains.google.com/registrar Google] | | > || .COM Domain Name || $12 / year || [https://domains.google.com/registrar Google] | ||
* domain privacy | * domain privacy | ||
* full control over all DNS records | * full control over all DNS records | ||
* awesome control panel | * awesome control panel | ||
|- | |- | ||
| Software || $0 || all open source :] | | > || Software || $0 || all open source :] | ||
|} | |} | ||
| Line 153: | Line 152: | ||
* Increase the filesystem size to use the extra partition space that's now available: | * 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) | (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): | |||
<syntaxhighlight lang=bash> | |||
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 | |||
</syntaxhighlight> | |||
Free disk space by trimming log file archives: | |||
<syntaxhighlight lang=bash> | |||
find /var/log/* -name *.gz -type f -mtime +100 -exec rm {} \; | |||
</syntaxhighlight> | |||
Free disk space by dropping caches: | |||
<syntaxhighlight lang=bash> | |||
free && sync && echo 3 > /proc/sys/vm/drop_caches && free | |||
</syntaxhighlight> | |||
See also: http://askubuntu.com/questions/5980/how-do-i-free-up-disk-space | |||
== Alternatives == | == Alternatives == | ||
* [https://www.kimsufi.com/us/en/ kimsufi dedicated server] | * [https://www.kimsufi.com/us/en/ kimsufi dedicated server] | ||
Latest revision as of 00:07, 1 November 2018
Installed Components
Click this link to get a SSL report of this server: https://www.ssllabs.com/ssltest/analyze.html?d=playfulexploration.com .
Backup strategy
Postulates
- More important than having a very fancy backup mechanism is to have some backup mechanism
States and Status
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
| |
| > | Virtual Private Server | $13.49 / month | OVH
|
| > | .COM Domain Name | $12 / year | Google
|
| > | 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