30-04-2021



Local Deployment using MAMP for Windows. Download and Install MAMP then go to C:MAMPhtdocs and place the extracted folder of masterpos there. Now go to localhost/MAMP and then go to phpMyAdmin and create a database with any name and create a. LAMP and MAMP have been intended to serve the shortage with Linux and Mac. LAMP works only on Linux operating system. MAMP works perfectly on Mac OS and Windows operating system. Conclusion: As a result of the above, XAMPP stands out to be an excellent package for web development applications.

LAMP installations (Linux + Apache + MySQL + PHP/Perl/Python) are a popular setup for Ubuntu servers. There is a plethora of Open Source applications written using the LAMP application stack. Some popular LAMP applications are Wiki’s, Content Management Systems, and Management Software such as phpMyAdmin.

One advantage of LAMP is the substantial flexibility for different database, web server, and scripting languages. Popular substitutes for MySQL include PostgreSQL and SQLite. Python, Perl, and Ruby are also frequently used instead of PHP. While Nginx, Cherokee and Lighttpd can replace Apache.

The fastest way to get started is to install LAMP using tasksel. Tasksel is a Debian/Ubuntu tool that installs multiple related packages as a co-ordinated “task” onto your system. To install a LAMP server:

At a terminal prompt enter the following command:

After installing it you’ll be able to install most LAMP applications in this way:

  • Download an archive containing the application source files.

  • Unpack the archive, usually in a directory accessible to a web server.

  • Depending on where the source was extracted, configure a web server to serve the files.

  • Configure the application to connect to the database.

  • Run a script, or browse to a page of the application, to install the database needed by the application.

  • Once the steps above, or similar steps, are completed you are ready to begin using the application.

A disadvantage of using this approach is that the application files are not placed in the file system in a standard way, which can cause confusion as to where the application is installed. Another larger disadvantage is updating the application. When a new version is released, the same process used to install the application is needed to apply updates.

Fortunately, a number of LAMP applications are already packaged for Ubuntu, and are available for installation in the same way as non-LAMP applications. Depending on the application some extra configuration and setup steps may be needed, however.

This section covers how to install some LAMP applications.

phpMyAdmin is a LAMP application specifically written for administering MySQL servers. Written in PHP, and accessed through a web browser, phpMyAdmin provides a graphical interface for database administration tasks.

Installation

Before installing phpMyAdmin you will need access to a MySQL database either on the same host as that phpMyAdmin is installed on, or on a host accessible over the network. For more information see MySQL documentation. From a terminal prompt enter:

At the prompt choose which web server to be configured for phpMyAdmin. The rest of this section will use Apache2 for the web server.

In a browser go to http://servername/phpmyadmin, replacing servername with the server’s actual hostname. At the login, page enter root for the username, or another MySQL user, if you have any setup, and enter the MySQL user’s password.

Mamp For Ubuntu

Once logged in you can reset the root password if needed, create users, create/destroy databases and tables, etc.

Configuration

The configuration files for phpMyAdmin are located in /etc/phpmyadmin. The main configuration file is /etc/phpmyadmin/config.inc.php. This file contains configuration options that apply globally to phpMyAdmin.

Mamp

To use phpMyAdmin to administer a MySQL database hosted on another server, adjust the following in /etc/phpmyadmin/config.inc.php:

Note

Replace db_server with the actual remote database server name or IP address. Also, be sure that the phpMyAdmin host has permissions to access the remote database.

Once configured, log out of phpMyAdmin and back in, and you should be accessing the new server.

The config.header.inc.php and config.footer.inc.php files in /etc/phpmyadmin directory are used to add a HTML header and footer to phpMyAdmin.

Another important configuration file is /etc/phpmyadmin/apache.conf, this file is symlinked to /etc/apache2/conf-available/phpmyadmin.conf, and, once enabled, is used to configure Apache2 to serve the phpMyAdmin site. The file contains directives for loading PHP, directory permissions, etc. From a terminal type:

For more information on configuring Apache2 see this documentation.

References

  • The phpMyAdmin documentation comes installed with the package and can be accessed from the phpMyAdmin Documentation link (a question mark with a box around it) under the phpMyAdmin logo. The official docs can also be access on the phpMyAdmin site.

  • Another resource is the phpMyAdmin Ubuntu Wiki page.

