###################################### MRBS ##############################################

~Meeting Room Booking System

# The MRBS allows the user to register and book meeting rooms using PHP and MySQL (or 
#  another database) through a web page (provided by Apache or a similar software).


#### basic MRBS configuration:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

# This installation requires the server to have Apache (with PHP enabled) and MySQL 
#  installed/configured.
# (optional) install a standard-configured version of the requisites (Apache/PHP/MySQL):
apt install mysql-server apache2 libapache2-mod-php php php-mysql -y

### confirm which is the last version of MRBS at https://mrbs.sourceforge.io/download.php and 
###  download it: 
wget https://sourceforge.net/projects/mrbs/files/mrbs/MRBS%201.11.5/mrbs-1.11.5.tar.gz

### unpack the sofware into a temporary directory:
mkdir /temp                                    ###create the temp directory
tar -xvzf ./mrbs-1.11.5.tar.gz -C /temp

### copy the /web folder to a directory accessible by your web server (ex.: Apache) and change
###  its name to the desirable name (ex.: mrbs):
cp -r /temp/mrbs-1.11.5/web/ /var/www/html/mrbs/

### create the MySQL database with a name of your choice (ex.: mrbs):
echo "create database mrbs" | mysql -u username -p   #option 1, requires password matching the username
echo "create database mrbs" | mysql -u root          #option 2, does not require password by 
                                                     # default (this option will be used in this guide)

### copy the content of the file /temp/mrbs-1.11.5/tables.my.sql and paste it into MySQL
###  to create the database tables:
mysql -u root mrbs < /temp/mrbs-1.11.5/tables.my.sql    #using option 2, with 'root' and no password

# (optional) create a username and password for the interaction between MRBS application and 
#  MySQL database:
echo "CREATE USER 'mrbs'@'%' IDENTIFIED BY 'mrbs-password'" | mysql -u root
echo "GRANT ALL PRIVILEGES ON mrbs.* TO 'mrbs'@'%'" | mysql -u root

### copy the configuration file sample to the effective configuration file and edit it:
cp /var/www/html/mrbs/config.inc.php-sample /var/www/html/mrbs/config.inc.php
nano /var/www/html/mrbs/config.inc.php
## what to edit in it:
$timezone = "Europe/London";      //uncomment this line and, if necessary, change the timezone
$db_database = "mrbs";            //make sure the database name is correct
$db_login = "mrbs";               //set the database login username
$db_password = 'mrbs-password';   //set the database login password

### in a browser, type the following address and you'll be redirected to create an admin user:
http://your_server_IP/mrbs/
# the same address is now enabled to work with the application MRBS!

# delete the temporary directory:
rm -rf /temp
#########################################################################################
      
	

~~~~~~~~~~MRBS Script:~~~~~~~~~~

ATTENTION: Always read a script before you run it!!!


To run a basic MRBS configuration script, run the following command line in your server's terminal:

     wget -nc https://www.maycke.com.br/guides/raw/mrbs.sh && chmod 700 mrbs.sh && sudo ./mrbs.sh && sudo rm mrbs.sh

#########################################################################################