]> lifelog.hopto.org Git - LifeLog.git/commitdiff
upd.
authorwbudic <redacted>
Wed, 11 Aug 2021 06:56:47 +0000 (16:56 +1000)
committerwbudic <redacted>
Wed, 11 Aug 2021 06:56:47 +0000 (16:56 +1000)
Installation.txt
Installation_PostgreSQL.txt [new file with mode: 0644]
README.md

index cb1438d63d93a19974ff8bd5a190b6e6e9e69012..3b82bbbea6209846730ff90cf29e853c73a71c12 100644 (file)
@@ -92,7 +92,7 @@ sudo cpan Compress::Zlib;
 sudo cpan IO::Compress::Gzip;
 sudo cpan IO::Prompter;
 sudo cpan IO::Interactive;
-#Disabled testing for now on ProgresSQL driver
+#Disabled testing for now on PostgreSQL driver
 sudo cpan -T DBD::Pg;
 
 
@@ -103,7 +103,7 @@ sudo cpan Crypt::CBC;
 #Install DBI module
 sudo cpan DBI;
 sudo cpan DBD::SQLite;
-#For ProgreSQL see Installation_ProgreSQL.txt before installing perl driver:
+#For PostgreSQL see Installation_PostgreSQL.txt before installing perl driver:
 #cpan DBD::Pg;
 
 #Final Perl Installation Notes
diff --git a/Installation_PostgreSQL.txt b/Installation_PostgreSQL.txt
new file mode 100644 (file)
index 0000000..6b68a7c
--- /dev/null
@@ -0,0 +1,81 @@
+# Notes
+
+PostgreSQL Server is a full database service solution (RDBSM). Handling interaction, like multiple enterprise schemas, databases, users and backups.
+These all are and can be handled outside the scope of the LifeLog application.
+However, it is not required or recommended to have a fully managed database system service, just to use for the LifeLog app.
+
+
+Modify the following anon driver property tag in dbLifeLog/main.cnf to specify:
+<<DBI_SOURCE<DBI:Pg:host=localhost>
+
+The alias is by default assumed the actual database name as well as the user.
+
+Modify the following anon property, to have the SQL Server provide multiple users as different aliases for the loging into a specified single database.
+<<DBI_MULTI_USER_DB<0>
+to something like, to make logins now for the database users:
+<<DBI_MULTI_USER_DB<lifelog>
+Where 'lifelog' is the server managed database.
+
+Hope all works for you, and happy logging!
+
+
+# Install PostgreSQL
+sudo mkdir /usr/include/postgresql
+## Create the file repository configuration:
+sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
+
+## Import the repository signing key:
+wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
+
+## Update the package lists:
+sudo apt-get update -y
+sudo apt upgrade -y
+
+## Install the latest version of PostgreSQL.
+## If you want a specific version, use 'postgresql-12' or similar instead of 'postgresql':
+sudo apt-get -y install libpq-dev
+sudo apt-get -y install postgresql-12
+
+## Optional -> Enable port 5432 for PG server for local network on server.
+sudo uwf allow 5432/tcp
+sudo vim /etc/postgresql/12/main/postgresql.conf to modify--> listen_addresses = '*'
+sudo vim pg_hba.conf ->
+host    all             all              0.0.0.0/0                       md5
+host    all             all              ::/0                            md5
+sudo service postgresql restart
+
+## Install required libpq-dev to compile test perl driver, later. 
+sudo apt install libpq-dev
+
+## Install perl driver.
+sudo cpan DBD::Pg;
+
+
+# To assign default Postgres SQL user roles.
+sudo -u postgres psql -c "ALTER USER  postgres PASSWORD 'postgres';"
+sudo -u postgres psql -c "CREATE ROLE lifelog WITH LOGIN SUPERUSER CREATEDB CREATEROLE INHERIT NOREPLICATION CONNECTION LIMIT -1 PASSWORD 'xxxxxxx'";
+sudo -u postgres psql -c "CREATE DATABASE lifelog;"
+sudo -u postgres psql -c "grant all privileges on database lifelog to lifelog;"
+
+## Start stop Postgres SQL
+sudo service postgresql start
+
+## Manually Obtain dep. if encountering lib problems. with i.e.:
+wget https://apt.postgresql.org/pub/repos/apt/pool/main/p/postgresql-12/libpq-dev_12.4-1.pgdg20.04+1_amd64.deb
+dpkg -i libpq-dev_12.4-1.pgdg20.04+1_amd64.deb
+###Than run again driver install
+sudo cpan DBD::Pg;
+
+# Installing pgAdmin4
+sudo apt install python3-pip
+sudo python3 -m pip install https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v4.30/pip/pgadmin4-4.30-py3-none-any.whl
+
+# Data directory location for backup
+sudo -u postgres psql -c "SHOW data_directory;" | grep -G /
+## Quick tar all
+sudo tar czvf ~/postgresql.db.backup.tar $(sudo -u postgres psql -c "SHOW data_directory;" | grep -G /)
+
+
+
+
+
index 4cb46be079720d3b382e108165c4d1161362d2fd..753065c179ca50a5928743327979113b758de87a 100644 (file)
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@ Preferably on a small inexpensive server connected to your local network.
 
 Written in Perl, easy to implement and modify.
 
-Latest stable version is **2.1** in **SUN** stage.
+Latest stable version is **2.3** in **SUN** stable stage.
 
 
 ## PC Requirements
@@ -14,10 +14,17 @@ Latest stable version is **2.1** in **SUN** stage.
 * Processor 1.2+ GHZ or better, 2+ cores.
 * Only 2 GB+ physical. 
  
-Setup is requiring some Perl knowledge to install and enable, and tweak this application. The main application sources are located in the ../htdocs/cgi-bin directory. Current unstable, development ver. 1.6 is in the GIT branch. The development and features are stable progressive, starting from Moon, Sun and finally Earth stable stage. This application was and is usable since its Moon stage.
-
-https://www.sqlite.org/index.html database is required to run this web application. Note this isn't a full on blown database server requirment, that runs in your background and uses your computers resources.
-
+Setup is requiring some Perl knowledge to install and enable, and tweak this application. The main application sources are located in the ../htdocs/cgi-bin directory.
+
+### Quick Setup
+  * After downloading this application and installing in a directory (default is **~/dev**), which both can be done with:
+  *  ```git clone https://github.com/wbudic/LifeLog.git```
+     *  Check here for further [instuctions](./Installation.txt).
+  * Before modifying any configuration, run the module installation and testing process.
+    *  ```./install_modules.sh```
+    *  This might be necessary after even upgrades. 
+    *  Upgrades support preserving of data, and migration to any possible new data structures, automatically.
+    *  Rolling back to an previous version even if not expected, it is not affected by any new modules you might have installed, down the track.
 ## What is the purpose of having this log kept?
 
 Here are some things that come to mind:
@@ -68,7 +75,7 @@ Here are some things that come to mind:
 
 ## Life Log version v.2.+
 
-* Mulitple SQL database support ready and tested, currently ProgreSQL, LightSQL (default).
+* Mulitple SQL database support ready and tested, currently PostgreSQL, LightSQL (default).
 * Data searches, views, updated, enhanced and upgraded.
 * Migration upgraded and test.
 * Cross version releases, automatic migration of data and structures.