Blame
Date:
Mon Jan 23 05:00:25 2023 UTC
Message:
Daily backup
001
2023-01-22
jrmu
version=pmwiki-2.2.130 ordered=1 urlencoded=1
002
2023-01-22
jrmu
agent=Mozilla/5.0 (X11; OpenBSD amd64; rv:68.0) Gecko/20100101 Firefox/68.0 SeaMonkey/2.53.11.1
003
2023-01-22
jrmu
author=mkf
004
2023-01-22
jrmu
charset=UTF-8
005
2023-01-22
jrmu
csum=replace * with +, which means it needs more than one characters.
006
2023-01-22
jrmu
ctime=1627378629
007
2023-01-22
jrmu
host=91.185.139.136
008
2023-01-22
jrmu
name=Pmwiki.Install
009
2023-01-22
jrmu
rev=39
010
2023-01-22
jrmu
targets=Nsd.Configure,Nsd.Zone,Php.Install,Relayd.Acceleration,Openhttpd.Tls
011
2023-01-22
jrmu
text=(:title Install PmWiki:)%0a%0a!! Overview%0a%0a[[https://www.pmwiki.org|PmWiki]] is a simple and lightweight wiki that doesn't require a database. Instead, content for the wiki is stored in simple text files. Its only requirement is PHP, making it very simple to host with OpenBSD's openhttpd. It also does not require the user's browser to support javascript, which helps improve accessibility.%0a%0a!! Install%0a%0a[[https://www.pmwiki.org/wiki/PmWiki/Download|Download a copy]] of PmWiki. In this guide, we'll grab [[https://www.pmwiki.org/pub/pmwiki/pmwiki-latest.tgz|the latest stable release]].%0a%0a[@%0a$ ftp https://www.pmwiki.org/pub/pmwiki/pmwiki-latest.tgz%0a$ tar xvzf pmwiki-latest.tgz%0a$ doas mv pmwiki-2.2.141/ /var/www/htdocs/wiki.example.com%0a$ doas chown -R www:daemon /var/www/htdocs/wiki.example.com%0a@]%0a%0aMake sure to replace wiki.example.com with your actual domain name. For flexibility, we recommend you run your own nameserver using [[nsd/configure|nsd]] and [[nsd/zone|create a records]] for wiki.example.com.%0a%0a!! Configure OpenHTTPd%0a%0aBefore you begin, make sure you have [[php/install|PHP installed]].%0a%0aNext, add a new block to @@/etc/httpd.conf@@:%0a%0a[@%0aserver "wiki.example.com" {%0a listen on * port 80%0a root "/htdocs/wiki.example.com"%0a location "/.well-known/acme-challenge/*" {%0a root "/acme"%0a request strip 2%0a }%0a location "*.php" {%0a fastcgi socket "/run/php-fpm.sock"%0a }%0a directory {%0a index "index.php"%0a }%0a connection max request body 104857600%0a}%0a@]%0a%0aLines 7-8 above tell httpd to evaluate any file that ends with .php as a PHP script. Line 9 says that the document root for the web files is /htdocs/wiki.example.com. Keep in mind, however, that httpd automatically chroots to /var/www/, so the actual path will be /var/www/htdocs/wiki.example.com/.%0a%0aLine 11-13 tell httpd to automatically serve index.php as the default file when a directory is requested by the user. In other words, if a user requests @@https://wiki.example.com@@, he will actually receive @@https://wiki.example.com/index.php@@.%0a%0aLine 14 tells httpd that it can receive uploads as large as 100MB. By default, httpd is limited to only 1MB, so this setting is necessary if you want to allow large file uploads for your wiki.%0a%0aWhile not required, it helps to put in /var/www/htdocs/wiki.example.com/index.php:%0a%0a[@%0a%3c?php include('pmwiki.php');%0a@]%0a%0aThen give it proper permissions:%0a%0a[@%0a$ doas chown www:daemon /var/www/htdocs/wiki.example.com/index.php%0a@]%0a%0aFinally, restart httpd:%0a%0a[@%0a$ doas rcctl restart httpd%0a@]%0a%0aUse your browser to view @@http://wiki.example.com@@.%0a%0aTo add TLS, you can use either [[relayd/acceleration|relayd for TLS acceleration]] (recommended) or [[openhttpd/tls|openhttpd's TLS]].%0a%0a!! Configuring PmWiki%0a%0aCopy the sample configuration file and then edit it:%0a%0a[@%0a$ doas cp /var/www/htdocs/wiki.ircnow.org/docs/sample-config.php /var/www/htdocs/wiki.ircnow.org/local/config.php%0a@]%0a%0aEdit @@/var/www/htdocs/wiki.ircnow.org/local/config.php@@.%0a%0a!! Documentation%0a%0aMake sure you get familiar with the docs. They are located in:%0a%0a[@%0a/var/www/htdocs/wiki.ircnow.org/README.txt%0a/var/www/htdocs/wiki.ircnow.org/docs/%0a@]%0a%0a!! Mirroring Content%0a%0aWhen mirroring content, you want to skip the passwords in these two files:%0a%0a[@%0a/var/www/htdocs/wiki.example.com/local/config.php%0a/var/www/htdocs/wiki.example.com/wiki.d/SiteAdmin.AuthUser%0a@]%0a%0a(:if false:)%0a[@%0a$ doas cp -R wiki.example.com/ /var/www/htdocs/wiki.example.com/%0a$ doas chown -R www:daemon /var/www/htdocs/wiki.example.com/%0a@]%0a(:ifend:)%0a%0a!! Password Protect Pages%0a%0aTo change the password prompt page, edit Site.AuthForm.%0a%0aBy default, PmWiki allows creation of password hashes using blowfish, so in the command line, you can type:%0a%0a[@%0a$ encrypt%0aTypeYourPasswordThenPressCtrl+d%0a$2b$09$KcHFdL42rABog//yC9qehuv0wHgu19QqVHOnhW1zutMC/esVfDfwa%0a@]%0a%0aYou can use these password hashes for https://example.com/index.php?n=SiteAdmin.AuthUser%0a%0a!! Read user password from file%0a%0aPlease, create passwd file (pass.txt) in the local forlder of the pmwiki location and update config.php like this:%0a%0a[@%0a$DefaultPasswords['admin'] = pmcrypt(trim(file_get_contents('pass.txt', true)));%0a@]%0a%0a!! Clean URLs%0a%0aThe following URL rewrite rules can provide 'clean' URLs:%0a%0a[@%0a location match "/pub/(.*)" {%0a request rewrite "/pub/%251"%0a }%0a location match "/cookbook/(.*)" {%0a request rewrite "/cookbook/%251"%0a }%0a location match "/uploads/(.*)" {%0a request rewrite "/uploads/%251"%0a }%0a location match "/local/(.*)" {%0a request rewrite "/local/%251"%0a }%0a location match "/favicon.(.*)" {%0a request rewrite "/favicon.%251"%0a }%0a location match "/(.+)/(.+)" {%0a request rewrite "/index.php?n=%251.%252?$QUERY_STRING"%0a }%0a location match "/(.+)" {%0a request rewrite "/index.php?n=%251?$QUERY_STRING"%0a }%0a@]%0a%0aEdit /var/www/htdocs/pmwiki/local/config.php:%0a%0a[@%0a$EnablePathInfo = 1;%0a$ScriptUrl = 'https://wiki.example.com';%0a$PubDirUrl = 'https://wiki.example.com/pub';%0a$UploadDir = "/var/www/htdocs/wiki.example.com/pmwiki/uploads";%0a$UploadUrlFmt = "https://wiki.example.com/uploads";%0a@]%0a%0a!! Syncing with Got%0a%0aCreating the almanack got repo, assuming ~/almanack will be the working directory:%0a%0a[@%0a$ openrsync -a --rsync-path=openrsync --exclude config.php --exclude wiki.d/SiteAdmin.AuthUser /var/www/htdocs/wiki.ircnow.org/ ~/almanack%0a$ got init /var/git/almanack%0a$ got import -m "Import sources" -r /var/git/almanack ~/almanack%0a@]%0a%0aDelete the copy of the almanack and then check it out:%0a%0a[@%0a$ rm -r ~/almanack%0a$ cd ~/%0a$ got checkout /var/git/almanack%0a@]%0a%0aThen, set up a cronjob as a regular user:%0a%0a[@%0a$ crontab -e%0a@daily openrsync -a --rsync-path=openrsync --exclude config.php --exclude wiki.d/SiteAdmin.AuthUser /var/www/htdocs/wiki.ircnow.org/ ~/almanack%0a@daily export GOT_AUTHOR="$USER %3cusername@example.com>" && cd ~/almanack && got commit -m "Daily backup" && sleep 360 && got add -R ~/almanack%0a@]%0a%0aReplace $USER and @@username@example.com@@ with your real username and email.%0a%0a!! Forking IRCNow%0a%0aTo fork the IRCNow almanack:%0a%0a[@%0a$ git clone git://got.ircnow.org/almanack%0a@]%0a
012
2023-01-22
jrmu
time=1660122023
013
2023-01-22
jrmu
title=Install PmWiki
014
2023-01-22
jrmu
author:1660122023=mkf
015
2023-01-22
jrmu
csum:1660122023=replace * with +, which means it needs more than one characters.
016
2023-01-22
jrmu
diff:1660122023:1649753994:=149c149%0a%3c location match "/(.+)/(.+)" {%0a---%0a> location match "/(.*)/(.*)" {%0a152c152%0a%3c location match "/(.+)" {%0a---%0a> location match "/(.*)" {%0a
017
2023-01-22
jrmu
host:1660122023=91.185.139.136
018
2023-01-22
jrmu
author:1649753994=baytuch
019
2023-01-22
jrmu
diff:1649753994:1649265531:=120,127d119%0a%3c %0a%3c !! Read user password from file%0a%3c %0a%3c Please, create passwd file (pass.txt) in the local forlder of the pmwiki location and update config.php like this:%0a%3c %0a%3c [@%0a%3c $DefaultPasswords['admin'] = pmcrypt(trim(file_get_contents('pass.txt', true)));%0a%3c @]%0a
020
2023-01-22
jrmu
host:1649753994=2001:bc8:1830:1533::1
021
2023-01-22
jrmu
author:1649265531=jrmu
022
2023-01-22
jrmu
diff:1649265531:1649010058:=182c182%0a%3c @daily export GOT_AUTHOR="$USER %3cusername@example.com>" && cd ~/almanack && got commit -m "Daily backup" && sleep 360 && got add -R ~/almanack%0a---%0a> @daily export GOT_AUTHOR="$USER %3cusername@example.com>" && cd ~/almanack && got add -R ~/almanack && got commit -m "Daily backup"%0a
023
2023-01-22
jrmu
host:1649265531=38.87.162.8
024
2023-01-22
jrmu
author:1649010058=xfnw
025
2023-01-22
jrmu
csum:1649010058=the utility for creating blowfish passwords on openbsd is called encrypt
026
2023-01-22
jrmu
diff:1649010058:1648926302:=114c114%0a%3c $ encrypt%0a---%0a> $ blowfish%0a
027
2023-01-22
jrmu
host:1649010058=71.178.25.201
028
2023-01-22
jrmu
author:1648926302=jrmu
029
2023-01-22
jrmu
diff:1648926302:1648926247:=186,193d185%0a%3c %0a%3c !! Forking IRCNow%0a%3c %0a%3c To fork the IRCNow almanack:%0a%3c %0a%3c [@%0a%3c $ git clone git://got.ircnow.org/almanack%0a%3c @]%0a
030
2023-01-22
jrmu
host:1648926302=38.87.162.154
031
2023-01-22
jrmu
author:1648926247=jrmu
032
2023-01-22
jrmu
diff:1648926247:1641287455:=182c182%0a%3c @daily export GOT_AUTHOR="$USER %3cusername@example.com>" && cd ~/almanack && got add -R ~/almanack && got commit -m "Daily backup"%0a---%0a> @daily export GOT_AUTHOR="$USER %3cusername@example.com>" && cd ~/almanack && got commit -m "Daily backup"%0a
033
2023-01-22
jrmu
host:1648926247=38.87.162.154
034
2023-01-22
jrmu
author:1641287455=gtlsgamr
035
2023-01-22
jrmu
csum:1641287455=moved the root block inside the server block so that css files can be loaded.
036
2023-01-22
jrmu
diff:1641287455:1639923795:=29d28%0a%3c root "/htdocs/wiki.example.com"%0a35a35%0a> root "/htdocs/wiki.example.com"%0a
037
2023-01-22
jrmu
host:1641287455=103.246.40.191
038
2023-01-22
jrmu
author:1639923795=jrmu
039
2023-01-22
jrmu
diff:1639923795:1639923283:=177c177%0a%3c Then, set up a cronjob as a regular user:%0a---%0a> Then, set up a cronjob:%0a
040
2023-01-22
jrmu
host:1639923795=38.87.162.8
041
2023-01-22
jrmu
author:1639923283=jrmu
042
2023-01-22
jrmu
diff:1639923283:1639760237:=182c182%0a%3c @daily export GOT_AUTHOR="$USER %3cusername@example.com>" && cd ~/almanack && got commit -m "Daily backup"%0a---%0a> @daily cd ~/almanack && got commit -m "Daily backup"%0a184,185d183%0a%3c %0a%3c Replace $USER and @@username@example.com@@ with your real username and email.%0a
043
2023-01-22
jrmu
host:1639923283=38.87.162.8
044
2023-01-22
jrmu
author:1639760237=jrmu
045
2023-01-22
jrmu
diff:1639760237:1639760191:=181,182c181,182%0a%3c @daily openrsync -a --rsync-path=openrsync --exclude config.php --exclude wiki.d/SiteAdmin.AuthUser /var/www/htdocs/wiki.ircnow.org/ ~/almanack%0a%3c @daily cd ~/almanack && got commit -m "Daily backup"%0a---%0a> */5 * * * * openrsync -a --rsync-path=openrsync --exclude config.php --exclude wiki.d/SiteAdmin.AuthUser /var/www/htdocs/wiki.ircnow.org/ ~/almanack%0a> */5 * * * * cd ~/almanack && got commit -m "Daily backup"%0a
046
2023-01-22
jrmu
host:1639760237=198.251.82.194
047
2023-01-22
jrmu
author:1639760191=jrmu
048
2023-01-22
jrmu
diff:1639760191:1639759892:=
049
2023-01-22
jrmu
host:1639760191=198.251.82.194
050
2023-01-22
jrmu
author:1639759892=jrmu
051
2023-01-22
jrmu
diff:1639759892:1639759332:=164c164%0a%3c $ openrsync -a --rsync-path=openrsync --exclude config.php --exclude wiki.d/SiteAdmin.AuthUser /var/www/htdocs/wiki.ircnow.org/ ~/almanack%0a---%0a> $ openrsync -a --delete --rsync-path=openrsync --exclude config.php --exclude wiki.d/SiteAdmin.AuthUser /var/www/htdocs/wiki.ircnow.org/ ~/almanack%0a181c181%0a%3c */5 * * * * openrsync -a --rsync-path=openrsync --exclude config.php --exclude wiki.d/SiteAdmin.AuthUser /var/www/htdocs/wiki.ircnow.org/ ~/almanack%0a---%0a> */5 * * * * openrsync -a --delete --rsync-path=openrsync --exclude config.php --exclude wiki.d/SiteAdmin.AuthUser /var/www/htdocs/wiki.ircnow.org/ ~/almanack%0a183a184%0a> %0a
052
2023-01-22
jrmu
host:1639759892=198.251.82.194
053
2023-01-22
jrmu
author:1639759332=jrmu
054
2023-01-22
jrmu
diff:1639759332:1639758782:=182c182%0a%3c */5 * * * * cd ~/almanack && got commit -m "Daily backup"%0a---%0a> */5 * * * * cd ~/ && got -r /var/git/almanack -m "Daily backup" commit%0a
055
2023-01-22
jrmu
host:1639759332=198.251.82.194
056
2023-01-22
jrmu
author:1639758782=jrmu
057
2023-01-22
jrmu
diff:1639758782:1639758763:=181,182c181,182%0a%3c */5 * * * * openrsync -a --delete --rsync-path=openrsync --exclude config.php --exclude wiki.d/SiteAdmin.AuthUser /var/www/htdocs/wiki.ircnow.org/ ~/almanack%0a%3c */5 * * * * cd ~/ && got -r /var/git/almanack -m "Daily backup" commit%0a---%0a> openrsync -a --delete --rsync-path=openrsync --exclude config.php --exclude wiki.d/SiteAdmin.AuthUser /var/www/htdocs/wiki.ircnow.org/ ~/almanack%0a> cd ~/ && got -r /var/git/almanack -m "Daily backup" commit%0a
058
2023-01-22
jrmu
host:1639758782=198.251.82.194
059
2023-01-22
jrmu
author:1639758763=jrmu
060
2023-01-22
jrmu
diff:1639758763:1639757956:=
061
2023-01-22
jrmu
host:1639758763=198.251.82.194
062
2023-01-22
jrmu
author:1639757956=jrmu
063
2023-01-22
jrmu
diff:1639757956:1639756409:=161,162c161,162%0a%3c Creating the almanack got repo, assuming ~/almanack will be the working directory:%0a%3c %0a---%0a> Creating the almanack got repo:%0a> %0a164,166c164%0a%3c $ openrsync -a --delete --rsync-path=openrsync --exclude config.php --exclude wiki.d/SiteAdmin.AuthUser /var/www/htdocs/wiki.ircnow.org/ ~/almanack%0a%3c $ got init /var/git/almanack%0a%3c $ got import -m "Import sources" -r /var/git/almanack ~/almanack%0a---%0a> %0a169,170c167,168%0a%3c Delete the copy of the almanack and then check it out:%0a%3c %0a---%0a> Assuming ~/almanack is your working directory:%0a> %0a172,182c170,171%0a%3c $ rm -r ~/almanack%0a%3c $ cd ~/%0a%3c $ got checkout /var/git/almanack%0a%3c @]%0a%3c %0a%3c Then, set up a cronjob:%0a%3c %0a%3c [@%0a%3c $ crontab -e%0a%3c openrsync -a --delete --rsync-path=openrsync --exclude config.php --exclude wiki.d/SiteAdmin.AuthUser /var/www/htdocs/wiki.ircnow.org/ ~/almanack%0a%3c cd ~/ && got -r /var/git/almanack -m "Daily backup" commit%0a---%0a> $ openrsync -a --delete --rsync-path=openrsync --exclude config.php --exclude wiki.d/SiteAdmin.AuthUser /var/www/htdocs/wiki.ircnow.org/ ~/almanack%0a> $ got -m "Daily backup" commit%0a
064
2023-01-22
jrmu
host:1639757956=198.251.82.194
065
2023-01-22
jrmu
author:1639756409=jrmu
066
2023-01-22
jrmu
diff:1639756409:1632320687:=158,173d157%0a%3c %0a%3c !! Syncing with Got%0a%3c %0a%3c Creating the almanack got repo:%0a%3c %0a%3c [@%0a%3c %0a%3c @]%0a%3c %0a%3c Assuming ~/almanack is your working directory:%0a%3c %0a%3c [@%0a%3c $ openrsync -a --delete --rsync-path=openrsync --exclude config.php --exclude wiki.d/SiteAdmin.AuthUser /var/www/htdocs/wiki.ircnow.org/ ~/almanack%0a%3c $ got -m "Daily backup" commit%0a%3c @]%0a%3c %0a
067
2023-01-22
jrmu
host:1639756409=198.251.82.194
068
2023-01-22
jrmu
author:1632320687=miniontoby
069
2023-01-22
jrmu
csum:1632320687=updated it a bit
070
2023-01-22
jrmu
diff:1632320687:1632320519:=129c129%0a%3c location match "/cookbook/(.*)" {%0a---%0a> location "/cookbook/*" {%0a132c132%0a%3c location match "/uploads/(.*)" {%0a---%0a> location "/uploads/*" {%0a135c135%0a%3c location match "/local/(.*)" {%0a---%0a> location "/local/*" {%0a138,139c138,139%0a%3c location match "/favicon.(.*)" {%0a%3c request rewrite "/favicon.%251"%0a---%0a> location "/favicon.jpg" {%0a> request rewrite "/favicon.jpg"%0a
071
2023-01-22
jrmu
host:1632320687=77.168.188.164
072
2023-01-22
jrmu
author:1632320519=miniontoby
073
2023-01-22
jrmu
csum:1632320519=updated cleanurls
074
2023-01-22
jrmu
diff:1632320519:1627398507:minor=129c129%0a%3c location "/cookbook/*" {%0a---%0a> location match "/cookbook/(.*)" {%0a132c132%0a%3c location "/uploads/*" {%0a---%0a> location match "/uploads/(.*)" {%0a135,136c135,136%0a%3c location "/local/*" {%0a%3c request rewrite "/local/%251"%0a---%0a> location match "/(.*)/(.*)" {%0a> request rewrite "/pmwiki.php?n=%251.%252?$QUERY_STRING"%0a138,145c138,139%0a%3c location "/favicon.jpg" {%0a%3c request rewrite "/favicon.jpg"%0a%3c }%0a%3c location match "/(.*)/(.*)" {%0a%3c request rewrite "/index.php?n=%251.%252?$QUERY_STRING"%0a%3c }%0a%3c location match "/(.*)" {%0a%3c request rewrite "/index.php?n=%251?$QUERY_STRING"%0a---%0a> location match "/(.*)" {%0a> request rewrite "/pmwiki.php?n=%251?$QUERY_STRING"%0a
075
2023-01-22
jrmu
host:1632320519=77.168.188.164
076
2023-01-22
jrmu
author:1627398507=jrmu
077
2023-01-22
jrmu
diff:1627398507:1627397570:=72,75c72,75%0a%3c !! Configuring PmWiki%0a%3c %0a%3c Copy the sample configuration file and then edit it:%0a%3c %0a---%0a> !! Mirroring Content%0a> %0a> When mirroring content, you want to edit out passwords in these two files:%0a> %0a77c77,78%0a%3c $ doas cp /var/www/htdocs/wiki.ircnow.org/docs/sample-config.php /var/www/htdocs/wiki.ircnow.org/local/config.php%0a---%0a> /var/www/htdocs/wiki.example.com/local/config.php%0a> /var/www/htdocs/wiki.example.com/wiki.d/SiteAdmin.AuthUser%0a80,85c81%0a%3c Edit @@/var/www/htdocs/wiki.ircnow.org/local/config.php@@.%0a%3c %0a%3c !! Documentation%0a%3c %0a%3c Make sure you get familiar with the docs. They are located in:%0a%3c %0a---%0a> (:if false:)%0a87,88c83,84%0a%3c /var/www/htdocs/wiki.ircnow.org/README.txt%0a%3c /var/www/htdocs/wiki.ircnow.org/docs/%0a---%0a> $ doas cp -R wiki.example.com/ /var/www/htdocs/wiki.example.com/%0a> $ doas chown -R www:daemon /var/www/htdocs/wiki.example.com/%0a90,94c86,93%0a%3c %0a%3c !! Mirroring Content%0a%3c %0a%3c When mirroring content, you want to skip the passwords in these two files:%0a%3c %0a---%0a> (:ifend:)%0a> %0a> !! Password Protect Pages%0a> %0a> To change the password prompt page, edit Site.AuthForm.%0a> %0a> By default, PmWiki allows creation of password hashes using blowfish, so in the command line, you can type:%0a> %0a96,97c95,97%0a%3c /var/www/htdocs/wiki.example.com/local/config.php%0a%3c /var/www/htdocs/wiki.example.com/wiki.d/SiteAdmin.AuthUser%0a---%0a> $ blowfish%0a> TypeYourPasswordThenPressCtrl+d%0a> $2b$09$KcHFdL42rABog//yC9qehuv0wHgu19QqVHOnhW1zutMC/esVfDfwa%0a100c100,101%0a%3c (:if false:)%0a---%0a> To create a password hash for https://example.com/index.php?n=SiteAdmin.AuthUser, run this command:%0a> %0a102,103c103,104%0a%3c $ doas cp -R wiki.example.com/ /var/www/htdocs/wiki.example.com/%0a%3c $ doas chown -R www:daemon /var/www/htdocs/wiki.example.com/%0a---%0a> $ php-7.4 %0a> %3c?php echo password_hash("PASSWORD", PASSWORD_BCRYPT); ?>%0a105,119c106,112%0a%3c (:ifend:)%0a%3c %0a%3c !! Password Protect Pages%0a%3c %0a%3c To change the password prompt page, edit Site.AuthForm.%0a%3c %0a%3c By default, PmWiki allows creation of password hashes using blowfish, so in the command line, you can type:%0a%3c %0a%3c [@%0a%3c $ blowfish%0a%3c TypeYourPasswordThenPressCtrl+d%0a%3c $2b$09$KcHFdL42rABog//yC9qehuv0wHgu19QqVHOnhW1zutMC/esVfDfwa%0a%3c @]%0a%3c %0a%3c You can use these password hashes for https://example.com/index.php?n=SiteAdmin.AuthUser%0a---%0a> %0a> Replace PASSWORD with your real password.%0a> %0a> !! Clean URLs%0a> %0a> The following URL rewrite rules can provide 'clean' URLs:%0a> %0a
078
2023-01-22
jrmu
host:1627398507=38.87.162.8
079
2023-01-22
jrmu
author:1627397570=jrmu
080
2023-01-22
jrmu
diff:1627397570:1627397494:=81d80%0a%3c (:if false:)%0a86d84%0a%3c (:ifend:)%0a
081
2023-01-22
jrmu
host:1627397570=38.87.162.8
082
2023-01-22
jrmu
author:1627397494=jrmu
083
2023-01-22
jrmu
diff:1627397494:1627397019:=74,75d73%0a%3c When mirroring content, you want to edit out passwords in these two files:%0a%3c %0a77,82c75,76%0a%3c /var/www/htdocs/wiki.example.com/local/config.php%0a%3c /var/www/htdocs/wiki.example.com/wiki.d/SiteAdmin.AuthUser%0a%3c @]%0a%3c %0a%3c [@%0a%3c $ doas cp -R wiki.example.com/ /var/www/htdocs/wiki.example.com/%0a---%0a> $ doas cp -a wiki.d/ /var/www/htdocs/wiki.example.com/%0a> $ doas chown -R www:daemon /var/www/htdocs/wiki.example.com/%0a
084
2023-01-22
jrmu
host:1627397494=38.87.162.8
085
2023-01-22
jrmu
author:1627397019=jrmu
086
2023-01-22
jrmu
diff:1627397019:1627396942:=76d75%0a%3c $ doas chown -R www:daemon /var/www/htdocs/wiki.example.com/%0a
087
2023-01-22
jrmu
host:1627397019=38.87.162.8
088
2023-01-22
jrmu
author:1627396942=jrmu
089
2023-01-22
jrmu
diff:1627396942:1627396424:=71,76d70%0a%3c %0a%3c !! Mirroring Content%0a%3c %0a%3c [@%0a%3c $ doas cp -a wiki.d/ /var/www/htdocs/wiki.example.com/%0a%3c @]%0a
090
2023-01-22
jrmu
host:1627396942=38.87.162.8
091
2023-01-22
jrmu
author:1627396424=jrmu
092
2023-01-22
jrmu
diff:1627396424:1627395013:=72,73c72,73%0a%3c !! Password Protect Pages%0a%3c %0a---%0a> !!%0a> %0a75,82d74%0a%3c %0a%3c By default, PmWiki allows creation of password hashes using blowfish, so in the command line, you can type:%0a%3c %0a%3c [@%0a%3c $ blowfish%0a%3c TypeYourPasswordThenPressCtrl+d%0a%3c $2b$09$KcHFdL42rABog//yC9qehuv0wHgu19QqVHOnhW1zutMC/esVfDfwa%0a%3c @]%0a
093
2023-01-22
jrmu
host:1627396424=38.87.162.8
094
2023-01-22
jrmu
author:1627395013=jrmu
095
2023-01-22
jrmu
diff:1627395013:1627394765:=85,88c85,89%0a%3c !! Clean URLs%0a%3c %0a%3c The following URL rewrite rules can provide 'clean' URLs:%0a%3c %0a---%0a> !! Clean url's %0a> %0a> If you want clean url's you need to do the following (which I (Miniontoby) didn't really wanted to share) %0a> %0a> add to your httpd.conf wiki block%0a107,115c108,113%0a%3c Edit /var/www/htdocs/pmwiki/local/config.php:%0a%3c %0a%3c [@%0a%3c $EnablePathInfo = 1;%0a%3c $ScriptUrl = 'https://wiki.example.com';%0a%3c $PubDirUrl = 'https://wiki.example.com/pub';%0a%3c $UploadDir = "/var/www/htdocs/wiki.example.com/pmwiki/uploads";%0a%3c $UploadUrlFmt = "https://wiki.example.com/uploads";%0a%3c @]%0a---%0a> and edit your /var/www/htdocs/pmwiki/local/config.php:%0a> [@$EnablePathInfo = 1; //for enabling automatic use%0a> $ScriptUrl = 'https://wiki.example.com'; //for the homepage%0a> $PubDirUrl = 'https://wiki.example.com/pub'; //for the pub dir%0a> $UploadDir = "/var/www/htdocs/pmwiki/uploads"; //for the upload dir (plz make it firstly if not exist)%0a> $UploadUrlFmt = "https://wiki.example.com/uploads"; //for upload dir on the wiki@]%0a
096
2023-01-22
jrmu
host:1627395013=38.87.162.8
097
2023-01-22
jrmu
author:1627394765=jrmu
098
2023-01-22
jrmu
diff:1627394765:1627394461:=
099
2023-01-22
jrmu
host:1627394765=38.87.162.8
100
2023-01-22
jrmu
author:1627394461=jrmu
101
2023-01-22
jrmu
diff:1627394461:1627394316:=61,70d60%0a%3c %0a%3c Finally, restart httpd:%0a%3c %0a%3c [@%0a%3c $ doas rcctl restart httpd%0a%3c @]%0a%3c %0a%3c Use your browser to view @@http://wiki.example.com@@.%0a%3c %0a%3c To add TLS, you can use either [[relayd/acceleration|relayd for TLS acceleration]] (recommended) or [[openhttpd/tls|openhttpd's TLS]].%0a
102
2023-01-22
jrmu
host:1627394461=38.87.162.8
103
2023-01-22
jrmu
author:1627394316=jrmu
104
2023-01-22
jrmu
diff:1627394316:1627393854:=49,60d48%0a%3c %0a%3c While not required, it helps to put in /var/www/htdocs/wiki.example.com/index.php:%0a%3c %0a%3c [@%0a%3c %3c?php include('pmwiki.php');%0a%3c @]%0a%3c %0a%3c Then give it proper permissions:%0a%3c %0a%3c [@%0a%3c $ doas chown www:daemon /var/www/htdocs/wiki.example.com/index.php%0a%3c @]%0a
105
2023-01-22
jrmu
host:1627394316=38.87.162.8
106
2023-01-22
jrmu
author:1627393854=jrmu
107
2023-01-22
jrmu
diff:1627393854:1627383010:=15d14%0a%3c $ doas chown -R www:daemon /var/www/htdocs/wiki.example.com%0a
108
2023-01-22
jrmu
host:1627393854=38.87.162.8
109
2023-01-22
jrmu
author:1627383010=jrmu
110
2023-01-22
jrmu
diff:1627383010:1627382674:=21,24c21%0a%3c Before you begin, make sure you have [[php/install|PHP installed]].%0a%3c %0a%3c Next, add a new block to @@/etc/httpd.conf@@:%0a%3c %0a---%0a> Add a new block to @@/etc/httpd.conf@@:%0a42,49d38%0a%3c %0a%3c Lines 7-8 above tell httpd to evaluate any file that ends with .php as a PHP script. Line 9 says that the document root for the web files is /htdocs/wiki.example.com. Keep in mind, however, that httpd automatically chroots to /var/www/, so the actual path will be /var/www/htdocs/wiki.example.com/.%0a%3c %0a%3c Line 11-13 tell httpd to automatically serve index.php as the default file when a directory is requested by the user. In other words, if a user requests @@https://wiki.example.com@@, he will actually receive @@https://wiki.example.com/index.php@@.%0a%3c %0a%3c Line 14 tells httpd that it can receive uploads as large as 100MB. By default, httpd is limited to only 1MB, so this setting is necessary if you want to allow large file uploads for your wiki.%0a%3c %0a%3c !!%0a
111
2023-01-22
jrmu
host:1627383010=38.87.162.8
112
2023-01-22
jrmu
author:1627382674=jrmu
113
2023-01-22
jrmu
diff:1627382674:1627382359:=5c5%0a%3c [[https://www.pmwiki.org|PmWiki]] is a simple and lightweight wiki that doesn't require a database. Instead, content for the wiki is stored in simple text files. Its only requirement is PHP, making it very simple to host with OpenBSD's openhttpd. It also does not require the user's browser to support javascript, which helps improve accessibility.%0a---%0a> [[https://www.pmwiki.org|PmWiki]] is a simple and lightweight wiki that doesn't require a database. Instead, content for the wiki is stored in simple text files. Its only requirement is PHP, making it very simple to host with OpenBSD's openhttpd.%0a
114
2023-01-22
jrmu
host:1627382674=38.87.162.8
115
2023-01-22
jrmu
author:1627382359=jrmu
116
2023-01-22
jrmu
diff:1627382359:1627381876:=18,38d17%0a%3c %0a%3c !! Configure OpenHTTPd%0a%3c %0a%3c Add a new block to @@/etc/httpd.conf@@:%0a%3c [@%0a%3c server "wiki.example.com" {%0a%3c listen on * port 80%0a%3c location "/.well-known/acme-challenge/*" {%0a%3c root "/acme"%0a%3c request strip 2%0a%3c }%0a%3c location "*.php" {%0a%3c fastcgi socket "/run/php-fpm.sock"%0a%3c root "/htdocs/wiki.example.com"%0a%3c }%0a%3c directory {%0a%3c index "index.php"%0a%3c }%0a%3c connection max request body 104857600%0a%3c }%0a%3c @]%0a
117
2023-01-22
jrmu
host:1627382359=38.87.162.8
118
2023-01-22
jrmu
author:1627381876=jrmu
119
2023-01-22
jrmu
diff:1627381876:1627380192:=17c17%0a%3c Make sure to replace wiki.example.com with your actual domain name. For flexibility, we recommend you run your own nameserver using [[nsd/configure|nsd]] and [[nsd/zone|create a records]] for wiki.example.com.%0a---%0a> Make sure to replace wiki.example.com with your actual domain name.%0a
120
2023-01-22
jrmu
host:1627381876=38.87.162.8
121
2023-01-22
jrmu
author:1627380192=jrmu
122
2023-01-22
jrmu
diff:1627380192:1627380173:=17c17%0a%3c Make sure to replace wiki.example.com with your actual domain name.%0a---%0a> Make sure to replace example.com with your actual domain name.%0a
123
2023-01-22
jrmu
host:1627380192=38.87.162.8
124
2023-01-22
jrmu
author:1627380173=jrmu
125
2023-01-22
jrmu
diff:1627380173:1627379432:=5,6c5,6%0a%3c [[https://www.pmwiki.org|PmWiki]] is a simple and lightweight wiki that doesn't require a database. Instead, content for the wiki is stored in simple text files. Its only requirement is PHP, making it very simple to host with OpenBSD's openhttpd.%0a%3c %0a---%0a> [https://www.pmwiki.org|PmWiki]] is a simple and lightweight wiki that doesn't require a database. Instead, content for the wiki is stored in simple text files. Its only requirement is PHP, making it very simple to host with OpenBSD's openhttpd.%0a> %0a10,17d9%0a%3c %0a%3c [@%0a%3c $ ftp https://www.pmwiki.org/pub/pmwiki/pmwiki-latest.tgz%0a%3c $ tar xvzf pmwiki-latest.tgz%0a%3c $ doas mv pmwiki-2.2.141/ /var/www/htdocs/wiki.example.com%0a%3c @]%0a%3c %0a%3c Make sure to replace example.com with your actual domain name.%0a
126
2023-01-22
jrmu
host:1627380173=38.87.162.8
127
2023-01-22
jrmu
author:1627379432=jrmu
128
2023-01-22
jrmu
diff:1627379432:1627378757:=1,9c1%0a%3c (:title Install PmWiki:)%0a%3c %0a%3c !! Overview%0a%3c %0a%3c [https://www.pmwiki.org|PmWiki]] is a simple and lightweight wiki that doesn't require a database. Instead, content for the wiki is stored in simple text files. Its only requirement is PHP, making it very simple to host with OpenBSD's openhttpd.%0a%3c %0a%3c !! Install%0a%3c %0a%3c [[https://www.pmwiki.org/wiki/PmWiki/Download|Download a copy]] of PmWiki. In this guide, we'll grab [[https://www.pmwiki.org/pub/pmwiki/pmwiki-latest.tgz|the latest stable release]].%0a---%0a> pmwiki is a 2 step install. It's on the official pmwiki page, there's not that much to do.%0a
129
2023-01-22
jrmu
host:1627379432=38.87.162.8
130
2023-01-22
jrmu
author:1627378757=jrmu
131
2023-01-22
jrmu
diff:1627378757:1627378629:=
132
2023-01-22
jrmu
host:1627378757=38.87.162.8
133
2023-01-22
jrmu
author:1627378629=jrmu
134
2023-01-22
jrmu
diff:1627378629:1627378629:=1,42d0%0a%3c pmwiki is a 2 step install. It's on the official pmwiki page, there's not that much to do.%0a%3c %0a%3c To change the password prompt page, edit Site.AuthForm.%0a%3c %0a%3c To create a password hash for https://example.com/index.php?n=SiteAdmin.AuthUser, run this command:%0a%3c %0a%3c [@%0a%3c $ php-7.4 %0a%3c %3c?php echo password_hash("PASSWORD", PASSWORD_BCRYPT); ?>%0a%3c @]%0a%3c %0a%3c Replace PASSWORD with your real password.%0a%3c %0a%3c !! Clean url's %0a%3c %0a%3c If you want clean url's you need to do the following (which I (Miniontoby) didn't really wanted to share) %0a%3c %0a%3c add to your httpd.conf wiki block%0a%3c [@%0a%3c location match "/pub/(.*)" {%0a%3c request rewrite "/pub/%251"%0a%3c }%0a%3c location match "/cookbook/(.*)" {%0a%3c request rewrite "/cookbook/%251"%0a%3c }%0a%3c location match "/uploads/(.*)" {%0a%3c request rewrite "/uploads/%251"%0a%3c }%0a%3c location match "/(.*)/(.*)" {%0a%3c request rewrite "/pmwiki.php?n=%251.%252?$QUERY_STRING"%0a%3c }%0a%3c location match "/(.*)" {%0a%3c request rewrite "/pmwiki.php?n=%251?$QUERY_STRING"%0a%3c }%0a%3c @]%0a%3c %0a%3c and edit your /var/www/htdocs/pmwiki/local/config.php:%0a%3c [@$EnablePathInfo = 1; //for enabling automatic use%0a%3c $ScriptUrl = 'https://wiki.example.com'; //for the homepage%0a%3c $PubDirUrl = 'https://wiki.example.com/pub'; //for the pub dir%0a%3c $UploadDir = "/var/www/htdocs/pmwiki/uploads"; //for the upload dir (plz make it firstly if not exist)%0a%3c $UploadUrlFmt = "https://wiki.example.com/uploads"; //for upload dir on the wiki@]%0a
135
2023-01-22
jrmu
host:1627378629=38.87.162.8
IRCNow