HOWTOlabs MIT App Inventor 2
Tips on developing/prototyping mobile applications

test [edit]

Making a basic persistent TinyWebDB Service

MIT App Inventor supplies a basic TinyWebDB instance for students to play with but it won't persist values ey paris for more than a few days in most cases.  Although beyond the scope of this article to make a fullly secure persistent TinyWebDB service, a basic serive can be set up to allow students to play around with more persistent application setting that are controlled by contecting to data in th eCloud/on he web.

This service setup assumed CentOS 9 Stream, with
apache2, php.

Note SELinux may require making certain foler/files more accessble after configurtion,
check your Linux distribution accoridngly.

<Directory "/public/xyz/site">
    AllowOverride all
    Options Indexes FollowSymLinks
    Require all granted
</Directory>

<VirtualHost *:80>
    ServerName tinywebdb.xyz.org
    DocumentRoot /public/xyz/site
    ErrorLog  "/var/log/httpd/xyz-error_log"
    CustomLog "/var/log/httpd/xyz-access_log" common
</VirtualHost>



$ git clone https://github.com/TinyWebDB/tinywebdb-php.git

  [ may need to make _data, and _log sub-folder writable ]

$ ls -Zlh

  [ will show the SELinux security contexts ]

# chcon -R -h -t httpd_sys_content_t /public/suhsd/site

# chcon -R -h -t httpd_sys_rw_content_t /public/suhsd/site/_data

# chcon -R -h -t httpd_sys_rw_content_t /public/suhsd/site/_log

Related
  - httpd can't write to folder/file because of SELinux
    https://unix.stackexchange.com/questions/50639/httpd-cant-write-to-folder-file-because-of-selinux
  - https://github.com/TinyWebDB/tinywebdb-php.git

When testing using the direct web interface, be careful to pad values (not their tag) with extra double quotes.  Although the data store service should already enquote both tag and value, MIT App Inventor expects value to have an extra layer of double quotes.