[tw5] setting up tiddlywiki with save working on Apache

638 views
Skip to first unread message

J

unread,
Jun 11, 2018, 7:12:51 PM6/11/18
to TiddlyWiki
Hi All!

I have been trying to find a setup document for TW5 with save working on Apache.  I have pieced together what I have learned from reading various posts but my setup is not working properly.  Can someone point me to a doc please?  

Any help would be appreciated.

Thank you in advance.

Regards,
j

Mark S.

unread,
Jun 11, 2018, 8:04:07 PM6/11/18
to TiddlyWiki
How are you trying to save on Apache? Store.php? WebDav?

-- Mark

Lost Admin

unread,
Jun 12, 2018, 9:22:31 AM6/12/18
to TiddlyWiki
I previously had TW working with store.php on Apache and currently have it running fine on WebDAV (burried in this forum you will find my steps). I'm working on better instructions in my spare time.

J

unread,
Jun 12, 2018, 10:32:28 AM6/12/18
to TiddlyWiki
Mark,

Here is my current specs.  I have both webdav and store.php.  If this is wrong, I just didnt know better as I was trying to put things together without an end to end doc.  ;)

Fedora 28
Apache 2.4.33
PHP 7.2.6
TiddlyWiki 5.1.17
TiddlyHome 0.1.3

Here is my apache config for my VirtualHost.

<VirtualHost *:80>
DocumentRoot "/data/tiddlywiki"
        DavLockDB "/tmp/DavLock"
        <Directory "/data/tiddlywiki">
                Options +Indexes +FollowSymLinks
                AllowOverride None
        </Directory>
</VirtualHost>

The files in the directory contains.

backup
store.php
tw_updated.html -> upload/index.html
upload

Here are my settings in TiddlySpot Saver.

Upload Filename: index.html
Upload Directory:  ./upload/
Backup Directory: ./backup/

Regards,
j

J

unread,
Jun 12, 2018, 10:37:35 AM6/12/18
to tiddl...@googlegroups.com
Lost Admin,

Please share your steps or at least the URL for the WebDAV instructions.  I am assuming this is WebDAV and Apache.

Thank you in advance.

Regards,
j

Lost Admin

unread,
Jun 12, 2018, 11:12:19 AM6/12/18
to TiddlyWiki


On Tuesday, June 12, 2018 at 10:32:28 AM UTC-4, J wrote:
Mark,

Here is my current specs.  I have both webdav and store.php.  If this is wrong, I just didnt know better as I was trying to put things together without an end to end doc.  ;)

You want either WebDAV or PHP for TiddlyWiki. Not both.
 

Fedora 28
Apache 2.4.33
PHP 7.2.6
TiddlyWiki 5.1.17
TiddlyHome 0.1.3

The last time I tried store.php, it didn't work with PHP 7. I had to use PHP 5.
 

Here is my apache config for my VirtualHost.

<VirtualHost *:80>
DocumentRoot "/data/tiddlywiki"
        DavLockDB "/tmp/DavLock"
        <Directory "/data/tiddlywiki">
                Options +Indexes +FollowSymLinks
                AllowOverride None
        </Directory>
</VirtualHost>

I don't see the mod_php setup for using store.php.

I don't see the DAV On directive to enable WebDAV; nor do I see any authentication. That would mean anyone who can see the server over the network can store whatever they want on that server. Are you sure that's what you want?

Lost Admin

unread,
Jun 12, 2018, 11:13:46 AM6/12/18
to tiddl...@googlegroups.com
I can't even find my old instructions. (do we have a face-palm emoji?)

I'll try to post my current config with some explanation around it after I get home, tonight.
P.S. when I set-up WebDAV on my Apache server I had to go through several tutorials, man pages, and assorted documentation too. I never did find a clean and easy to follow set of instructions that actually got me a basic, working WebDAV server.
 

J

unread,
Jun 12, 2018, 11:36:28 AM6/12/18
to TiddlyWiki
Lost Admin,

Here are my answers to your questions.

"You want either WebDAV or PHP for TiddlyWiki. Not both."
Which ever of the two that support remote saves (i.e. access tiddlywiki from another machine and save edits or creates).  My current setup seems to download the new version of the wiki after performing a save.  It will intermittently save remotely.

"The last time I tried store.php, it didn't work with PHP 7. I had to use PHP 5."
I seem to have a feeling that this is the case since my setup is not working properly.  Hence, I reached out to this forum hoping that the TW gods will grace me with their wisdom.  :)

"I don't see the mod_php setup for using store.php."
Here are the rest of the php setup.  These are default when I installed PHP.  I figured that if a phpinfo page is working in the same location as the wiki, then I assumed that it is all i needed.
<IfModule !mod_php5.c>
  <IfModule prefork.c>
    LoadModule php7_module modules/libphp7.so
  </IfModule>
</IfModule>


<IfModule !mod_php5.c>
  <IfModule !prefork.c>
     LoadModule php7_module modules/libphp7-zts.so
  </IfModule>
</IfModule>

<Files ".user.ini">
    Require all denied
</Files>

AddType text/html .php

DirectoryIndex index.php

<IfModule !mod_php5.c>
  <IfModule !mod_php7.c>
    SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1

    <FilesMatch \.(php|phar)$>
        SetHandler "proxy:unix:/run/php-fpm/www.sock|fcgi://localhost"
    </FilesMatch>
  </IfModule>
</IfModule>

