ManagedCloud Servers

High performance handled and monitored by us 24/7/365. A complete solution to provide you with our in house expertise 24/7 tailored to your specific needs. We'll setup a bespoke server for your site using the latest tehnologies so you can get the most out of your hardware and get your website loading quickly and reliably. Find out more..

cPanelCloud Servers

Reccomended - High performance cloud servers with no technical knowledge required. If you're hosting multiple websites already and you're looking to consolidate, or if you're looking to isolate yourself from the shared hosting environment but you don't have the time or knoweldge to manage a server, then the Managed cPanel Servers are for you. Find out more..

UnmanagedCloud Servers

Our unmanaged range gives you complete control at rock bottom prices and our cloud platform boasts super fast multipath 40Gb/s network, the latest Intel Xeon V3 CPUs and enterprise grade redundant SSDs. If you're a sysadmin look no further, we offer some of the best specification to price ratio servers available. Find out more..

Install Shopware Community Edition on CentOS 7

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.

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.

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.

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.

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

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.