Skip to content

Instantly share code, notes, and snippets.

@muse-sisay
Last active June 12, 2022 01:43
Show Gist options
  • Save muse-sisay/eb284bbdbd293b249f7739b3e9b72ee7 to your computer and use it in GitHub Desktop.
Save muse-sisay/eb284bbdbd293b249f7739b3e9b72ee7 to your computer and use it in GitHub Desktop.
Rosariosis Installation Guide

Rosariosis Installation Guide

Rosariosis is a full-featured Student Information System. GitHub

This is a detailed Rosariosis installation guide for openSUSE and RedHat based distributions. The offical Rosariosis guide can be found here.

Table of Contents

Rosariosis Installation Guide for openSUSE 15.3

Installing required packages

You might want to switch to the root user before preceding. sudo su -


  • Start by installing postgresql and php. The package names are postgresql-server and php. It is recommended to install postgresql-contrib package which several additional features for PostgreSQL
zypper install -y postgresql-server php7 postgresql-contrib
  • Next install PHP extensions that are required by Rosariosis
zypper install -y php7-pgsql php7-gettext php7-mbstring php7-gd \
php7-curl php7-xmlrpc php7-zip php7-fpm php7-openssl
  • And last install a our nginx server and git
zypper install -y nginx git-core

Initialize database

  • Enable and start Prostgresql
systemctl enable --now  postgresql

Create database and the database user

  • Start by switching to the user postgres and run the psql command.
su - postgres
psql
  • Create an application user. Don't forget to change the username (rosariosis_user) and password to.
CREATE USER rosariosis_user WITH PASSWORD 'tux';
  • Create Postgress database for Rosariosis. Replace rosariosis_user with the user you created in the previous step.
CREATE DATABASE rosariosis_db WITH ENCODING 'UTF8' OWNER rosariosis_user;

then logout of psql by typing \q. Don't forget to exit out of PostgreSQL shell and back to your root.


  • Replace /var/lib/pgsql/data/pg_hba.conf with the following.
# To overwrite the contents of the file and open for editing
> /var/lib/pgsql/data/pg_hba.conf && nano /var/lib/pgsql/data/pg_hba.conf
# DO NOT DISABLE!
# If you change this first entry you will need to make sure that the
# database superuser can access the database using some other method.
# Noninteractive access to all databases is required during automatic
# maintenance (custom daily cronjobs, replication, and similar tasks).
#
# Database administrative login by Unix domain socket
local   all             postgres                                peer

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     md5
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     postgres                                peer
#host    replication     postgres        127.0.0.1/32            md5
#host    replication     postgres        ::1/128                 md5

Refer issue here | Solution Gist

  • Restart PostgreSQL
systemctl restart postgresql.service

Download RosarioSIS

  • Clone the repo
cd /srv/www/htdocs
git clone https://gitlab.com/francoisjacquet/rosariosis.git
  • Make a copy of config.inc.sample.php and replace database name, user and password with values you created earlier.
cd rosariosis/
cp config.inc.sample.php config.inc.php

Setup web server and php-fpm

  • Create a "virtual host" for rosariosis in /etc/nginx/conf.d/rosariosis.conf . In my case nginx will be listening on port 8080;
nano /etc/nginx/conf.d/rosariosis.conf
server {

 # Change this directive if you want
 # nginx to serve on a diffrent port
 listen       8080;

 # replace with your domain, if you have
 #server_name  example.com www.example.com;

 root         /srv/www/htdocs/rosariosis;
 index        index.php

 access_log /var/log/nginx/rosariosis_access.log;
 error_log /var/log/nginx/rosariosis_error.log;

 location / {
 }

 location ~* \.php$ {

  # With php-fpm unix sockets
  fastcgi_pass unix:/var/run/php-fpm/www.sock;
  include         fastcgi_params;
  fastcgi_param   SCRIPT_FILENAME    $document_root$fastcgi_script_name;
  fastcgi_param   SCRIPT_NAME        $fastcgi_script_name;

 }
}
  • To make sure our configuration file doesn't have any syntax error, run
nginx -t 
  • Random commands without explanation, there are somethings in this life you just have to do that is beyond your understanding. This happens to be one of them. I would be happy if someone could explain it to me.