<IfModule  mod_php7.c>
    <FilesMatch \.(php|phar)$>
        SetHandler application/x-httpd-php
    </FilesMatch>


    php_value session.save_handler "files"
    php_value session.save_path    "/var/lib/php/session"
    php_value soap.wsdl_cache_dir  "/var/lib/php/wsdlcache"

</IfModule>

"I don't see the DAV On directive to enable WebDAV; nor do I see any authentication. That would mean anyone who can see the server over the network can store whatever they want on that server. Are you sure that's what you want?"
Here are the DAV directives I have.  They are also the defaults when I install Apache and libphodav.
LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule dav_lock_module modules/mod_dav_lock.so

I purposely did not put any authentication as I intend to limit this using the "Require ip" directive.  However, if the authentication is required, then I shall oblige.

Thank you for taking the time to share your wisdom.  :)

Regards,
j

J

unread,
Jun 12, 2018, 11:39:26 AM6/12/18
to TiddlyWiki
Don't worry.  I intend to create an end to end doc that I shall share with everyone when I get a working configuration.  :)

Regards,
j

Lost Admin

unread,
Jun 12, 2018, 11:43:09 AM6/12/18
to TiddlyWiki


On Tuesday, June 12, 2018 at 11:36:28 AM UTC-4, J wrote:
Lost Admin,

Here are my answers to your questions.

"You want either WebDAV or PHP for TiddlyWiki. Not both."
Which ever of the two that support remote saves (i.e. access tiddlywiki from another machine and save edits or creates).  My current setup seems to download the new version of the wiki after performing a save.  It will intermittently save remotely.

They both support remote saves.
 
...
 
"I don't see the DAV On directive to enable WebDAV; nor do I see any authentication. That would mean anyone who can see the server over the network can store whatever they want on that server. Are you sure that's what you want?"
Here are the DAV directives I have.  They are also the defaults when I install Apache and libphodav.
LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule dav_lock_module modules/mod_dav_lock.so

I purposely did not put any authentication as I intend to limit this using the "Require ip" directive.  However, if the authentication is required, then I shall oblige.

You can run WebDAV without authentication. Require IP is better than nothing. If you trust everyone who could possibly come from the source IP address(es)  you are requiring, it's probably safer than username/password authentication.

I don't (currently) have access to my server to check the config, but try this:

<VirtualHost *:80>
DocumentRoot "/data/tiddlywiki"
        DavLockDB "/tmp/DavLock"
        <Directory "/data/tiddlywiki">
                DAV On
                Options +Indexes +FollowSymLinks
                AllowOverride None
        </Directory>
</VirtualHost>

Mark S.

unread,
Jun 12, 2018, 12:50:40 PM6/12/18
to TiddlyWiki
Re Store.php, you need to make a small code change to accommodate the latest PHP You may also need to adjust max upload/download sizes in the store.php file and perhaps in the php.ini file.

-- Mark

Lost Admin

unread,
Jun 12, 2018, 4:29:34 PM6/12/18
to tiddl...@googlegroups.com
Now that I can get to my server, here is a very quick and dirty explanation of the Apache HTTPD config file for WebDAV:


That was a cut-and-paste of the actual virtualhost with site specific paths and names changed. I use it for hosting tiddlywiki through webdav.

On Monday, June 11, 2018 at 7:12:51 PM UTC-4, J wrote:

J

unread,
Jun 14, 2018, 12:35:03 PM6/14/18
to TiddlyWiki
Thank you all for the assist.  I would not have been able to write the document below.  I hope this helps others in the future.


Regards,
j

Ivan Aparicio

unread,
Aug 5, 2018, 2:20:38 PM8/5/18
to TiddlyWiki
Do you know what changes are needed? I had a great little setup with store.php on apache until I upgraded my PHP to update nextcloud :(. Now I don't have access to my tiddlywiki

Mark S.

unread,
Aug 5, 2018, 5:38:31 PM8/5/18
to TiddlyWiki
Are you getting messages about "split" ? Down in the code there's a set of lines:

/ get options
foreach($optionArr as $o) {
    list($key, $value) = split('=', $o);
    $options[$key] = $value;
}

My understanding is that "split" has been deprecated and might need to be fixed with "explode". One report in the forum said that they were able to simply remove the lines, which suggests that they might never get invoked in some circumstances.

-- Mark

Ivan Aparicio

unread,
Aug 7, 2018, 3:45:22 PM8/7/18
to TiddlyWiki
YES! Thanks Mark. I had a look at the log, and it was complaining about the 'split()'. After reading a bit online I used preg_split instead. So here is the code I ended up with:

// get options

foreach($optionArr as $o) {

        list($key, $value) = preg_split('~=~', $o);

        $options[$key] = $value;

}


I put '~' characters around the '=' because I was getting an error that said that the '=' didn't have a delimiter, and I read on a stack overflow post that it was the thing to do.


I can post the PHP file working on PHP 7 if anyone is interested.

Lost Admin

unread,
Aug 8, 2018, 10:23:07 AM8/8/18
to TiddlyWiki


On Tuesday, August 7, 2018 at 3:45:22 PM UTC-4, Ivan Aparicio wrote:
...


I can post the PHP file working on PHP 7 if anyone is interested.

I am interested. I don't use the PHP saver anymore since I've got a working Apache WebDAV server but I ran the PHP server for quite a while and make a few improvements of my own. 

Ivan Aparicio

unread,
Aug 9, 2018, 3:50:05 PM8/9/18
to TiddlyWiki
I've attached the file
store.php
Reply all
Reply to author
Forward
0 new messages