Wordpress is a blog tool, publishing platform and CMS implemented in PHP and licensed under the GNU GPLv2.

Installation

To install WordPress, run the following comand in the command prompt:

You should also install apache2 web server and mysql server. For installing apache2 web server, please refer to Apache2 documentation. For installing mysql server, please refer to MySQL documentation.

Configuration

For configuring your first WordPress application, configure an apache site. Open /etc/apache2/sites-available/wordpress.conf and write the following lines:

Enable this new WordPress site

Once you configure the apache2 web server and make it ready for your WordPress application, you should restart it. You can run the following command to restart the apache2 web server:

To facilitate multiple WordPress installations, the name of this configuration file is based on the Host header of the HTTP request. This means that you can have a configuration per VirtualHost by simply matching the hostname portion of this configuration with your Apache Virtual Host. e.g. /etc/wordpress/config-10.211.55.50.php, /etc/wordpress/config-hostalias1.php, etc. These instructions assume you can access Apache via the localhost hostname (perhaps by using an ssh tunnel) if not, replace /etc/wordpress/config-localhost.php with /etc/wordpress/config-NAME_OF_YOUR_VIRTUAL_HOST.php.

Once the configuration file is written, it is up to you to choose a convention for username and password to mysql for each WordPress database instance. This documentation shows only one, localhost, example.

Now configure WordPress to use a mysql database. Open /etc/wordpress/config-localhost.php file and write the following lines:

Now create this mysql database. Open a temporary file with mysql commands wordpress.sql and write the following lines:

Execute these commands.

Your new WordPress can now be configured by visiting http://localhost/blog/wp-admin/install.php. (Or http://NAME_OF_YOUR_VIRTUAL_HOST/blog/wp-admin/install.php if your server has no GUI and you are completing WordPress configuration via a web browser running on another computer.) Fill out the Site Title, username, password, and E-mail and click Install WordPress.

Note the generated password (if applicable) and click the login password. Your WordPress is now ready for use.

References

Last updated 1 year, 20 days ago. Help improve this document in the forum.

If you are seeing the message system folder missing, then you have cloned the source using git and you need to run a build first. Check INSTALL.md for instructions or download latest zip file from bintray instead.

The installation is not correct, check your php.ini file

Accordion SamIf at login time you read “The installation is not correct, check your php.ini file.”, please check the error_log in public folder to understand what’s wrong and make sure you read the INSTALL.md. To know how to enable error_log, please read the comment in issue 1770.ple Description

If you installed your OSPOS under a web server subdir, please edit public/.htaccess and go to the lines with comment if in web root and if in subdir comment above line, uncomment below one and replace with your path and follow the instruction on the second comment line. If you face more issues please read issue #920 for more help.

Apache server configurations are SysAdmin issues and not strictly related to OSPOS. Please make sure you first can show a “hello world” html page before pointing to OSPOS public directory. Make sure .htaccess is correctly configured.

If the avatar pictures are not shown in Items or at Item save time you get an error, please make sure your public and subdirs are assigned to the correct owner and the access permission is set to 750.

If you install ospos in docker behind a proxy that performs ssloffloading, you can enable the url generated to be https instead of http, by activating the environment variable FORCE_HTTPS = 1.

If you have suhosin installed and face an issue with CSRF, please make sure you read issue #1492.

  1. Download and Install Wamp or Xampp
  2. Download and Install composer, node.js, grunt-cli
  3. Download the 'opensourcepos-master.zip' (~3mb) and extract it to www or htdocs directory
  4. Open command prompt in 'opensourcepos-master' directory and run the following commands.
    • composer install
    • npm install
    • grunt --force
  5. Create/locate a new mysql database to install open source point of sale into
  6. Execute the file database/database.sql to create the tables needed
  7. Modify application/config/database.php and modify credentials if needed to connect to your database
  8. Go to your point of sale install public dir via the browser LOGIN using username: admin password: pointofsale

Default Linux, Nginx, MariaDB, PHP7.0 & Adminer stack on Ubuntu 16.04

sudo apt-get update

sudo apt-get upgrade

sudo apt-get install nginx

After installation, enable Nginx to auto start when Ubuntu is booted

sudo systemctl enable nginx

Start Nginx with this command

sudo systemctl start nginx

Check out it's status

systemctl status nginx

Now in your browser’s address bar, type http://localhost or http://127.0.0.1 and hit enter