cp /etc/php7/fpm/php-fpm.conf.default /etc/php7/fpm/php-fpm.conf 
cp /etc/php7/fpm/php-fpm.d/www.conf.default /etc/php7/fpm/php-fpm.d/www.conf
  • Changing the listening directive's /etc/php7/fpm/php-fpm.d/www.conf. They are on different lines
listen = /var/run/php-fpm/www.sock
listen.owner = nginx
listen.group = nginx
  • Start the web server and php-fpm
systemctl enable --now nginx
systemctl enable --now  php-fpm.service

Add firewall rule

firewall-cmd --add-port=8080/tcp --permanent 
firewall-cmd --reload

Next test is to populate the database with some records, point your browser to: http://yourdomain.com/InstallDatabase.php or http://ip-address:port/InstallDatabase.php

That's it!... now, point your browser to: http://yourdomain.com/index.php or http://ip-address:port/index.php

The default username and password combination is admin admin.

Rosariosis Installation Guide for RedHat based distributions

Linux localhost.localdomain 4.18.0-305.el8.x86_64 #1 SMP \
Thu Apr 29 08:54:30 EDT 2021 x86_64 x86_64 x86_64 GNU/Linux
  • Required packages
    • git
    • nginx
    • postgresql-server
    • php
    • and some php extensions

install packages

  • Start by installing required packages for RosarioSIS. The packages are postgresql and php.
    The package names are postgresql-server and php. It is recommended to also install postgresql-contrib with contains several features for postgresql
yum install -y postgresql-server php postgresql-contrib
  • PHP extensions
yum install -y php-pgsql php-gettext php-mbstring php-gd \
php-curl php-xmlrpc php-xml php-zip
  • web server
yum install -y nginx

init database

  • Initalize the database
postgresql-setup --initdb --unit postgresql
  • Enable the service
systemctl enable --now  postgresql
  • Check the version of postgresql. Recommended version for rosariosis is need_to_check
sudo -u postgres psql -c "SELECT version();"

Create database user and a database

sudo -u postgres psql
  • Create a rosariosis user with password. Replace rosariosis_user
CREATE USER rosariosis_user WITH PASSWORD 'tux';
  • Create the rosariosis database
CREATE DATABASE rosariosis_db WITH ENCODING 'UTF8' OWNER rosariosis_user;

then logout \q

  • On line 80 of vim /var/lib/pgsql/data/pg_hba.conf change peer to md5 as per RosarioSIS setup guide. (Edit.. this was the root cause of my pain, just replace the file with this) Answer Gist
# DO NOT DISABLE!
# If you change this first entry you will need to make sure that the
# database superuser can access the database using some other method.
# Noninteractive access to all databases is required during automatic
# maintenance (custom daily cronjobs, replication, and similar tasks).
#
# Database administrative login by Unix domain socket
local   all             postgres                                peer

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     md5
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     postgres                                peer
#host    replication     postgres        127.0.0.1/32            md5
#host    replication     postgres        ::1/128                 md5
  • Restart postgresql
systemctl restart postgresql.service

RosarioSIS install

  • Clone the repo
cd /var/www/html
git clone https://gitlab.com/francoisjacquet/rosariosis.git
  • Make changes to the configuration file config.inc.sample.php rename it to config.inc.php

Setup webserver

  • creat a "virtual host" for rosariosis. In my case nginx is listening on port 8080. save in /etc/nginx/conf.d/rosariosis.conf
server {
 listen       8080;
 # replace with your domain
 #server_name  example.com www.example.com;
 root         /var/www/html/rosariosis;

 #access_log /var/log/somewhere;
 #error_log /var/log/somewhere;
 location / {
 }

 location ~* \.php$ {
 # With php-fpm unix sockets
 fastcgi_pass unix:/run/php-fpm/www.sock;
 include         fastcgi_params;
 fastcgi_param   SCRIPT_FILENAME    $document_root$fastcgi_script_name;
 fastcgi_param   SCRIPT_NAME        $fastcgi_script_name;
 }
}
  • check our virtual host for syntax error
nginx -t 
  • Start the webserver and php-fpm
systemctl enable --now nginx
systemctl enable --now  php-fpm.service

To install the database, point your browser to: http://yourdomain.com/InstallDatabase.php

That's it!... now, point your browser to: http://yourdomain.com/index.php

and login as 'admin' password 'admin'. With this login, you can create new users, and change and delete the three template users.

todo

  • install wkhtmltopdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment