Bellow you can find all the steps needed to be done in order to build the GNWuorld (X and UWorld) Modules using a linux server.
Please keep in mind that the IP Address of the machine used for this HOWTO is 192.168.1.133 and it should be changed with the IP address of the machine where you want to have gnuworld installed.
OK, now let`s proceed....
1. We need to make sure that the server is update - to - date:
- apt update
- apt upgrade
- apt install build-essential
- apt install wget git libssl1.1 libssl-dev openssl bison libreadline-dev zlib1g-dev automake make flex mlocate byacc libxmlsec1 libxmlsec1-dev liboath-dev liboath0 libboost-all-dev
- apt install postgresql-server-dev-13 postgresql-client-13 postgresql postgresql-contrib
- systemctl start postgresql
- systemctl enable postgresql
- nano /etc/postgresql/13/main/postgresql.conf
port = 5432
Save the file and close it.
- nano /etc/postgresql/13/main/pg_hba.conf
- Host all all 192.168.1.133/32 trust
Now we restart PgSQL Server:
- systemctl restart postgresql
- su - postgres
- psql
- create user gnuworld;
- CREATE DATABASE cservice with OWNER='gnuworld' ENCODING='SQL_ASCII' LC_COLLATE='en_US.UTF-8' LC_CTYPE='en_US.UTF-8' TEMPLATE=template0;
- CREATE DATABASE ccontrol with OWNER='gnuworld' ENCODING='SQL_ASCII' LC_COLLATE='en_US.UTF-8' LC_CTYPE='en_US.UTF-8' TEMPLATE=template0;
- CREATE DATABASE local_db with OWNER='gnuworld' ENCODING='SQL_ASCII' LC_COLLATE='en_US.UTF-8' LC_CTYPE='en_US.UTF-8' TEMPLATE=template0;
postgres=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+----------+-----------+-------------+-------------+-----------------------
ccontrol | gnuworld | SQL_ASCII | en_US.UTF-8 | en_US.UTF-8 |
cservice | gnuworld | SQL_ASCII | en_US.UTF-8 | en_US.UTF-8 |
local_db | gnuworld | SQL_ASCII | en_US.UTF-8 | en_US.UTF-8 |
postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
We exit pgsql console:
Type exit to return to root account
Now we add user GNUWorld on Linux Server:
- adduser gnuworld
- su - gnuworld
- git clone https://github.com/ZioNeL/gnuworld-enhanced
- cd gnuworld-enhanced
- ./configure --with-pgconfig=/usr/lib/postgresql/13/bin/pg_config --enable-modules=cservice,ccontrol,openchanfix --with-liboath --with-liboath-lib=/usr/lib/ --with-liboath-include=/usr/include/
- nano mod.cservice/cservice_config.h
- change #undef TOTP_AUTH_ENABLED to #define TOTP_AUTH_ENABLED
- make
- make install
##if you selected step 3.1 skip step 3.2
3.2 # Run the following command if you build gnuworld WITHOUT TOTP Support and skip step 4.1
- ./configure --with-pgconfig=/usr/lib/postgresql/13/bin/pg_config --enable-modules=cservice,ccontrol,openchanfix
- make
- make install
## run the following commands under user gnuworld !!!
- cd gnuworld/doc
- psql -h 192.168.1.133 -U gnuworld cservice < cservice.sql
- psql -h 192.168.1.133 -U gnuworld cservice < languages.sql
- psql -h 192.168.1.133 -U gnuworld cservice < language_table.sql
- psql -h 192.168.1.133 -U gnuworld cservice < cservice.help.sql
- psql -h 192.168.1.133 -U gnuworld cservice < cservice.web.sql
- psql -h 192.168.1.133 -U gnuworld cservice < cservice.config.sql
- psql -h 192.168.1.133 -U gnuworld cservice < greeting.sql
- nano cservice.addme_sql
- replace "Admin" with your desired username (ex. ZioN)
- psql -h 192.168.1.133 -U gnuworld cservice < cservice.addme-new.sql
4.2 ## Building ccontrol (UWorld) database !!!
- psql -h 192.168.1.133 -U gnuworld ccontrol < ccontrol.sql
- psql -h 192.168.1.133 -U gnuworld ccontrol < ccontrol.help.sql
- psql -h 192.168.1.133 -U gnuworld ccontrol < ccontrol.shells.sql
- nano ccontrol.addme_sql
- replace "Admin" with your desired username (ex. ZioN)
- psql -h 192.168.1.133 -U gnuworld ccontrol < ccontrol.addme.sql
- psql -h 192.168.1.133 -U gnuworld ccontrol < ccontrol.commands.sql
Skip this step ONLY if you already done it when you set the webpage !!!
4.3 ## Building local_db (Website) database !!!
- psql -h 192.168.1.133 -U gnuworld local_db < local_db.sql
5. GNUWorld config files needed to be edited before running gnuworld.
- cd gnuworld/bin
- cp cservice.example.conf cservice.conf
- nano cservice.conf
5.2 ## edit ccontrol.conf with your needed settings for your network.
- cp ccontrol.example.conf ccontrol.conf
- nano ccontrol.conf
5.3 ## edit GNUWorld.conf with your needed settings for your network. Enable modules ccservice and ccontrol:
- cp GNUWorld.example.conf GNUWorld.conf
- nano GNUWorld.conf
6. Starting GNUWorld
## If GNUWorld.conf , cservice.conf and ccontrol.conf files are set please proceed with starting GNUWorld, if NOT, please go back to step 6.
## to start gnuworld type te following command:
- ./gnuworld
7. X- AUTHENTICATION FAILED as admin (IPR)
- su - gnuworld
- pico ipr.sql
- insert into ip_restrict (id, user_id, added_by, added, type, expiry, value) values (1, 1, 1, now()::abstime::int4, 1, 0, ‘192.168.1.133’);
- /usr/local/pgsql/bin/psql -h 192.168.1.133 cservice < ipr.sql
Enjoy.
This HOWTO was last updated by ZioN
22 Aug 2023