• Get In Touch
January 6, 2017

Install Shopware Community Edition on CentOS 7

Want your very own server? Get our 1GB memory, Xeon V4, 25GB SSD VPS for £10.00 / month.
Get a Cloud Server

Shopware Community Edition is a free and open source e-commerce application written in PHP. It uses MySQL as the database server to store the data. Shopware is very easy to use and require no coding knowledge to work. It is secure and responsive. The application provides the interface for elements to drag and drop, it also supports design grids. It contains story tellings, slide shows, and quick views. It is used by more than 500,000 shops across the globe.

Requirements

Shopware can be installed on systems with a small amount of RAM, as the requirement of RAM increase as the number of products and users increases. You will also need a minimal installation of CentOS 7 with root access on it. If you are logged in as non-root user, you can run sudo -i to switch to root user.

Installing Shopware

Before installing any package it is recommended that you update the packages and repository using the following command.

yum -y update

Once you have your system updated, you can proceed to install the LAMP stack. Start the LAMP installation by installing Apache web server and MariaDB, which is a fork of MySQL using the following command.

yum -y install httpd mariadb-server mariadb

Since Shopware uses a PHP version greater than 5.6.4 but the YUM repository contains PHP version 5.4 only, hence we will need to use the Webtatic repository to install a version of PHP greater than 5.6.4. Run the following commands for installing EPEL repository as EPEL repository is required before we install Webtatic repository.

yum -y install epel-release
yum -y update

Now install Webtatic repository using the following commands.

rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum -y update
yum clean all

To install PHP 5.6 and all the required PHP modules, run the following command.

yum -y install php56w php56w-fpm php56w-cli php56w-json php56w-curl php56w-gd php56w-mysql php56w-xml php56w-mbstring

To install PHP 7.0 and all the required PHP modules, run the following command.

yum -y install php70w php70w-fpm php70w-cli php70w-json php70w-curl php70w-gd php70w-mysql php70w-xml php70w-mbstring

Make sure that you are using only one of the PHP versions mentioned above. Once you have PHP installed, you can check the version of PHP using the following command.

php -v

For example, for PHP 7.0, you will likely see the following output:

[root@ip-172-31-31-130 ~]# php -v
PHP 7.0.14 (cli) (built: Dec 10 2016 11:35:27) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies

Make sure that your PHP version is not older than 5.6.4. Now start Apache web server and enable it to start at boot time using the following commands:

systemctl start httpd
systemctl enable httpd

Enable Mod_rewrite by editing /etc/httpd/conf/httpd.conf using your favorite text editor.

nano /etc/httpd/conf/httpd.conf

Find the following line.

<Directory "/var/www/html">
AllowOverride None

Change it to AllowOverride All.

You will also need to make few changes into PHP configuration file /etc/php.ini. Open /etc/php.ini using your favorite editor.

nano /etc/php.ini

If you do not have nano installed, you can install it using yum -y install nano. Scroll down to find the following lines.

; Maximum amount of memory a script may consume (128MB)
; http://php.net/memory-limit
memory_limit = 128M

You will need to provide at least 256MB RAM to PHP for faster processing of web pages. You may increase it to higher amounts if more RAM on the system is available. Now find

; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 2M

Change the max upload to 100 MB. Now find

;cgi.fix_pathinfo=1

Remove the semicolon from the start of the line and change the value of the parameter from 1 to 0. Next, find:

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
;date.timezone =

Remove the semicolon from the start of the line and provide the timezone of your e-commerce store. For example

date.timezone = Asia/Kolkata

Next, find:

post_max_size = 8M

Change the value of the parameter to 100MB. Now save the file and exit from the editor. Once done, restart Apache web server using the following command.

systemctl restart httpd

To start MariaDB and enable it to start at boot time using the following commands.

systemctl start mariadb
systemctl enable mariadb

Now run the following commands to secure your MySQL or MariaDB installation.

mysql_secure_installation

It will run a small script which asks you to set a root password for your MariaDB installation. Most of the questions are self-explanatory and you should answer yes to all the questions.

As we have all the dependencies ready we can now create a database to store the data of Shopware. To create a database we will need to login to MySQL command line first. Run the following command for same.

mysql -u root -p

This will prompt you for the password, provide the root password of MySQL which you have set earlier. Now run the following query to create a new database for your Shopware installation.

CREATE DATABASE shopware;

The above query will create a database named shopware. For the database, you can use any name you prefer in the place of shopware. Make sure that you use semicolon at the end of each query as the query always ends with a semicolon. Once the database is created you can create a new user and grant all the permissions to the user for the database. Using root user is not recommended for the databases. To create a new database user, run the following query.

CREATE USER 'shopuser'@'localhost' IDENTIFIED BY 'StrongPassword';

The above query will create a user with username shopuser. You can use any preferred username instead of shopuser. Replace StrongPassword with a strong password. Now provide the appropriate privileges to your database user over the database you have created. Run the following command:;

GRANT ALL PRIVILEGES ON shopware.* TO 'shopuser'@'localhost';

Now run the following command to immediately apply the changes on the database privileges.

FLUSH PRIVILEGES;

Exit from MySQL prompt using exit command.

As we have all the dependencies ready, we can now download the install package from Shopware site.

