This guide is to create a working Open enventory running on OS Raspbian on a Raspberry pi 3B (see https://www.raspberrypi.org/products/raspberry-pi-3-model-b/ for information on the RPi 3B)
Quad Core 1.2GHz Broadcom BCM2837 64bit CPU
Using SanDisk Ultra 64GB UHS-I/Class 10 Micro SDXC Memory Card as boot and home drive
Flash a fresh copy of Raspbian onto the micro SD card. (A guide for completing this task can be found here https://www.raspberrypi.org/documentation/installation/installing-images/.
Raspbian image found at https://www.raspberrypi.org/software/operating-systems/ We used "Raspberry Pi OS with desktop and recommended software" zip file
use zip file with balenaetcher to flash to micro SD
2. Once flashed insert micro SD into the RPi 3B and boot the device with monitor connected. If install completed you should now see the Raspbian desktop as shown below.
3. The first thing that should be done is to update the OS
open a terminal window by clicking on terminal icon on top bar or by pressing ctl+alt+t
run the following commands
sudo apt-get updatesudo apt-get upgrade
4. After the update has completed we will create a LAMP server on the pi. This was completed following this guide (https://projects.raspberrypi.org/en/projects/lamp-web-server-with-wordpress)
Complete the steps to set up the Apache server, install PHP, and install MYSQL mysql is outdated trying the command in the above link will give you an error use the following instead to setup the mariadb and mysql (NOTE: Wordpress does not need to be installed)
sudo apt-get install mariadb-server-10.0
5. Install the following packages to prepare for Open enventory
sudo apt-get install -y php-mysql php-gd php-mbstring php-pear ghostscript imagemagicksudo service apache2 restart
6. Create MYSQL root pwd by entering the following command in terminal the default password is blank. We will subsequently set it up so sudo is not required so that we can login online to create our databases for oe. When asked for a password after command 4, use the password we just set up for
sudo mysql_secure_installationsudo service apache2 restartsudo service mariadb restartsudo mysql -u root -pMariaDB [(none)]> USE mysql;MariaDB [mysql]> UPDATE user SET plugin='mysql_native_password' WHERE User='root';MariaDB [mysql]> FLUSH PRIVILEGES;MariaDB [mysql]> exit;sudo service mariadb restart
7. Download Open Enventory image and set up on apache server (exact link to download can be found at https://sourceforge.net/projects/enventory/files/?source=navbar) (NOTE: in terminal commands below, the
open_enventory_2019-07-24.zipshould be replaced with the version you wish to use)
- Once downloaded unzip and copy to the right location which we will need to make.
cd ~/Downloads/wget https://sourceforge.net/projects/enventory/files/open_enventory_2019-07-24.zipunzip open_enventory_2019-07-24.zipsudo mkdir /var/www/html/oesudo cp -r ~/Downloads/open_enventory_2019-07-24/. /var/www/html/oe
8. Now go to the http://xx.xx.xx.xx/oe
To find the ip address of your raspberry pi on your local network run the following command. The result will yield many things we only care about the ip address number directly following
going to servers address in a browser on a device on the local network will look like the following
9. If successful after clicking inventory you should see the following page
10. Modify .htaccess file
sudo nano /var/www/html/oe/.htaccess
Modify the content of the file as in this screenshot. Important: these settings are for the server with configuration as indicated in the top of this tutorial
Save the file by typing ctrl+o then hitting the enter key then exit by typing ctrl+x. You will then have to tell the raspberry pi to use the settings in the .htaccess file. Navigate to 000-default.conf and add add the Directory lines so that the file is identical to the image below.
sudo nano /etc/apache2/sites-available/000-default.conf
Then restart the apache server
sudo service apache2 restart
11. Note this can only be accessed on the local server if you wish to access the OE database on any network you can set up ngrok. If you sign up you can use the given link indefinitely, and using https://freedns.afraid.org/ you can make a DNS to access the database easily.
12. Install ngrok (see https://thisdavej.com/how-to-host-a-raspberry-pi-web-server-on-the-internet-with-ngrok/ for more details)
sudo npm install --unsafe-perm -g ngrok
13. Start the ngrok server
ngrok http 80
the output should look as follows (note if you close the terminal window the session will be closed
by navigating to the link provided by your output in a web browser with the directory oe for this example it would be
http://2057a4d3.ngrok.io/oe should get you to the open enventory login page from any device on any network.