Brendon Martino - 2014-07-02

SdB Installation and Configuration Guide

  • Author: Brendon Martino
  • Date: 07/02/2014
  • License: The GNU General Public License v3 (GPL v3)

OS Setup

  • Install and configure your base OS. I have used Fedora in this example.

  • We will need several base package sets, including a few extra ones if we are using a VM:

* LAMP stack:
yum install httpd php-mysql php mysql mysql-server mysql-libs mysql-devel
  • Make sure you have the correct hostname and IP set on the server.
  • Edit your firewall (if needed) to allow traffic through port 80 (http).

  • Check php, mysql versions:

 php -v
PHP 5.4.17 (cli) (built: Jul 12 2013 15:29:27) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

mysql -V
mysql  Ver 14.14 Distrib 5.5.32, for Linux (i686) using readline 5.1
 

NOTE: MariaDB Replaced Mysql in Fedora 19+

  • Unzip the contents of the sdb project into the web directory:
su -
cd /var/www/html/
mkdir sdb
tar -xspvf sdbfiles-v7.October-28-2013.tar.gz ./sdb
ls -l ./sdb

-rw-rw-r--. 1 root root  17872 Oct 31 11:03 add_entry.php
.
.
.
-rw-rw-r--. 1 root root   8671 Oct 31 11:09 upload.php
 
  • Start mysql daemons:
service mysqld start
systemctl enable mysqld.service
 
  • Create a root account for mysql:
 bash# mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('your_password_goes_here') WHERE user='root';
mysql> FLUSH PRIVILEGES; 
mysql> exit;
 

Configure Mysql DB

  • Log into the mysql db and run the sql code to create the db we will be using.
  • The inventory.sql fiel can be found under the dir: /var/www/html/sdb/data
$ mysql -u root mysql -p

mysql> CREATE DATABASE sdb;
mysql> USE sdb;

* create tables listed in the inventory.sql file:

mysql> CREATE TABLE users ( 
 uid INT NOT NULL AUTO_INCREMENT PRIMARY KEY, 
 username VARCHAR(15) NOT NULL, 
 password VARCHAR(15) NOT NULL, 
 restricted_data_access BOOLEAN NOT NULL DEFAULT 0,
 edit_rights BOOLEAN NOT NULL DEFAULT 0  
);

* repeat for all tables in the db in the inventory.sql file...

* add an admin user, etc:
INSERT INTO sdb.users VALUES (NULL, 'admin', 'admin_password_goes_here', TRUE, TRUE );

* ...everything else can be configured through the app.
 

Fix the webroot

  • Create a redirect so the server points all root traffic to the app:
cd /var/www/html
vi index.html

<script language="javascript"> document.location.href="./sdb/login.php";</script>

Test the WebApp

Troubleshooting

  • If you can't get your webapp to work, check your firewall and selinux settings...
  • Try a sample HTML page and make sure everything works before testing the sdb application.

DONATE

PayPal Donations

 

Last edit: Brendon Martino 2014-07-09