This will be a series of posts covering the installation and basic configuration of an online store using the excellent OpenCart software. This post will cover the basic installation of OpenCart’s core pre-requisites (Listed Below) on a Debian 6 based system. For this example i used OpenCart v126.96.36.199 – But it should broadly cover most other versions of OpenCart/Debian.
- Web Server (We will use Apache)
- PHP (at least 5.2)
- GD Image Module
- OpenCart v188.8.131.52
The first thing you’re going to want to do is check that your servers hostname (and fully qualified domain name) are both set correctly. We can do this using the hostname command with the -f switch:
Now that we’re happy the basics are in place we can start installing our LAMP stack and other Pre-Requisites. The first thing we are going to do is update our repositories and then install Apache.
aptitude install apache2 apache2-doc apache2-utils
# Whilst we're here, We may aswell enable Apaches rewrite capabilities
Next we’ll install PHP and the apache PHP library. We will also install pear, xcache and suhosin and the PHP MySQL module.
Now it’s time to install curl and the curl php module
# Now we'll need to enable the curl module, If you are not familiar with vim text editor nano is a good alternative.
#Look for the extensions stanza and add:
The final module we’ll need to install is the GD Image Module which OpenCart will use for dynamically manipulating images.
Now we can move onto installing and configuring the MySQL server.
# At this point you will be thrown into an ncurses based installer - Simply follow the on-screen instructions and you should be fine!.
# Once the installation is completed we'll need to secure the MySQL installation by running:
#When prompted for root password, Either enter the one you set during installation - Or leave blank if you didn't set one. You should Always change the root password if you did not set one at installation!
# Answer 'Yes' to all the questions the mysql secure installation script asks.
# The final thing we'll do is log into the MySQL CLI and create a user and database for opencart to use
mysql -u root -p
mysql > CREATE DATABASE opencart;
mysql > GRANT ALL ON opencart.* TO 'youruser'@'localhost' identified by 'yourpass'; #remember to replace youruser and yourpass with your desired username and password!
#Finally we'll just test connecting to the database to confirm everything is working!
mysql -u youruser -p opencart
And there we have it – By now you should have a working LAMP stack with all of OpenCarts required modules installed and ready to go. In the next part we will look at installing the OpenCart packages.