summaryrefslogtreecommitdiffstats
path: root/create-a-wiki/additional.mdwn
blob: 3c912a8a8e432836841ee17256068844af0bdb97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
---
title: Additional considerations for a Fripost wiki preview
...

Here follows a few additional configuration considerations. These are
not mandatory for a naked preview setup. To follow instructions,
however, a setup according
to [Create a Fripost wiki preview](/create-a-wiki-preview) is
presumed.

[[!toc]]

Absolute 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:

```
cat /etc/nginx/sites-available/localhost.fripost.conf \
 | sed 's/\.localhost/\.org/g' \
 | sudo tee /etc/nginx/sites-available/org.fripost.conf
sudo ln -s -r -t /etc/nginx/sites-enabled/ /etc/nginx/sites-available/org.fripost.conf
sudo nginx -t && sudo systemctl restart nginx.service
```

Modify the */etc/hosts* file:

```
sed -n '/fripost.localhost/ {s/\.localhost/.org/g; p}' < /etc/hosts | sudo tee /tmp/hosts
grep -q wiki.fripost.org /etc/hosts \
  || sudo sed -i '/::1.*fripost.localhost/ r /tmp/hosts' /etc/hosts
```

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.


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;
  }
}
```

This is of limited use in the context of Fripost's wiki.