How to install ospos on ubuntu 16.04

Install OSPOS

This guide shows you the easiest way to get OSPOS up and running on your server.
First we want to make sure all your software is up to date. Type:
apt-get update
apt-get dist-upgrade
Click Y when it asks if you want to continue. Press Enter if it asks you about any new versions of software.
Next we want to enable and/or install some modules.
First we want to enable the mod-rewrite module. Type:
a2enmod rewrite
Now we want to install some PHP modules. Type:
apt-get install php7.0-intl php7.0-mcrypt php7.0-bcmath php7.0-curl
Type "Y" when it asks if you want to continue.
Then we want to restart the Apache web server. Type:
service apache2 restart

Download OSPOS

You're now ready to download OSPOS. Start by changing to the var/www/html directory. Type:
cd /var/www/html
Then we want to delete the two files that are in there now.
rm index.html info.php
Now we want to download the latest released version of OSPOS (3.1.0). Type:
wget https://github.com/opensourcepos/opensourcepos/releases/download/3.1.1/opensourcepos.20170909085348.3.1.1.76a002.zip
To extract it, you need to install the zip program. Type:
apt-get install zip
Type "Y" when it asks if you want to continue. Now you want to unzip the file. Type:
unzip opensourcepos.20170909085348.3.1.1.76a002.zip
Now we want to delete the zip file. Type:
rm opensourcepos.20170909085348.3.1.1.76a002.zip
Finally, we want to change the document root. Type:
cd /etc/apache2/sites-available
We want to edit the 000-default.conf file using Nano. Type:
nano 000-default.conf
Change the DocumentRoot from /var/www/html to /var/www/html/public.
(Note: Make sure you have set up .htaccess files for the html directory. DigitalOcean does this for you automatically.)
Press Ctrl-x to exit. Make sure you save your changes.
Now we want to restart the Apache web server. Type:
service apache2 restart

Configure OSPOS

We need to know our MySQL root password.
Copy and paste what's between the quotation marks. Now we want to log in to MySQL. Type:
mysql -u root -p
Paste or enter your password when you're prompted. This will log you into the MySQL command prompot.
You'll want to enter the following SQL commands. (Note: "pointofsale" is your password. Feel to create a more secure password if you want.) Type:
CREATE DATABASE ospos;
CREATE USER 'admin'@'localhost' IDENTIFIED BY 'pointofsale';
GRANT ALL PRIVILEGES ON ospos.* TO 'admin'@'localhost';
FLUSH PRIVILEGES;
quit
This will log you out of MySQL. Now we want to import the OSPOS database.sql file. Type:
cd /var/www/html/database
mysql -u admin -p ospos < database.sql
Enter your password when you're prompted.
Now you want to edit your configuration files. Type:
cd ../application/config
If you used different database credentials, type:
nano database.php
Scroll down, and update the database connection. Look for some code that says $db['default']. Replace the username, password, and database with your credentials.
Press Ctrl-x to exit. Make sure you save your changes.
Now you want to add your encryption key. You can generate a CodeIgniter encryption key automatically using the Random Key Generator website. Type:
nano config.php
Find the code that says $config['encryption_key'] and add your key. Then press Ctrl-x to exit, making sure you save your changes.
Now you can visit your IP address in your browser. When you do, you'll see a login form.
Login Form
Login using these credentials:
Username: admin
Password: pointofsale

Popular Posts