Web Notes
2022.03.01
Deploying Nextcloud with PlanetScale cloud database
Notes of Nextcloud installation on Ubuntu server with Nginx web server and PlanetScale cloud database.
h5ai as a simple cloudstorage
h5ai is a modern file indexer for HTTP web servers with focus on your files. Directories are displayed in a appealing way and browsing them is enhanced by different views, a breadcrumb and a tree overview.
Once I have tried h5ai on Heroku, but this time I would like to use it as my file indexer on a “real” server together with Nginx reverse proxy.
h5ai requires PHP 5.5+. On Ubuntu, that’s simple:
sudo apt install php-fpm
cd /var/www && mkdir h5ai && cd h5ai
wget https://release.larsjung.de/h5ai/h5ai-0.29.2.zip
unzip h5ai-0.29.2.zip && rm h5ai-0.29.2.zip
sudo
permissions may required. wget
& unzip
commands only work if you have installed them through apt install ****
.
Latest h5ai release could get from https://larsjung.de/h5ai/.
Now setup a new virtual host with Nginx.
sudo nano /etc/nginx/conf.d/h5ai.conf
Copy the following configuration:
server {
listen 80;
index index.php /_h5ai/public/index.php;
server_name h5ai.example.com; # change to your own domain
root /var/www/h5ai;
# individual nginx logs for this vhost
access_log /var/log/nginx/h5ai.example.com_access.log; # change to your own domain
error_log /var/log/nginx/h5ai.example.com_error.log; # change to your own domain
location /_h5ai/private {
return 403;
}
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
fastcgi_param HTTP_PROXY "";
fastcgi_pass unix:/run/php/php7.1-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
Check the configuration with sudo nginx -t
.
Change file permissions to the h5ai folder:
sudo chown -R www-data:www-data /var/www/h5ai
Reload Nginx to make the virtual host alive:
sudo systemctl reload nginx
Visit http://h5ai.example.com/_h5ai/public/index.php, to check if h5ai is reachable. This page shows some hints on the server’s capabilities.
The main configuration file is _h5ai/private/conf/options.json
. You might want to change some of the documented settings. But there are some more files in _h5ai/private/conf
you might have a look at.
Frank Lin, PhD
Web Notes
2022.03.01
Notes of Nextcloud installation on Ubuntu server with Nginx web server and PlanetScale cloud database.
Tutorials
2017.04.20
I've known Heroku for a long time, but never have a try to build with it. This time, I found a beautiful file indexer, h5ai, that requires PHP 5.5+, and Heroku is a perfect platform to build and host it.
Tutorials
2020.01.09
IKEv2, or Internet Key Exchange v2, is a protocol that allows for direct IPSec tunnelling between two points. In IKEv2 implementations, IPSec provides encryption for the network traffic. IKEv2 is natively supported on some platforms (OS X 10.11+, iOS 9.1+, and Windows 10) with no additional applications necessary, and it handles client hiccups quite smoothly.