{"id":17308,"date":"2016-03-08T11:26:21","date_gmt":"2016-03-08T17:26:21","guid":{"rendered":"https:\/\/secure.rosehosting.com\/blog\/?p=17308"},"modified":"2022-12-16T03:38:09","modified_gmt":"2022-12-16T09:38:09","slug":"install-litecart-on-ubuntu-14-04-with-nginx-php-fpm-and-mysql","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/install-litecart-on-ubuntu-14-04-with-nginx-php-fpm-and-mysql\/","title":{"rendered":"Install LiteCart on Ubuntu 14.04 with Nginx, PHP-FPM and MySQL"},"content":{"rendered":"
In this tutorial we will explain how to install LiteCart on an Ubuntu 14.04 VPS<\/a> with Nginx, PHP-FPM and MySQL. The framework is constructed to be lightweight and easy for developers to modify and build upon.<\/p>\n LiteCart relies on the latest HyperText standard HTML 5, the latest CSS 3 for styling, the jQuery framework for client-side dynamics, and the popular web scripting language PHP for server-side dynamics.<\/p>\n <\/p>\n REQUIREMENTS<\/strong><\/p>\n We will be using our SSD 1 Linux VPS<\/a> Hosting plan for this tutorial.<\/p>\n UPDATE THE SYSTEM<\/strong><\/p>\n Make sure your server is fully up to date using:<\/p>\n Your next step is to install Nginx, PHP-FPM, MySQL and some needed dependencies. Run the following command:<\/p>\n Then, create the database needed for LiteCart. Log into your MySQL service as root:<\/p>\n INSTALL LITECART<\/strong><\/p>\n Next, install LiteCart. For our purposes we will download LiteCart into the \/opt<\/em> directory. Run the following commands:<\/p>\n Unzip the archive:<\/p>\n Create the needed directory into which you will move all the installation files. Enter the following commands:<\/p>\n CONFIGURE NGINX FOR LITECART<\/strong><\/p>\n Your next step is to configure an Nginx block so you can access LiteCart using a domain. Therefore, create a new file using the below command:<\/p>\n Paste the following into the file:<\/p>\n Don’t forget to replace the your_domain<\/em> values with your actual domain.<\/p>\n Enable the site:<\/p>\n Restart Nginx for the changes to take effect:<\/p>\n Check the path of the current working directory using the command:<\/p>\n You should be in the \/var\/www\/litecart directory. If so, enter the following command to set the proper file ownership:<\/p>\n To finish the LiteCart installation, open your favorite web browser and navigate to http:\/\/your_domain . You will be welcomed by the installer. Check if your server meets the System Requirements. If some extensions or settings need to be enabled, you should install\/enable them before proceeding. After that is done, fill in the database credentials in the MySQL field under the Installation Parameters section. Then choose your username and password for the LiteCart administration backend. After everything is done, click on Install Now.<\/p>\n After the installation is completed, you should delete the install<\/em> directory in \/var\/www\/litecart\/<\/p>\n That\u2019s it. You have successfully installed LiteCart on your Ubuntu 14.04 VPS<\/a>. For more information about LiteCart, please refer to their wiki<\/a>.<\/p>\n Of course you don\u2019t have to do any of this if you use one of our Managed Ubuntu VPS hosting<\/a> plans, in which case you can simply ask our expert Linux admins to install LiteCart for you. They are available 24\u00d77 and will take care of your request immediately.<\/p>\n PS.<\/span> If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.<\/p>\n","protected":false},"excerpt":{"rendered":" In this tutorial we will explain how to install LiteCart on an Ubuntu 14.04 VPS with Nginx, PHP-FPM and MySQL. … <\/p>\n
\nLiteCart is a free e-commerce, feature rich e-commerce solution.<\/p>\n# apt-get update && apt-get upgrade<\/pre>\n
# apt-get install nginx php5-fpm mysql-server php5-mysql php5-curl<\/pre>\n
# mysql -u root -p\r\n\r\nmysql> create database lite;\r\nQuery OK, 1 row affected (0.00 sec)\r\n\r\nmysql> grant all privileges on lite.* to liteuser@localhost identified by 'your_password';\r\nQuery OK, 0 rows affected (0.05 sec)\r\n\r\nmysql> flush privileges;\r\n\r\nmysql> exit\r\nBye<\/pre>\n
# cd \/opt\r\n\r\n# wget http:\/\/download2us.softpedia.com\/dl\/9a4e457ced9819c2aa03f2adb2b4e551\/556d7e98\/700082813\/webscripts\/php\/litecart-1.3.zip<\/pre>\n
# unzip litecart-1.3.zip<\/pre>\n
# mkdir \/var\/www\/litecart\r\n\r\n# mv * \/var\/www\/litecart<\/pre>\n
Enter the newly created directory and delete the zip file we don't need:<\/pre>\n
# cd \/var\/www\/litecart\r\n\r\n# rm litecart-1.3.zip<\/pre>\n
# vim \/etc\/nginx\/sites-available\/your_domain<\/pre>\n
server {\r\nlisten 80 ;\r\n\r\nroot \/var\/www\/litecart\/public_html;\r\nindex index.php index.html index.htm;\r\nrewrite ^\/sitemap_index\\.xml$ \/index.php?sitemap=1 last;\r\nrewrite ^\/([^\/]+?)-sitemap([0-9]+)?\\.xml$ \/index.php?sitemap=$1&sitemap_n=$2 last;\r\n\r\nserver_name your_domain ;\r\n\r\naccess_log \/var\/log\/nginx\/your_domain\/access.log;\r\nerror_log \/var\/log\/nginx\/your_domain\/error.log;\r\n\r\nlocation \/ {\r\n# try_files $uri $uri\/ =404;\r\ntry_files $uri $uri\/ \/index.php?q=$uri&$args;\r\n}\r\n\r\nerror_page 404 \/404.html;\r\n\r\nerror_page 500 502 503 504 \/50x.html;\r\nlocation = \/50x.html {\r\nroot \/usr\/share\/nginx\/html;\r\n}\r\n\r\nlocation ~ \\.php$ {\r\ntry_files $uri =404;\r\nfastcgi_split_path_info ^(.+\\.php)(\/.+)$;\r\nfastcgi_pass unix:\/var\/run\/php5-fpm.sock;\r\nfastcgi_index index.php;\r\ninclude fastcgi_params;\r\n\r\n}\r\n}<\/pre>\n
# a2ensite your_domain<\/pre>\n
# \/etc\/init.d\/nginx restart<\/pre>\n
# pwd<\/pre>\n
chown www-data -R public_html\/<\/pre>\n