Blame
Date:
Fri Dec 2 05:00:19 2022
UTC
Message:
Daily backup
002
2022-08-11
agent=Mozilla/5.0 (X11; OpenBSD amd64; rv:68.0) Gecko/20100101 Firefox/68.0 SeaMonkey/2.53.11.1
011
2022-08-11
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
015
2022-08-11
csum:1660122023=replace * with +, which means it needs more than one characters.
016
2022-08-11
diff:1660122023:1649753994:=149c149%0a%3c location match "/(.+)/(.+)" {%0a---%0a> location match "/(.*)/(.*)" {%0a152c152%0a%3c location match "/(.+)" {%0a---%0a> location match "/(.*)" {%0a
019
2022-04-13
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
022
2022-04-07
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
025
2022-04-06
csum:1649010058=the utility for creating blowfish passwords on openbsd is called encrypt
029
2022-04-06
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
032
2022-04-06
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
035
2022-01-05
csum:1641287455=moved the root block inside the server block so that css files can be loaded.
036
2022-01-05
diff:1641287455:1639923795:=29d28%0a%3c root "/htdocs/wiki.example.com"%0a35a35%0a> root "/htdocs/wiki.example.com"%0a
039
2021-12-20
diff:1639923795:1639923283:=177c177%0a%3c Then, set up a cronjob as a regular user:%0a---%0a> Then, set up a cronjob:%0a
042
2021-12-19
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
045
2021-12-19
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
051
2021-12-17
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
054
2021-12-17
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
057
2021-12-17
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
063
2021-12-17
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
066
2021-12-17
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
070
2021-12-17
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
074
2021-12-17
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
077
2021-12-17
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
080
2021-12-17
diff:1627397570:1627397494:=81d80%0a%3c (:if false:)%0a86d84%0a%3c (:ifend:)%0a
083
2021-12-17
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
086
2021-12-17
diff:1627397019:1627396942:=76d75%0a%3c $ doas chown -R www:daemon /var/www/htdocs/wiki.example.com/%0a
089
2021-12-17
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
092
2021-12-17
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
095
2021-12-17
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
101
2021-12-17
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
104
2021-12-17
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
107
2021-12-17
diff:1627393854:1627383010:=15d14%0a%3c $ doas chown -R www:daemon /var/www/htdocs/wiki.example.com%0a
110
2021-12-17
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
113
2021-12-17
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
116
2021-12-17
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
119
2021-12-17
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
122
2021-12-17
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
125
2021-12-17
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
128
2021-12-17
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
134
2021-12-17
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