You will see 'Welcome to nginx!, that means nginx installed and running successfully.

Now, we need to make www-data (Nginx user) as the owner of web root directory

sudo chown www-data /var/www/html -R

sudo apt-get install mariadb-server mariadb-client

MariaDB server should be automatically started. Use systemctl to check its status.

systemctl status mysql

Enable MariaDB to automatically start when Ubuntu is rebooted

sudo systemctl enable mysql

Run the post installation security script

sudo mysql_secure_installation

When it asks you to enter MariaDB root password, press enter because you have not set the root password yet. Then enter y to set the root password for MariaDB server.

Next just press Enter to answer all the remaining questions. This will remove anonymous user, disable remote root login and remove test database. This step is a basic requirement for MariaDB database security.

sudo apt-get install php7.0-fpm php7.0-mbstring php7.0-xml php7.0-mysql php7.0-common php7.0-gd php7.0-json php7.0-cli php7.0-curl php7.0-intl php7.0-bcmath php7.0-mcrypt

Now start php7.0-fpm

sudo systemctl start php7.0-fpm

Check php7 status

systemctl status php7.0-fpm

Remove the 'default.conf' symlink in 'sites-enabled' directory

sudo rm /etc/nginx/sites-enabled/default

create a new default server block file under /etc/nginx/conf.d/ directory

sudo nano /etc/nginx/conf.d/default.conf

Paste the following text into the file, save and close the file

Test nginx configuration and reload it

sudo nginx -t

sudo service nginx restart

php --version

Ubuntu

Test PHP-FPM, first create a php_info.php file in the Web root directory

sudo nano /var/www/html/php_info.php

Paste the following PHP code into the file and save it

<?php phpinfo(); ?>

Now in the browser address bar, enter localhost/php_info.php. You should see your server’s PHP information. This means PHP is workinging fine. For your server’s security, you should delete php_info.php file now.

Adminer is a free opensource data base management tool like phpmyadmin. It is very ightweight and easy to install and also supports various themes. Download Adminer from here:

Place it in var/www/html folder. To access it, type in your browser localhost/adminer-4.2.5.php

Your Linux OS has a root user. MariaDB also has a root user. So sometimes, when you try to log into MariaDB monitor as root user, MariaDB may authenticate you via the Unix_Socket plugin but this plugin is not installed by default. So you see Plugin 'unix_socket' is not loaded Error.

Fix this error

First stop MariaDB, use this command to stop it.

sudo systemctl stop mysql

Then start MariaDB with --skip-grant-tables option which bypass user authentication

sudo mysqld_safe --skip-grant-tables &

Log into MariaDB monitor as root

mysql -u root

Enter the following SQL statement to check which authentication plugin is used for root

MariaDB [(none)]> select Host,User,plugin from mysql.user where User='root';

You will see it’s using unix_socket plugin. To change it to mysql_native_password plugin, execute this command:

MariaDB [(none)]> update mysql.user set plugin='mysql_native_password';

Exit MariaDB monitor

flush privileges;quit;

Stop mysqld_safe

sudo kill -9 $(pgrep mysql)

Start MariaDB again

sudo systemctl start mysql

Now you can use normal password to login

mysql -u root -p

That's all, you have done everything. Enjoy !

Download and Install MAMP then go to C:MAMPhtdocs and place the extracted folder of masterpos there. Now go to localhost/MAMP and then go to phpMyAdmin and create a database with any name and create a user with all privileges for the created Database. Now import the database.sql file from your database folder of your pos directory and click Go. Database is created. Now go to config folder and change database.php.tmpl to database.php and set the database name, username and password for the database you created through phpMyAdmin.

Go to your browser and write localhost and select your project from the list. OSPOS will be loaded. Give the the username and password which is 'admin' and 'pointofsale' respectively.

Go to Sales Module and if your UI is blocked then you have to do some extra work. Run your MAMP application which is most probably already running. Click on 'Preferences', now go to php tab and check which php version is loaded in your MAMP by clicking on dropdown list. Select a php version with 5.6.** (e.g. 5.6.13 or 5.6.24).

if none of 5.6.** version is available in the list then follow the instruction below Goto C:MAMPbinphp and rename all the non-required php folder to some other name. (e.g. rename php5.4.1 to x_php5.4.1). only 2 folders from here will show in your php dropdown at MAMP.

