Skip to main content

Installing BibleSuperSearch on Debian

Basic software

  • Apache2
  • MariaDB
sudo apt update && sudo apt install apache2 mariadb-server

Laravel dependencies

Reference: https://shape.host/resources/laravel-setup-debian-12-tutorial

Install Laravel dependencies:

sudo apt install php php-curl php-bcmath php-json php-mysql php-mbstring php-xml php-tokenizer php-zip php-gd php-sqlite3

Bible SuperSearch source

Install Bible SuperSearch source files:

Extract and copy to:

/var/www/html/biblesupersearch_api/

/var/www/html/biblesupersearch_client/

This assumes you're using the default site, otherwise copy into the directory for whichever Apache 'site' is enabled.

Configure Apache

Edit apache.conf:

sudo nano /etc/apache2/apache2.conf

AllowOverride All:

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride All # change from None to All
        Require all granted
</Directory>

Configure PHP:

sudo a2enmod php8.2 # change 8.2 to your version
sudo a2enmod rewrite
sudo systemctl restart apache2

Restart Apache:

sudo systemctl restart apache2

Configure MariaDB

References:

Start the MariaDB installation:

sudo mysql_secure_installation

Answer the following prompts:

  • Enter current password for root (enter for none): Leave blank, press enter
  • Switch to unix_socket authentication [Y/n] n Not necessary, enter n
  • Change the root password? [Y/n] n Should not change, enter n
  • Enter Y (default) for all remaining questions

Start the DB prompt:

sudo mariadb

Create an admin account (set my_admin_password):

GRANT ALL ON *.* TO 'admin'@'localhost' IDENTIFIED BY '<my_admin_password>' WITH GRANT OPTION;

Create a biblesupersearch user (set my_password):

CREATE USER 'biblesupersearch'@'localhost' IDENTIFIED BY '<my_password>';

Create a biblesupersearch database:

CREATE DATABASE biblesupersearch;

Grant privileges:

GRANT ALL PRIVILEGES ON biblesupersearch.* TO 'biblesupersearch'@'localhost';

Flush privileges:

FLUSH PRIVILEGES;

Exit the DB prompt:

exit

Configure Bible SuperSearch

Change directory to the root API directory:

cd /var/www/html

Copy .env.example to .env and edit:

sudo cp .env.example .env
sudo nano .env

Update the following lines:

APP_URL=http://bible.local/biblesupersearch_api/ # or whatever your root path is
DB_DATABASE=biblesupersearch
DB_USERNAME=biblesupersearch
DB_PASSWORD=<my_password> # whatever database password was configured

Change ownership recursively to the httpd user (www-data) for biblesupersearch_api and biblesupersearch_client directories:

sudo chown -R www-data biblesupersearch_*

Bible SuperSearch admin console

Open the /public directory in a browser (relative to whatever the root path is):

 http://bible.local/biblesupersearch_api/public

If you get a 404 Not Found error, try appending /index.php.  If that appears to work, then Apache is not rewriting Laravel routes correctly.  This will need to be troubleshot and fixed before the admin console will work correctly.

Bible SuperSearch client

In the biblesupersearch_client directory, copy config-example.js to config.js and edit the following in config.js:

    "apiUrl": "http://bible.local/biblesupersearch_api/public",

As a bug-workaround for Linux web clients, change client.os.toLowerCase() to client.os in biblesupersearch.js

At this point you should be able to open http://bible.local/biblesupersearch_client/ and see a functioning example!