-
apt update
-
apt install postgresql postgresql-contrib (150 Mb)
-
systemctl start postgresql.service
-
systemctl enable postgresql.service
-
systemctl status postgresql.service
-
sudo -i -u postgres
psql
SELECT version(); (>=13)
- apt install postgresql-server-dev-XX (700 Mb)
cd /tmp
git clone --branch v0.8.0 https://github.com/pgvector/pgvector.git
cd pgvector
make
make install # may need sudo
- sudo -i -u postgres (with sudo!)
psql
CREATE EXTENSION vector; # create the vector extension
SELECT * FROM pg_available_extensions;
SELECT * FROM pg_extension;
/dx
CREATE TABLE items (aaaa bigserial PRIMARY KEY, bbbb vector(3));
INSERT INTO items (bbbb) VALUES ('[1,2,3]'), ('[4,5,6]');
SELECT * FROM items ORDER BY bbbb <-> '[3,1,2]' LIMIT 5;
ALTER USER postgres WITH PASSWORD 'new_pass';
CREATE USER helloIam11Admin2 WITH PASSWORD 'ololo2';
ALTER USER helloIam11Admin2 WITH SUPERUSER;
CREATE DATABASE FBD2 OWNER helloIam11Admin2;
\du
\q
-
apt install nginx (1.18.0)
-
systemctl enable nginx
-
systemctl start nginx
-
systemctl status nginx
-
apt install phppgadmin php php-fpm php-pgsql
-
php --version (8.1.2)
-
nano /etc/nginx/sites-available/nero2auto.conf
server {
listen 80;
server_name nero2auto.duckdns.org;
location /phppgadmin/ {
alias /usr/share/phppgadmin/;
index index.php;
location ~ \.php$ {
fastcgi_read_timeout 360;
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
}
}
}
-
ln -s /etc/nginx/sites-available/nero2auto.conf /etc/nginx/sites-enabled/
-
chown -R www-data:www-data /usr/share/phppgadmin
-
chmod -R 755 /usr/share/phppgadmin
-
nginx -t
-
systemctl restart nginx
-
apt install certbot python3-certbot-nginx
-
certbot --nginx -d nero-n8n.duckdns.org
-
nginx -t
-
systemctl restart nginx
-
nano /etc/phppgadmin/config.inc.php
$conf['extra_login_security'] = false;