Now go to C:MAMPbinphpphp5.6.24 and copy all the icu**53.dll files from here and paste them to C:MAMPbinapachebin.

Now go to C:MAMPconfphp5.6.24 and open php.ini file and find ;extension=php_intl.dll and remove the semicolon in the start and make sure bcmath is not commented out as well. If it doesn't work please read issue 1607 for a detailed list of extensions.

Restart your MAMP and run the ospos again. It should work now. Enjoy. 🙂

If you are using WAMP follow the MAMP setup for the icu files.

Currently Php 7 is working. Download and Install Xampps currrent version for 3.1.0 or an earlier version of Xampp for 3.0.2. OSPOS is working great on Windows 10.https://www.apachefriends.org/download.html Launch the Control Panel. Start Apache and Mysql. From Apache select Config. Edit the Php.ini file to uncomment the following extensions as needed. The extensions are about halfway down. bcmath already appears to be enabled in this version of Xampp.

extension=php_gd2.dll, This may already be enabled.

extension=php_intl.dll, Was not enabled.

extension=php_sockets.dll. Was not enabled.

NOTE: If it doesn't work please read issue 1607 for a detailed list of extensions.

Now Apache should be ready to go.

Download and extract either Stable or Unstable from the Readme page.

If you are using Windows right click on the downloaded zip file.

Mamp For Ubuntu Windows 7

Select properties and Select the Unblock button if it is there. Then extract the file.

Place the extracted file into the htdocs directory.

In Xampp Control Panel go to Mysql - Admin. Create a new database. Name it ospos or whatever you want. Now select the database and go to import. Select browse and go to the opensourcepos directory and locate the database directory. Select database.sql for the import if this is a new install. Select 2.4_3.0.sql for the import if this is an updated install. After the database has completed installing go back to the ospos dir and go to ospos/application/config. Rename database.php.tmpl to database.php. Open database.php and change the following lines as needed.
'username' => ', default name is root for mysql.
'password' => ', default no password for mysql or change if you created a mysql password.
'database' => ', change this to your new database name.
Edit and save.

Restart the Apache server after you have made any changes.

Now you should be able to go to localhost/what ever name you chose to use/public and see the login screen.

In 3.1.0 or higher if you have not enabled all the necessary extensions it will give you a warning on the Login screen.

Default user - admin
Default password - pointofsale.
Play around and get familiar with OSPOS.

OSPOS EXTRAS Deployment of OSPOS with LEMP on Raspberry Pi 3 Model B

Default Linux, Nginx, MariaDB, PHP7.0 & Adminer stack on Raspbian Jessie.

By default Raspbian Jessie comes with PHP5.6, so you have to add a new repo to use php7. You can use php5.6 but php7 performs far better.

Type the following code in your terminal:

sudo nano /etc/apt/sources.list

Add this line to the list:

deb http://mirrordirector.raspbian.org/raspbian/ stretch main contrib non-free rpi

Save the file by pressing Ctrl+x, y, Enter.

sudo apt-get update

sudo apt-get upgrade

sudo apt-get install nginx

sudo systemctl enable nginx

sudo systemctl start nginx

systemctl status nginx

Now in your browser’s address bar, type http://localhost or http://127.0.0.1 and hit enter

You will see 'Welcome to nginx!, that means nginx installed and running successfully.

Now, we need to make www-data (Nginx user) as the owner of web root directory

sudo chown www-data /var/www/html -R

sudo apt-get install mariadb-server mariadb-client

MariaDB will ask you to set root user's password, provide it and confirm it.

sudo systemctl enable mysql

sudo apt-get install php7.0-fpm php7.0-mbstring php7.0-mysql php7.0-common php7.0-gd php7.0-cli php7.0-curl php7.0-intl php7.0-bcmath php7.0-mcrypt

sudo systemctl start php7.0-fpm

systemctl status php7.0-fpm

Remove the 'default.conf' symlink in 'sites-enabled' directory

sudo rm /etc/nginx/sites-enabled/default

create a new default server block file under /etc/nginx/conf.d/ directory

sudo nano /etc/nginx/conf.d/default.conf

Paste the following text into the file, save and close the file

Test nginx configuration and reload it

sudo nginx -t

sudo service nginx restart

php --version

Test PHP-FPM, create a php_info.php file in the Web root directory