cd /var/www/html
wget http://releases.s3.shopware.com.s3.amazonaws.com/install_5.2.12_8c8f67d848ef15aafaac6fed5f0eef062644250f.zip -O shopware.zip

The above command will download the installer archive and store it as shopware.zip file. You can always look for the latest release by going to the Shopware download page.

Extract the archive using the following command.

unzip shopware.zip

If you don’t have unzip installed, you can run yum -y install unzip. Remove the zip file as it is not required now.

rm shopware.zip

Now you will need to disable your SELinux because iRedMail does not work with SELinux policies. To completely disable the SELinux you will need to edit /etc/selinux/config file.

nano /etc/selinux/config

If you don’t have nano installed, you can install it using yum -y install nano Find the following line:

SELINUX=enforcing

Change it to:

SELINUX=disabled

Now you will need to reboot your server so that the new configuration can take effect. Once the server is rebooted, you will need to provide the ownership of the application to web server user using the following command.

chown -R apache:apache /var/www/html

Now you will need to start the browser installation, go to the following link using your favorite web browser.

http://YourServerIP/shopware.php

You will see the welcome interface, you can choose the installer language here.

HP_NO_IMG/data/uploads/users/e840080c-7322-4497-85c0-150182bd4c02/847392939.png” alt=”” />

Click Forward to proceed further. The system will now check for the system requirements. If you have followed the tutorial correctly you will have all the system requirements conditions met except the ionCube loader, which is optional and used when you will be using the premium plugins with Shopware.

Click Forward to proceed further. Now the installer will show you the license agreement which you will need to accept to install the software further.

Now you will need to provide the database details for storing the Shopware data.

HP_NO_IMG/data/uploads/users/e840080c-7322-4497-85c0-150182bd4c02/921102469.png” alt=”” />

Leave the default value in database host and database port. Provide the username and password of the database which we have created earlier to store Shopware data. If the database username and password are correct then the installer will automatically detect the database name. If not, provide the database name also. Click Forward to proceed further.

Now you will see following interface, where the installer is ready to write the data in the database.

HP_NO_IMG/data/uploads/users/e840080c-7322-4497-85c0-150182bd4c02/132929435.png” alt=”” />

Click Start button to write the data into the database.

Once done, you will be taken to the interface in which you will need to choose the edition of your software. If you choose the community edition, then you will not need to provide any installation key.

Finally provide the site configuration, which includes your shop name, email address, the default shop language, and site currency.

HP_NO_IMG/data/uploads/users/e840080c-7322-4497-85c0-150182bd4c02/632455696.png” alt=”” />

Provide the admin information, which includes Admin name, admin username, admin email address, the backend language, and admin password.

HP_NO_IMG/data/uploads/users/e840080c-7322-4497-85c0-150182bd4c02/381809186.png” alt=”” />

Once done, click Forward button and you will see that installer has completed the installation of Shopware application.

You can go to the following URL to browse the front end of the site.

http://YourServerIP

To browse the administrative panel, go to the following URL.

http://YourServerIP/backend

Conclusion

You can now successfully deploy the Shopware e-commerce application on your CentOS 7 server. You can now log in to your backend to add the products to your catalog.

Want your very own server? Get our 1GB memory, Xeon V4, 25GB SSD VPS for £10.00 / month.
Get a Cloud Server

Share this Article!

Related Posts

Node.js Authentication – A Complete Guide with Passport and JWT

Node.js Authentication – A Complete Guide with Passport and JWT

Truth be told, it’s difficult for a web application that doesn’t have some kind of identification, even if you don’t see it as a security measure in and of itself. The Internet is a kind of lawless land, and even on free services like Google’s, authentication ensures that abuses will be avoided or at least […]

Node.js and MongoDB: How to Connect MongoDB With Node

Node.js and MongoDB: How to Connect MongoDB With Node

MongoDB is a document-oriented NoSQL database, which was born in 2007 in California as a service to be used within a larger project, but which soon became an independent and open-source product. It stores documents in JSON, a format based on JavaScript and simpler than XML, but still with good expressiveness. It is the dominant […]

Using MySQL with Node.js: A Complete Tutorial

Using MySQL with Node.js: A Complete Tutorial

Although data persistence is almost always a fundamental element of applications, Node.js has no native integration with databases. Everything is delegated to third-party libraries to be included manually, in addition to the standard APIs. Although MongoDB and other non-relational databases are the most common choice with Node because if you need to scale an application, […]

Node.Js Vs Django: Which Is the Best for Your Project

Node.Js Vs Django: Which Is the Best for Your Project

Django and NodeJs are two powerful technologies for web development, both have great functionality, versatile applications, and a great user interface. Both are open source and can be used for free. But which one fits your project best? NodeJs is based on JavaScript, while Django is written in Python. These are two equally popular technologies […]

Nodejs Vs PHP:  Which Works Best?

Nodejs Vs PHP: Which Works Best?

Before getting into the “battle” between Node.js and PHP we need to understand why the issue is still ongoing. It all started with the increased demand for smartphone applications, their success forcing developers to adapt to new back-end technologies that could handle a multitude of simultaneous requests. JavaScript has always been identified as a client-side […]