In this tutorial we will teach you how to install LiteCart on Ubuntu 16.04. LiteCart is a free and open source e-commerce platform which was developed in PHP, jQuery, and HTML 5. Installing LiteCart on Ubuntu 16.04 is pretty simple and should take no more than 15 minutes.
Step 1: Logging in via SSH
To begin, login to your server with SSH as user root.
ssh root@IP_ADDRESS -p PORT_NUMBER
Change ‘IP_ADDRESS’ and ‘PORT_NUMBER’ to your actual server IP address and SSH port number.
After you have logged in, ensure that your Ubuntu 16.04 server is up-to-date by executing the commands below.
apt-get update
apt-get upgrade
Step 2: Installing the Apache Web Server
In order to install the Apache web server, you need to execute the command below.
apt-get install apache2
Once the installation is done, you can enable the service to be started automatically once the system boots up, use the command below.
systemctl enable apache2
To check whether the Apache server is running or not, execute the command below.
systemctl status apache2
Step 3: Install the MySQL Database Server
In this step we will install the MySQL database server, in order to do this, execute the command below.
apt-get install mysql-server
Once the installation is done, you can start the database server and enable it to automatically start upon boot with the commands below.
systemctl start mysql systemctl enable mysql
You can also use the ‘mysql_secure_installation’ script to improve the security of your MySQL database server.
mysql_secure_installation
Once you’ve answered every question, you may now go ahead and login to MySQL as root with your root password, by using the following command:
mysql -u root -p
To create a new database for the LiteCart installation, execute the commands below.
CREATE DATABASE litecart_db; GRANT ALL PRIVILEGES ON litecart_db.* TO 'litecart_user'@'localhost' IDENTIFIED BY 'PASSWORD'; FLUSH PRIVILEGES; exit;
Make sure to swap ‘PASSWORD’ with your own password of choice.
Step 5: Install LiteCart on Ubuntu 16.04
Since you have got your LAMP server ready, you may now begin installing LiteCart.
First of all, create a new folder for your LiteCart installation within the Apache document root directory on your server.
mkdir /var/www/html/litecart
Now, download the latest LiteCart version from the official site and put it within the newly created directory. Then you may extract the downloaded zip archive by running the following command.
unzip litecart-2.0.2.zip Change the ownership of the LiteCart folder: chown -R www-data:www-data /var/www/html/litecart
Step 6: Setting up the Apache Virtual Host
If you would like to access your LiteCart installation with your own domain name, you must also create an Apache virtual host file.
nano /etc/apache2/sites-available/litecart.conf
Put the following content in this file.
<VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /var/www/html/litecart ServerName yourdomain.com ServerAlias www.yourdomain.com <Directory /var/www/html/litecart> Options FollowSymLinks AllowOverride All Order allow,deny allow from all </Directory> ErrorLog /var/log/apache2/litecart-error_log CustomLog /var/log/apache2/litecart-access_log common </VirtualHost>
Step 7: Enabling the Virtual Host File
You may enable the virtual host file using the command shown here.
ln -s /etc/apache2/sites-available/litecart.conf /etc/apache2/sites-enabled/litecart.conf
Step 8: Restarting Apache
To restart your Apache, use the following command.
systemctl restart apache2
Step 9: Completing the LiteCart Installation via Web Browser
This is all, you may now use your web browser of choice and point your browser to ‘http://yourdomain_or_ip_address.com‘, then follow the on-screen instructions to finish the LiteCart installation.