Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
wiki:setup [2016/10/31 13:17]
chrisshroba [9. Automatically back up your Wiki]
wiki:setup [2016/12/15 07:36] (current)
Line 3: Line 3:
 Yay, I've convinced someone to create their own personal wiki!  The process is fairly straightforward. If you encounter any difficulty, feel free to reach out by twitter ([[https://​twitter.com/​chrisshroba|@chrisshroba]]) or email (chrisshroba at gmail). Yay, I've convinced someone to create their own personal wiki!  The process is fairly straightforward. If you encounter any difficulty, feel free to reach out by twitter ([[https://​twitter.com/​chrisshroba|@chrisshroba]]) or email (chrisshroba at gmail).
  
-###1. Get a server to host the wiki on.+##1. Get a server to host the wiki on.
  
 I use [[https://​m.do.co/​c/​14c2961d20a7|Digital Ocean]] (Disclaimer:​ sign up with that link and you get $10, I get $25).  It gives you full SSH access to a server on which you can install and run anything you'd like.  I use it for my wiki, blog, file server, and to host small side projects. ​ I pay $5/month for my server (the cheapest you can buy from them, and you probably won't find one elsewhere for cheaper), and I think $60/year is more than reasonable for everything I'm getting out of my server. Go ahead and sign up and create a server (or droplet, as they call it - one droplet in the vast digital ocean, so to speak!). I use [[https://​m.do.co/​c/​14c2961d20a7|Digital Ocean]] (Disclaimer:​ sign up with that link and you get $10, I get $25).  It gives you full SSH access to a server on which you can install and run anything you'd like.  I use it for my wiki, blog, file server, and to host small side projects. ​ I pay $5/month for my server (the cheapest you can buy from them, and you probably won't find one elsewhere for cheaper), and I think $60/year is more than reasonable for everything I'm getting out of my server. Go ahead and sign up and create a server (or droplet, as they call it - one droplet in the vast digital ocean, so to speak!).
Line 9: Line 9:
 If you'd rather, you can also use a website hosting provider instead, as long as it supports PHP.  I have no experience with this route, but I would check out Namecheap, Bluehost, or Dreamhost if you want to go this route. ​ If you do this, you will _not_ have full root SSH access to the server, but you should have everything you need to host the wiki.  If you go this route, I would just Google for a tutorial for installing Dokuwiki on your chosen host.  The rest of this tutorial assumes you're using Digital Ocean. If you'd rather, you can also use a website hosting provider instead, as long as it supports PHP.  I have no experience with this route, but I would check out Namecheap, Bluehost, or Dreamhost if you want to go this route. ​ If you do this, you will _not_ have full root SSH access to the server, but you should have everything you need to host the wiki.  If you go this route, I would just Google for a tutorial for installing Dokuwiki on your chosen host.  The rest of this tutorial assumes you're using Digital Ocean.
  
-###2. Install a web server and Dokuwiki+##2. Install a web server and Dokuwiki
  
 Once you've created your first server and ssh'ed into it, you need to install a web server. ​ The web server is the software that handles all incoming requests to your server and passes them off to dokuwiki. ​ If you use your server for things besides the wiki, the web server actually routes all requests to where they need to go. For example, on my site, it routes [[wiki.shroba.io]] to my wiki, [[blog.shroba.io]] to my blog, and [[drop.shroba.io]] to my basic file server. Once you've created your first server and ssh'ed into it, you need to install a web server. ​ The web server is the software that handles all incoming requests to your server and passes them off to dokuwiki. ​ If you use your server for things besides the wiki, the web server actually routes all requests to where they need to go. For example, on my site, it routes [[wiki.shroba.io]] to my wiki, [[blog.shroba.io]] to my blog, and [[drop.shroba.io]] to my basic file server.
Line 17: Line 17:
 Follow the tutorial and then return here!  When they mention `server_domain_or_IP_address`,​ just put in the IP address of your server if you don't already have a domain name linked up to it.  We will set up a domain name later, but a domain name can take up to 24 hours to be registered with the DNS servers around the world (though I've found it's usually closer to an hour), so we will skip that for now. Follow the tutorial and then return here!  When they mention `server_domain_or_IP_address`,​ just put in the IP address of your server if you don't already have a domain name linked up to it.  We will set up a domain name later, but a domain name can take up to 24 hours to be registered with the DNS servers around the world (though I've found it's usually closer to an hour), so we will skip that for now.
  
-###3. Try out your wiki!+##3. Try out your wiki!
  
 Try creating and editing some pages. Congratulations! You have a working wiki! Try creating and editing some pages. Congratulations! You have a working wiki!
  
-###4. Enable Pretty URLs+##4. Enable Pretty URLs
  
 The URL of your wiki is currently pretty ugly... something like `http://​107.170.38.184/​wiki/​doku.php?​id=page`. ​ First we'll change the part of the URL after the IP address. ​ There'​s a tutorial on [[https://​www.dokuwiki.org/​rewrite|Dokuwiki'​s site here]] - you'll want to follow the directions under **Option 1** for **Nginx**. ​ When I did this, I had some difficulties,​ so if things don't work out for you, you can copy the dokuwiki setup from [[https://​gist.github.com/​chrisshroba/​4a462fe7167b8d10449b7a5b91fadc3e|my Nginx config file from here]], which is what's currently running on this site.  You'll want to change line 3 to have your IP address instead of `wiki.shroba.io w`, and I explain the `w` later on this page.  You can edit this later again when you have a domain name. The URL of your wiki is currently pretty ugly... something like `http://​107.170.38.184/​wiki/​doku.php?​id=page`. ​ First we'll change the part of the URL after the IP address. ​ There'​s a tutorial on [[https://​www.dokuwiki.org/​rewrite|Dokuwiki'​s site here]] - you'll want to follow the directions under **Option 1** for **Nginx**. ​ When I did this, I had some difficulties,​ so if things don't work out for you, you can copy the dokuwiki setup from [[https://​gist.github.com/​chrisshroba/​4a462fe7167b8d10449b7a5b91fadc3e|my Nginx config file from here]], which is what's currently running on this site.  You'll want to change line 3 to have your IP address instead of `wiki.shroba.io w`, and I explain the `w` later on this page.  You can edit this later again when you have a domain name.
Line 27: Line 27:
 After doing this, your wiki's pages' URLs should look a lot nicer: for example, _107.170.38.184/​todo_ instead of _107.170.38.184/​wiki/​doku.php?​page=todo_. After doing this, your wiki's pages' URLs should look a lot nicer: for example, _107.170.38.184/​todo_ instead of _107.170.38.184/​wiki/​doku.php?​page=todo_.
  
-###5. Register a domain name.+##5. Register a domain name.
  
 We might as well take a few minutes to buy a domain name.  Like many people I've talked to, I use [[https://​www.namecheap.com/​|Namecheap]] to buy my domains, but there are many other options as well.  Go ahead and search for a domain to buy and register it now.  You can then follow [[https://​www.digitalocean.com/​community/​tutorials/​how-to-point-to-digitalocean-nameservers-from-common-domain-registrars#​registrar-namecheap| this tutorial]] to point your domain at Digital Ocean'​s name servers, and [[https://​www.digitalocean.com/​community/​tutorials/​how-to-set-up-a-host-name-with-digitalocean|this tutorial]] to let Digital Ocean know what server to route requests to for your domain. ​ In the second tutorial, you can skip steps 1 and 2, as they are covered by the first tutorial. We might as well take a few minutes to buy a domain name.  Like many people I've talked to, I use [[https://​www.namecheap.com/​|Namecheap]] to buy my domains, but there are many other options as well.  Go ahead and search for a domain to buy and register it now.  You can then follow [[https://​www.digitalocean.com/​community/​tutorials/​how-to-point-to-digitalocean-nameservers-from-common-domain-registrars#​registrar-namecheap| this tutorial]] to point your domain at Digital Ocean'​s name servers, and [[https://​www.digitalocean.com/​community/​tutorials/​how-to-set-up-a-host-name-with-digitalocean|this tutorial]] to let Digital Ocean know what server to route requests to for your domain. ​ In the second tutorial, you can skip steps 1 and 2, as they are covered by the first tutorial.
Line 39: Line 39:
 Click to make the picture bigger. Also, note the period after the domain name in the CNAME record. Click to make the picture bigger. Also, note the period after the domain name in the CNAME record.
  
-###6. Set up a local alias to your wiki (optional)+##6. Set up a local alias to your wiki (optional)
  
 This step is optional, but _incredibly_ useful. I've configured my laptop to alias `w/` to `wiki.shroba.io/​`,​ so in my browser, I can replace `wiki.shroba.io` with just `w`, which makes navigating to pages extremely fast.  For example, my URL bar currently reads `w/​wiki/​setup`,​ which is less than half the number of characters as `wiki.shroba.io/​wiki/​setup`. This step is optional, but _incredibly_ useful. I've configured my laptop to alias `w/` to `wiki.shroba.io/​`,​ so in my browser, I can replace `wiki.shroba.io` with just `w`, which makes navigating to pages extremely fast.  For example, my URL bar currently reads `w/​wiki/​setup`,​ which is less than half the number of characters as `wiki.shroba.io/​wiki/​setup`.
Line 55: Line 55:
 %%*%%I have not confirmed this, but according to Google, the file is `c:​\Windows\System32\Drivers\etc\hosts` on Windows %%*%%I have not confirmed this, but according to Google, the file is `c:​\Windows\System32\Drivers\etc\hosts` on Windows
  
-###7. Install a theme+##7. Install a theme
  
 I didn't care for the default theme (aka template) of dokuwiki, and you've probably noticed your wiki looks different than mine.  You can browse templates [[https://​www.dokuwiki.org/​template|here]] and install them in the Extension Manager. ​ I use [[https://​www.dokuwiki.org/​template:​bootstrap3|Bootstrap3]]. I didn't care for the default theme (aka template) of dokuwiki, and you've probably noticed your wiki looks different than mine.  You can browse templates [[https://​www.dokuwiki.org/​template|here]] and install them in the Extension Manager. ​ I use [[https://​www.dokuwiki.org/​template:​bootstrap3|Bootstrap3]].
  
-###8. Install some Plugins+##8. Install some Plugins
  
 You can search and install plugins from the Extension Manager, or search and filter [[https://​www.dokuwiki.org/​plugins|here]]. ​ I have a list of plugins that I use [[wiki:​plugins|here]]. ​ I also recommend checking out my friend Ivan's plugin page [[https://​smirnov.wiki/​wiki/​plugins|here]]. You can search and install plugins from the Extension Manager, or search and filter [[https://​www.dokuwiki.org/​plugins|here]]. ​ I have a list of plugins that I use [[wiki:​plugins|here]]. ​ I also recommend checking out my friend Ivan's plugin page [[https://​smirnov.wiki/​wiki/​plugins|here]].
  
-###9. Automatically back up your Wiki+##9. Automatically back up your Wiki
  
 Think about how awful it would be to lose all of your data in the event your server crashed or you somehow accidentally deleted your data directory. You should definitely back up your wiki.  Mine backs up to GitHub within 2 minutes of any change. ​ This has the added benefit of giving me a complete history of every page in the wiki, in case I ever deleted a page accidentally or wanted to remember something that had previously been on it. Think about how awful it would be to lose all of your data in the event your server crashed or you somehow accidentally deleted your data directory. You should definitely back up your wiki.  Mine backs up to GitHub within 2 minutes of any change. ​ This has the added benefit of giving me a complete history of every page in the wiki, in case I ever deleted a page accidentally or wanted to remember something that had previously been on it.
Line 100: Line 100:
 Now make a change to some page on your wiki and check on Github to see if the page there is updated after the amount of time you chose. ​ You'll want to look in the `/pages` directory of you repository - this is where the raw text files of your wiki pages are stored. ​ Other directories contain things like search indices and media files. If you find yourself uploading many (or any) large media files to your wiki, you should only backup the `/pages` directory instead, as [[https://​help.github.com/​articles/​what-is-my-disk-quota/​|Github is mainly intended for backing up non-binary files]], and Github may yell at you or even remove your repository if it exceeds a certain size (around 1GB). Now make a change to some page on your wiki and check on Github to see if the page there is updated after the amount of time you chose. ​ You'll want to look in the `/pages` directory of you repository - this is where the raw text files of your wiki pages are stored. ​ Other directories contain things like search indices and media files. If you find yourself uploading many (or any) large media files to your wiki, you should only backup the `/pages` directory instead, as [[https://​help.github.com/​articles/​what-is-my-disk-quota/​|Github is mainly intended for backing up non-binary files]], and Github may yell at you or even remove your repository if it exceeds a certain size (around 1GB).
  
-###10. Enjoy your wiki!!+##10. Enjoy your wiki!!
  
 Congratulations! You've set up your wiki.  If you've made it this far, I'd love it if you let me know, so I know I didn't write this tutorial in vain! Congratulations! You've set up your wiki.  If you've made it this far, I'd love it if you let me know, so I know I didn't write this tutorial in vain!