From 53bd927e5ea4286d90cbb4ccc6da694d586f0782 Mon Sep 17 00:00:00 2001 From: Gustav Eek Date: Fri, 4 Oct 2019 10:22:57 +0200 Subject: [create-a-wiki] Move old descriptions Drop the guide *wiki-preview.mdwn*. The content is now fully covered and updated in *create-a-wiki-preview.mdwn* and *create-a-wiki/additional.mdwn*. Also move the dated *create-a-wiki.mdwn* -> *create-a-wiki/create-a-wiki.mdwn*. Closing that content needs more attention. --- create-a-wiki.mdwn | 187 --------------------------------------- create-a-wiki/create-a-wiki.mdwn | 187 +++++++++++++++++++++++++++++++++++++++ wiki-preview.mdwn | 99 --------------------- 3 files changed, 187 insertions(+), 286 deletions(-) delete mode 100644 create-a-wiki.mdwn create mode 100644 create-a-wiki/create-a-wiki.mdwn delete mode 100644 wiki-preview.mdwn diff --git a/create-a-wiki.mdwn b/create-a-wiki.mdwn deleted file mode 100644 index b6736f1..0000000 --- a/create-a-wiki.mdwn +++ /dev/null @@ -1,187 +0,0 @@ -This article describes mine (the author's, also known as Gustav) -attempts to configure an Ikiwiki lab environment on my laptop -computer. The purpose of the experiment is to learn how Ikiwiki -functions and how to effectively work with Ikiwiki and offline editing -with git. - -The components needed are - - * Ikiwiki - * Apache2 or Nginx web server - * Git - -**Table of Contents** -[[!toc]] - -What I have in mind is to access my lab wiki through -`http://localhost/~/lab-wiki` for web editing and -`~/lab-wiki/wiki-slave` for local offline editing. - -It should be noted that what is described here probably is a perfectly -_unsafe_ usage of a web server. Make sure that the computer does not -except requests from Internet. - - -Install and configure Git -========================= - -I can not recall how this was done. Refer to -[Git's official website](https://git-scm.com/) - - -Install and configure Ikiwiki -============================= - -Refer to [ikiwiki setup](https://ikiwiki.info/setup/) at -[ikiwiki's official website](https://ikiwiki.info) for initial -install and configuration and -[an article on Git](https://ikiwiki.info/rcs/git/) for more details on -setting up Ikiwiki together with Git. - -Install packages referred to in the ansible configuration: - - sudo aptitude install \ - ikiwiki \ - libauthen-passphrase-perl \ - highlight-common libhighlight-perl libimage-magick-perl \ - libmail-sendmail-perl libnet-dns-sec-perl \ - fcgiwrap spawn-fcgi \ - pandoc - -I did my best to answer the questions provided in the initial -installation and default configuration with the target of ending up -with something like this: - - url: http://localhost/~/lab-wiki - srcdir: ~/lab-wiki/wiki - destdir: ~/public_html/lab-wiki - repository: ~/lab-wiki/wiki.git - settings: ~/lab-wiki/wiki.setup - -However, not all of the above was configurable in the form, for -example the configuration file location. I needed to move directories -and files around and change the remaining configurations in -`~/lab-wiki/wiki.setup` and run - - $ ikiwiki --setup ~/lab-wiki/wiki.setup - -I also created the extra Git repository `wiki-slave` for local edits: - - $ cd ~/lab-wiki; git clone wiki.git wiki-slave - -The connectivity chart is now as follows - - Bare Git Repository - ~/lab-wiki/wiki.git - / \ - / \ - / \ - The Ikiwiki Repository | - ~/lab-wiki/wiki | - | | - | Repository for Local Edits - | ~/lab-wiki/wiki-slave - | | - The Ikiwiki Web Part | - ~/public_html/lab-wiki | - | - The Preview Ikiwiki Web Part - ~/public_html/lab-wiki-preview - - -Install and configure Apache 2 -============================== - -For installation, follow the instructions in -[Apache's official documentation](https://httpd.apache.org/docs). I -got Apache 2.4.6 installed. - -I needed to activate the userdir module. Refer to -[Per-user web directories](https://httpd.apache.org/docs/2.4/howto/public_html.html) -in Apache's documentation. For Debian do the following - - $ cd /etc/apache2/mods-enabled - $ ln -s ln -s ../mods-available/userdir.load - $ ln -s ln -s ../mods-available/userdir.conf - -Also CGI execution need to be activated. See -[Dynamic Content with CGI](https://httpd.apache.org/docs/2.4/howto/cgi.html) -in Apache's documentation. My -`/etc/apache2/mods-available/userdir.conf` now looks as follows - - - UserDir public_html - UserDir /home/*/public_html - UserDir disabled root - - - AllowOverride FileInfo AuthConfig Limit Indexes - Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec - - Require all granted - - - Require all denied - - - - - Options +ExecCGI - AddHandler cgi-script .cgi - - - Options +ExecCGI - AddHandler cgi-script .cgi - - - - -Install and conifgure Nginx -=========================== - -A valid web server alternative -is -[Nginx](http://nginx.org/en/docs/). - -For installation and configuration -follow [Ikiwiki on Dot CGI](https://ikiwiki.info/tips/dot_cgi/). `sudo -aptitude install nginx`. Note the alexjj comment that on -Debian the package *fcgiwrap* automatically spwans the FastCGI -program. - - - -Get preview of local modifications -================================== - -Now every thing works as work as expected. I can fetch the latest -updated to `wiki-slave`, perform my updates, and whenever those are -pushed to `origin/master`, the post-update hook makes sure that the -web version is updated. - -But what if I want to inspect and verify my local changes before -pushing them to `origin/master`? - -The subject is covered in -[the article on Git](https://ikiwiki.info/rcs/git/). I did what -follows. Copy `wiki.setup` to `wiki-preview.setup` and edit those -fields: - - wikiname: lab-wiki-preview - srcdir: ~/lab-wiki/wiki-slave - destdir: ~/public_html/lab-wiki-preview - url: http://skolem/~/lab-wiki-preview - cgiurl: http://skolem/~/lab-wiki-preview/ikiwiki.cgi - cgi_wrapper: ~/public_html/lab-wiki-preview/ikiwiki.cgi - git_wrapper: ~/lab-wiki/wiki-slave/.git/hooks/post-commit - gitorigin_branch: '' - gitmaster_branch: master - -The idea is that the preview wiki works against `wiki-slave`, which is -my simulated environment for local repository. What always works now -is to, at any point, recompile/refresh the wiki: - - ikiwiki -setup ~/lab-wiki/wiki-preview.setup -refresh - -Also, committing on the local `master` branch _should_ automatically -update the `lab-wiki-preview` wiki. diff --git a/create-a-wiki/create-a-wiki.mdwn b/create-a-wiki/create-a-wiki.mdwn new file mode 100644 index 0000000..b6736f1 --- /dev/null +++ b/create-a-wiki/create-a-wiki.mdwn @@ -0,0 +1,187 @@ +This article describes mine (the author's, also known as Gustav) +attempts to configure an Ikiwiki lab environment on my laptop +computer. The purpose of the experiment is to learn how Ikiwiki +functions and how to effectively work with Ikiwiki and offline editing +with git. + +The components needed are + + * Ikiwiki + * Apache2 or Nginx web server + * Git + +**Table of Contents** +[[!toc]] + +What I have in mind is to access my lab wiki through +`http://localhost/~/lab-wiki` for web editing and +`~/lab-wiki/wiki-slave` for local offline editing. + +It should be noted that what is described here probably is a perfectly +_unsafe_ usage of a web server. Make sure that the computer does not +except requests from Internet. + + +Install and configure Git +========================= + +I can not recall how this was done. Refer to +[Git's official website](https://git-scm.com/) + + +Install and configure Ikiwiki +============================= + +Refer to [ikiwiki setup](https://ikiwiki.info/setup/) at +[ikiwiki's official website](https://ikiwiki.info) for initial +install and configuration and +[an article on Git](https://ikiwiki.info/rcs/git/) for more details on +setting up Ikiwiki together with Git. + +Install packages referred to in the ansible configuration: + + sudo aptitude install \ + ikiwiki \ + libauthen-passphrase-perl \ + highlight-common libhighlight-perl libimage-magick-perl \ + libmail-sendmail-perl libnet-dns-sec-perl \ + fcgiwrap spawn-fcgi \ + pandoc + +I did my best to answer the questions provided in the initial +installation and default configuration with the target of ending up +with something like this: + + url: http://localhost/~/lab-wiki + srcdir: ~/lab-wiki/wiki + destdir: ~/public_html/lab-wiki + repository: ~/lab-wiki/wiki.git + settings: ~/lab-wiki/wiki.setup + +However, not all of the above was configurable in the form, for +example the configuration file location. I needed to move directories +and files around and change the remaining configurations in +`~/lab-wiki/wiki.setup` and run + + $ ikiwiki --setup ~/lab-wiki/wiki.setup + +I also created the extra Git repository `wiki-slave` for local edits: + + $ cd ~/lab-wiki; git clone wiki.git wiki-slave + +The connectivity chart is now as follows + + Bare Git Repository + ~/lab-wiki/wiki.git + / \ + / \ + / \ + The Ikiwiki Repository | + ~/lab-wiki/wiki | + | | + | Repository for Local Edits + | ~/lab-wiki/wiki-slave + | | + The Ikiwiki Web Part | + ~/public_html/lab-wiki | + | + The Preview Ikiwiki Web Part + ~/public_html/lab-wiki-preview + + +Install and configure Apache 2 +============================== + +For installation, follow the instructions in +[Apache's official documentation](https://httpd.apache.org/docs). I +got Apache 2.4.6 installed. + +I needed to activate the userdir module. Refer to +[Per-user web directories](https://httpd.apache.org/docs/2.4/howto/public_html.html) +in Apache's documentation. For Debian do the following + + $ cd /etc/apache2/mods-enabled + $ ln -s ln -s ../mods-available/userdir.load + $ ln -s ln -s ../mods-available/userdir.conf + +Also CGI execution need to be activated. See +[Dynamic Content with CGI](https://httpd.apache.org/docs/2.4/howto/cgi.html) +in Apache's documentation. My +`/etc/apache2/mods-available/userdir.conf` now looks as follows + + + UserDir public_html + UserDir /home/*/public_html + UserDir disabled root + + + AllowOverride FileInfo AuthConfig Limit Indexes + Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec + + Require all granted + + + Require all denied + + + + + Options +ExecCGI + AddHandler cgi-script .cgi + + + Options +ExecCGI + AddHandler cgi-script .cgi + + + + +Install and conifgure Nginx +=========================== + +A valid web server alternative +is +[Nginx](http://nginx.org/en/docs/). + +For installation and configuration +follow [Ikiwiki on Dot CGI](https://ikiwiki.info/tips/dot_cgi/). `sudo +aptitude install nginx`. Note the alexjj comment that on +Debian the package *fcgiwrap* automatically spwans the FastCGI +program. + + + +Get preview of local modifications +================================== + +Now every thing works as work as expected. I can fetch the latest +updated to `wiki-slave`, perform my updates, and whenever those are +pushed to `origin/master`, the post-update hook makes sure that the +web version is updated. + +But what if I want to inspect and verify my local changes before +pushing them to `origin/master`? + +The subject is covered in +[the article on Git](https://ikiwiki.info/rcs/git/). I did what +follows. Copy `wiki.setup` to `wiki-preview.setup` and edit those +fields: + + wikiname: lab-wiki-preview + srcdir: ~/lab-wiki/wiki-slave + destdir: ~/public_html/lab-wiki-preview + url: http://skolem/~/lab-wiki-preview + cgiurl: http://skolem/~/lab-wiki-preview/ikiwiki.cgi + cgi_wrapper: ~/public_html/lab-wiki-preview/ikiwiki.cgi + git_wrapper: ~/lab-wiki/wiki-slave/.git/hooks/post-commit + gitorigin_branch: '' + gitmaster_branch: master + +The idea is that the preview wiki works against `wiki-slave`, which is +my simulated environment for local repository. What always works now +is to, at any point, recompile/refresh the wiki: + + ikiwiki -setup ~/lab-wiki/wiki-preview.setup -refresh + +Also, committing on the local `master` branch _should_ automatically +update the `lab-wiki-preview` wiki. diff --git a/wiki-preview.mdwn b/wiki-preview.mdwn deleted file mode 100644 index 71cf7d1..0000000 --- a/wiki-preview.mdwn +++ /dev/null @@ -1,99 +0,0 @@ -Taking the [Create a Wiki](/create-a-wiki) article as a starting point, this article describes how to set up preview of Friposts wiki. - -The basic idea is something like the following: - - . Bare Git Repository - . git.fripost.org:fripost-wiki.git - . | - . | - . Repository for Local Edits - . ~/git/fripost/wiki - . | - . | - . The Preview Ikiwiki Web Part - . ~/public_html/fripost-wiki-preview - -Where *~/git/fripost/wiki* is a local git repository with remote -tracking of the main bare wiki repository -*git.fripost.org:fripost-wiki.git*. I define an alias command for -recompilation of the local version of the. The local preview version is accessed -by pointing the browser to -*http\://localhost/~/fripost-wiki-preview/*. - -First the basics. According to [Create a Wiki](/create-a-wiki) do the following: - -* Install and configure Git -* Install and configure Apache 2 -* Install Ikiwiki - -For the Ikiwiki configuration question, answer them as follows - - wikiname: fripost-wiki-preview - url: http://localhost/~/lab-wiki - srcdir: ~/git/fripost/wiki - destdir: ~/public_html/fripost-wiki-preview - settings: ~/public_html/fripost-wiki-preview/wiki.setup - -Where ** is the local user name and *~/git/fripost/wiki* is where the local wiki Git repository. This will generate a configuration file: *~/public_html/fripost-wiki-preview/wiki.setup*. Generate the first issue: - - $ ikiwiki --setup ~/public_html/fripost-wiki-preview/wiki.setup - -For to preview local edits, run: - - $ ikiwiki --setup ~/public_html/fripost-wiki-preview/wiki.setup --refresh - -and point your browser to *http\://localhost/~/fripost-wiki-preview/*. - -You can also create an alias for to refresh the preview command. - - $ alias fripost-wiki-preview-refresh='ikiwiki -setup /home/gustav/lab-wiki/fripost-wiki.setup -refresh' - - -Public www locations (userdir) ------------------- - -For to be able to access `http://localhost/~user` the "userdir" -functionality is needed. For Nginx, put the following in e.g. -*/etc/nginx/sites-available/localhost*: - -``` -server { - location ~ ^/~(.+?)(/.*)?$ { - alias /home/$1/public_html$2; - index index.html index.htm - autoindex on; - } -} -``` - -Relative paths --------------- - -Many links on the Fripost wiki are absolute. That means that you -sometimes will not be able to follow homepage page and wiki page links -between your local preview wiki. For testing purposes, that can -sometimes be necessary. The best strategy is to edit your */etc/hosts* -table and make *fripost.org* and *wiki.fripost.org* point to -*localhost*. Of course your web server need to be configured to serve -those pages. This is my Nginx configuration: - - # fripost.org - server { - server_name fripost.org; - location / { - root /home/gustav/public_html/fripost-wiki/website; - location /static { root /home/gustav/public_html/fripost-wiki; } - } - } - - # wiki.fripost.org - server { - server_name wiki.fripost.org; - location / { - root /home/gustav/public_html/fripost-wiki; - } - } - -You might experience strange effects from that the web-browser has -cached DNS information. Search Internet for how to flush your -browser's DNS cache. -- cgit v1.2.3