# Purple Tree Wiki This wiki, Purple Tree Wiki, is written in Php. Aside from Parsedown, hightlight.js and MathJax, it is approximately 1000 lines of code. To install on a local Ubuntu machine, as root: ```bash apt-get install apache2 libapache2-mod-php a2enmod rewrite systemctl restart apache2 ``` You can skip much of this if you are installing in `/var/www/html`, just make sure to `chown www-data.www-data /var/www/html` so that the wiki can create files there. So as root ```bash cd /var/www/html tar xvaf ptwiki.tar.gz mkdir pages versions images chown -R www-data.www-data /var/www/html ``` then edit the `.htaccess` file to ensure it has the correct `RewriteBase`. And then you're good to go. ```plaintext RewriteEngine On RewriteBase /os/linux/ # <-------- THIS LINE NEEDS TO POINT TO WHEREVER YOUR WIKI IS RewriteRule ^/?$ wiki.php [L] RewriteRule ^(Index|Recent)$ wiki.php?word=$1 [L] RewriteCond %{QUERY_STRING} ^$ RewriteRule ^([A-Z][a-zA-Z0-9]*[A-Z][a-zA-Z0-9]*)$ wiki.php?word=$1 [L] RewriteRule ^([A-Z][a-zA-Z0-9]*[A-Z][a-zA-Z0-9]*)$ wiki.php?word=$1&%{QUERY_STRING} [L] ``` Now you can stick a PurpleTreeWikiV1 anywhere you like, for example I have one installed at `$WEBROOT/lang/php` for this wiki. PurpleTreeWikiv2 will have a single index.php you stick in the root of your site and it does all the wikis in one go. But that is a work in progress. ## Virtual host I've installed one on my local network under the name pt1, which means in your hosts file, you want ```plaintext 192.168.4.56 pt1 ``` for example (that Ip address is made up, of course). You then need to make a directory for the pt1 site, e.g. `/var/www/pt1`. Then create a