Bellow you can find all the steps needed to be done in order to build thr CService (X) WebPage using Mint 21.1 linux server and PHP 8.1 version.
Please keep in mind that the IP Address of the machine used for this HOWTO is 192.168.1.122 and it should be changed with the IP address of the machine where you want to have the webpage installed.
OK, now let`s proceed....
1. First we ensure that we have everything installed :
php7.4, apache2 Server, Postgresql, composer
- apt install build-essential
- apt install net-tools
- apt install software-properties-common
- apt install apache2 apache2-bin apache2-data apache2-dev apache2-doc apache2-ssl-dev apache2-utils libapache2-mod-php php php-cgi php-cli php-common php-gd php-pgsql php-curl php-dev php-json php-readline php-mysql php-xml php-xmlrpc php-sqlite3 git flex bison libreadline-dev libssl-dev mlocate openssl zlib1g zlib1g-dev
- pico /etc/php/8.1/apache2/php.ini file and change value "short_open_tag = Off" in "short_open_tag = On"
- service apache2 restart
2. Now we proceed with installing composer as root:
- curl -sS https://getcomposer.org/installer | php && mv composer.phar /usr/local/bin/composer
3. Install Postgresql 14 :
- apt install postgresql-client postgresql-client-common postgresql-common postgresql postgresql-server-dev-all libboost-all-dev
- cd /etc/postgresql/14/main/
- nano pga_hba.conf
- Host all all 192.168.1.133/32 trust
Open postgresql conf file and set the host/ip that pgsql runs under:
- nano postgresql.conf
Save and close the file
Now we restart postgresql service:
- service postgresql restart
- service postgresql status
- su - postgres
- psql
- create user gnuworld;
- CREATE DATABASE local_db with OWNER='gnuworld' ENCODING='SQL_ASCII' LC_COLLATE='en_US.UTF-8' LC_CTYPE='en_US.UTF-8' TEMPLATE=template0;
- \q
4 .We get the webpage source code from UniversalNet Official GitHub under user gnuworld:
- su - gnuworld
- git clone https://github.com/UndernetIRC/cservice-web
- cd cservice-web/
- composer install
- cd php_includes/
- cp config.inc.dist config.inc
- cp cmaster.inc.dist cmaster.inc
- cp blackhole.inc.dist blackhole.inc
- git clone https://github.com/UndernetIRC/gnuworld
- cd gnuworld/doc
- psql -h 192.168.1.133 -U gnuworld local_db < local_db.sql
- cd /var/www/html/
- chmod 711 ~gnuworld
- chmod 711 ~gnuworld/cservice-web
- chmod 755 ~gnuworld/cservice-web/php_includes
- chmod 644 ~gnuworld/cservice-web/php_includes/config.inc
- chmod 755 ~gnuworld/cservice-web/docs/gnuworld/
- ln -s /home/gnuworld/cservice-web/docs/gnuworld live
6. TThere are two options to solve (IPR) restriction, bellow you can find how to on both.
- 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.122’);
- /usr/local/pgsql/bin/psql -h 192.168.1.122 cservice < ipr.sql
6.2 - Fix (IPR) by disableing IPR option in config.inc file
- su - gnuworld
- cd gnuworld
- pico cservice_web/php_includes/config.inc
- change define("IPR_REQUIRED",1); to define("IPR_REQUIRED",0);
7 In order to permit login on CService Web from local IP address like 192.168.xx.xx or 10.0.0.xx the following changes must be made:
nano /home/gnuworld/cservice-web/php_includes/config.inc
# Replace define("DISALLOW_RESERVED_BLOCKS",1); to define("DISALLOW_RESERVED_BLOCKS",0);
Now login using * accounts from local IP address is possible.
This HOWTO was last updated by ZioN
15 Jan 2023