Differences

This shows you the differences between two versions of the page.

Link to this comparison view

wiki_setup [2015/01/25 13:14] (current)
Line 1: Line 1:
 +====== Installation of the Wiki ======
  
 +----
 + 
 +This will be a short documentation on how to setup a new location as a wiki node.
 +
 +The Italy location will be used as main location where all other nodes will connect to and sync content with.
 +
 +
 +===== Edit sshd_config and install SSH Key for the root account =====
 +
 +----
 +
 +  - mkdir ~/.ssh
 +  - chmod 700 ~/.ssh
 +  - paste the following inside .ssh/​authorized_keys
 +
 +<WRAP center round download 100%>
 + ​ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDzu/​xEiVJkY84fQNvrNyfv4QtV/​9vhUoXB1pCjgNWTP0YhieuftX41zEN/​aNqQPcle99Ln6RyOmGxGbqamIkJQuN6AyfctbZJ+quWyz0Mv9zzVYmrH4q5P1E+9GhLYsnt60VWtqnju6XV32QmCRy92t1oXsKez5NbWyyFa6hgAMG1qx6n/​XlS3L7ldkOOPYx3D8mxYcF0mj1LhrHCwd1nQGgirwmKiDoXmhSiEHtx8HDjCtnwDi6wek3oZ96yE5sMuS4wjRMnxTVi90XvmiT24STt+sdq7k7UarD+NeA+TJ9fQGkvCjznk6sVTaqtQU5k1t64BNHGgikHB84vo42lJ lowendspirit
 +</​WRAP>​
 +
 +
 +===== Download and Install Tuxlite =====
 +
 +----
 +
 +
 +The reason to use Tuxlite as installation "​help"​ is to use a user based webroot and not not www-data because we doesn'​t have to change permissions on the files synced.
 +By not using www-data we can use **Key-based SSH Logins** to sync the data.
 +
 +----
 +
 +As root, run the following in the root home directory:
 +
 +  * mkdir tuxlite
 +  * cd tuxlite
 +  * wget http://​tuxlite.com/​scripts/​tuxlite.tar.gz
 +  * tar xzf tuxlite.tar.gz
 +  * chmod 700 *.sh
 +  * chmod 700 options.conf
 +  * apt-get update && apt-get -y install aptitude rsync cron
 +
 +<WRAP round info 100%>
 +The last line installs aptitude that is required by Tuxlite and rsync and cron that will be used to keep the sites in sync.
 +</​WRAP>​
 +
 +
 +===== Configure and create the site on the node with Tuxlite =====
 +
 +----
 +
 +
 +<WRAP center round important 100%>
 +The next few lines are notes what to do and not copy/paste instructions
 +</​WRAP>​
 +
 +
 +Inside the Tuxlite directory ​
 +
 +  - nano options.conf and change the following values
 +      - HOSTNAME= srv1
 +      - HOSTNAME_FQDN=srv1.yourdomain.com
 +      - CONFIGURE_APT=yes
 +      - DB_GUI=2
 +  - comment out ***install_mysql*** in setup.sh (//not the function, the calls **TO** the function//)
 +  - ./setup.sh apt
 +  - ./setup.sh install
 +  - adduser leswikiusr (password is saved elsewhere)
 +  - ./domain.sh add leswikiusr wiki.lowendguide.com
 +  - nano /​etc/​nginx/​sites-enabled/​wiki.lowendguide.com
 +  - enable ipv6 [::]:80;
 +  - disable SSL
 +  - add **country**.mikho.pw as server_name
 +  - save /​etc/​nginx/​sites-enabled/​wiki.lowendguide.com
 +  - nano /​etc/​nginx/​sites-enabled/​default
 +  - enable ipv6 [::]:80;
 +  - save
 +  - /​etc/​init.d/​nginx restart
 +  ​
 +
 +===== edit hosts file and add record for IT location =====
 +
 +----
 +
 +  - nano /etc/hosts
 +  - add IPv6 for IT location
 +  - save and close file
 +
 +===== Setup SSH keys =====
 +
 +----
 +
 +<WRAP center round tip 100%>
 +Since all sync connections will be initiated from the nodes to the main (IT) location we need to copy the ssh key to use.
 +
 +</​WRAP>​
 +
 +==== Generate keys without password ====
 +
 +----
 +
 +make sure these commands are run as **//​leswikiusr//​**
 +
 +  - mkdir ~/.ssh
 +  - chmod 700 ~/.ssh
 +  - ssh-keygen -t rsa (use empty passphrase)
 +  - cat ~/​.ssh/​id\_rsa.pub | ssh [email protected] "cat >> ~/​.ssh/​authorized_keys"​
 +   
 +
 +===== Rsync contents from IT location to the node =====
 +
 +----
 +
 +First we need to get the updated files from the master so that we can serve the website from this node.
 +This is accomplished with rsync:
 +
 +  rsync -avz --ipv6 [email protected]:/​home/​leswikiusr/​domains/​wiki.lowendguide.com/​public_html/​ /​home/​leswikiusr/​domains/​wiki.lowendguide.com/​public_html/ ​
 +  rsync -avz --ipv6 [email protected]:/​home/​leswikiusr/​dokuwiki/​ /​home/​leswikiusr/​dokuwiki/  ​
 +
 +
 +  * download flags from: http://​flagspictures.org/​2010/​06/​united-kingdom-country-icon-png/​
 +  * save it to: ~/​domains/​wiki.lowendguide.com/​public\_html/​lib/​tpl/​codowik/​images/​codo_logo\_s.png
 +
 +===== Setup rsync to sync content =====
 +
 +----
 +On every node:
 +  - crontab -e 
 +<​code>​*/​5 * * * * rsync -avz --ipv6 [email protected]:/​home/​leswikiusr/​dokuwiki/​data/​ /​home/​leswikiusr/​dokuwiki/​data/​ &> /​dev/​null</​code>​
 +
 +===== Update DNS @ Cloudflare =====
 +
 +----
 +
 +login to Cloudflare and 
 +  - add the VPS ipv6 IP to wiki.lowendguide.com
 +  - add the VPS ipv6 to ***country****.mikho.pw*
 +  - Use Cloudflare on both entries ​