sudo nano /var/www/html/php_info.php

Paste the following code to the file:

<?php phpinfo(); ?>

Now in the browser address bar, enter localhost/php_info.php. You should see your server’s PHP information. This means PHP is workinging fine. For your server’s security, you should delete php_info.php file now.

Download Adminer from this page:

Place it in var/www/html folder. To access it, type in your browser localhost/adminer-x.x.x.php

NOTE: x.x.x stands for Adminer version, you have downloaded.

Now download, extract and place opensourcepos to var/www/html. Don't forget to rename it as opensourcepos. Create a new Database using Adminer. Rename your Application/config/database.php.tmpl to database.php. Provide database connection credentials by editing the database.php file. Type in your browser http://localhost/opensourcepos/public.

ENJOY!

If you have any issue, please post in the Issues section.

Installing on Raspberry PI Orange PI (Headless OSPOS)

Login to your pi pi ssh using Putty. First update all the packages.

sudo apt-get update & sudo apt-get upgrade

Become root sudo su

Then install Apache, PHP, MySQL in and phpMyAdmin order to be able to run OSPOS.

sudo apt-get install apache2 php5 libapache2-mod-php5 mysql-server php-pear php5-mysql phpmyadmin apache2-utils php5-gd php5-intl -y

Add the user name and password for MySQL and phpMyAdmin.

Mamp For Ubuntu

Configuration

Configure Date and Time according to your location for the server to run correctly.

  1. sudo dpkg-reconfigure tzdata Select your time Zone Modify the PHP files for the Time zone.
  2. goto nano /etc/php5/cli/php.ini and find 'Date' by scrolling down or by Ctrl+W and remove ; from the line and modify like this date.timezone = Asia/Kolkata.
  3. goto nano /etc/php5/apache2/php.ini and find 'Date' by scrolling down or by Ctrl+W and remove ; from the line and modify like this date.timezone = Asia/Kolkata.
  4. Modify Apache 2 for the PHPMYADMIN. goto nano /etc/apache2/apache2.conf and Add the next code to the bottom of the line Include /etc/phpmyadmin/apache.conf.
  5. restart Apache and check if it's working correctly /etc/init.d/apache2 restart.

Installing And Configuring OSPOS (must be root)

  1. Download OSPOS git clone https://github.com/jekkos/opensourcepos.
  2. Rename PHP file cp -r opensourcepos/application/config/database.php.tmpl opensourcepos/application/config/database.php.
    3.Modify application/config/database.php to connect to your database.
    nano opensourcepos/application/config/database.php.
    go to the bottom of the file and modify this to your database

$db['default'] = array( 'dsn' => ', 'hostname' => 'localhost', 'username' => 'root', 'password' => '12345678', 'database' => 'opensourcepos',

  1. Copy This Files to apache.
    cp -r opensourcepos /var/www/html
  2. Change the permissions
    chmod -Rv 755 cache* /var/www/html/opensourcepos.
  3. Restart Apache
    /etc/init.d/apache2 restart.

Configuring OSPOS ( Network Install )

Please do not use a Web Browser with a lot of addons as it can create problems with OSPOS. Install Firefox if you are using Chrome with a lot of addons.

  1. Download the Source form https://github.com/jekkos/opensourcepos.
  2. Go to your PI's ip address e.g http://192.168.3.116/phpmyadmin.
  3. Create a database name as above saved in configuration file.
  4. As it's a local installation, to improve performance set in application/config/config.php$config['ospos_xss_clean'] = FALSE; - Please note that this will disable the Cross Site Scripting protection, but assuming it's a standalone installation you should not suffer this issue but please consider carefully this point before proceeding -
  5. Select that Database and Click import and select the database file from previously downloaded file.
  6. After successfully importing the database login to OSPOS.
  7. Restart apache /etc/init.d/apache2 restart
  8. Go to your PI's ip address e.g http://192.168.3.116/opensourcepos.
  9. Enjoy!!!.

Although Apache and MySQL are popular choices, on Raspberry PI alternatives could be considered like Nginx + PHP-FPM + MariaDB on Arch Linux. Here how to.

Sme background article that explains how to install a LEMP stack, and another one here. If you succeed in this alternative installation please let us know the full instructions that we update this wiki page.

Mamp For Ubuntu Windows 10

See this wiki page for an installation guide on Ubuntu 16.04.