GNU/Linux >> Linux Esercitazione >  >> Panels >> Panels

Installa Shopware 5 su Ubuntu 16.04

Ti mostreremo. come installare Shopware 5 su Ubuntu 16.04, con MariaDB, PHP-FPM e Nginx. Shopware è un moderno software di e-commerce open source, scritto in PHP su componenti Symfony e Zend. Questa guida dovrebbe funzionare anche su altri sistemi VPS Linux, ma è stata testata e scritta per un VPS Ubuntu 16.04. Installa Shopware 5 su Ubuntu 16.04

1. Accedi al tuo VPS tramite SSH con il tuo utente sudo

ssh user@vps_IP

2. Aggiorna il sistema e installa i pacchetti necessari

[user]$ sudo apt-get update && sudo apt-get -y upgrade
[user]$ sudo apt-get install software-properties-common nano wget ant

3. Installa MariaDB 10.1

Per aggiungere il repository MariaDB all'elenco delle fonti e installare l'ultimo server MariaDB 10.1, esegui i seguenti comandi:

[user]$ sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
[user]$ sudo add-apt-repository 'deb [arch=amd64,i386] http://ftp.osuosl.org/pub/mariadb/repo/10.1/ubuntu xenial main'
[user]$ sudo apt-get update
[user]$ sudo apt-get install -y mariadb-server

Al termine dell'installazione, eseguire il comando seguente per proteggere l'installazione:

[user]$ mysql_secure_installation

Successivamente, dobbiamo creare un database per l'installazione di Shopware.

[user]$ mysql -uroot -p
MariaDB [(none)]> CREATE DATABASE shopware;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON shopware.* TO 'shopware'@'localhost' IDENTIFIED BY 'strong_password';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> \q

4. Installa PHP e i moduli PHP richiesti

Per installare l'ultima versione stabile di PHP versione 7.0 e tutti i moduli necessari, esegui:

[user]$ sudo apt-get -y install php-fpm php-cli php-json php-curl php-gd php-mysql php-xml php-mbstring

I seguenti comandi imposteranno il limite di memoria PHP a 512 MB, modificheranno i valori di upload_max_filesize e post_max_size a 100 M e imposteranno il fuso orario su UTC.

sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/7.0/cli/php.ini
sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/7.0/cli/php.ini
sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/7.0/fpm/php.ini
sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/7.0/fpm/php.ini
sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/7.0/fpm/php.ini

Crea un nuovo pool PHP-FPM per il tuo utente se non ne hai già uno:

[user]$ sudo nano /etc/php/7.0/fpm/pool.d/your_user_name.conf
[your_user_name]
user = your_user_name
group = your_user_name
listen = /var/run/php/php7.0-your_user_name-fpm.sock
listen.owner = your_user_name
listen.group = your_user_name
listen.mode = 0666
pm = ondemand
pm.max_children = 5
pm.process_idle_timeout = 10s
pm.max_requests = 200
chdir = /

Non dimenticare di cambiare il tuo_nome_utente con il tuo nome utente.
Riavvia PHP-FPM:

[user]$ sudo service php7.0-fpm restart

5. Scarica e installa Shopware

Scarica l'ultima versione di Shopware da GitHub:https://github.com/shopware/shopware/releases. Al momento in cui scrivo, l'ultima versione è Shopware versione 5.1.6.

[user]$ wget https://github.com/shopware/shopware/archive/v5.1.6.zip
[user]$ unzip v5.1.6.zip
[user]$ mv shopware-5.1.6 ~/myShopware.com
[user]$ rm -f v5.1.6.zip

Impostare la configurazione e la connessione al database:

[user]$ cd ~/myShopware.com/build
[user]$ ant configure
[user]$ ant build-unit

Scarica le immagini di prova:

[user]$ cd ~/myShopware.com
[user]$ wget http://releases.s3.shopware.com/test_images.zip
[user]$ unzip test_images.zip

6. Installa e configura Nginx

Per installare l'ultima versione stabile di Nginx disponibile sui repository di Ubuntu, esegui:

[user]$ sudo apt-get install nginx

Genera un certificato SSL autofirmato:

[user]$ sudo mkdir -p /etc/nginx/ssl
[user]$ cd /etc/nginx/ssl
[user]$ sudo openssl genrsa -des3 -passout pass:x -out shopware.pass.key 2048
[user]$ sudo openssl rsa -passin pass:x -in shopware.pass.key -out shopware.key
[user]$ sudo rm shopware.pass.key
[user]$ sudo openssl req -new -key shopware.key -out shopware.csr
[user]$ sudo openssl x509 -req -days 365 -in shopware.csr -signkey shopware.key -out shopware.crt

Se non desideri ricevere avvisi associati ai certificati SSL autofirmati, puoi acquistare un certificato SSL affidabile qui.

Quindi, crea un nuovo blocco del server Nginx:

[user]$ sudo nano /etc/nginx/sites-available/myShopware.com
server {
    listen 443;
    server_name myShopware.com;
    root /home/your_user_name/myShopware.com;

    index shopware.php index.php;

    location / {
      rewrite files/documents/.* /engine last;
      rewrite backend/media/(.*) /media/$1 last;

      try_files $uri $uri/ /shopware.php$args;
    }

    ssl on;
    ssl_certificate     /etc/nginx/ssl/shopware.crt;
    ssl_certificate_key /etc/nginx/ssl/shopware.key;
    ssl_session_timeout 5m;
    ssl_ciphers               'AES128+EECDH:AES128+EDH:!aNULL';
    ssl_protocols              TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;

    access_log  /var/log/nginx/shopware.access.log;
    error_log   /var/log/nginx/shopware.error.log;

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php/php7.0-your_user_name-fpm.sock;
        fastcgi_index shopware.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_intercept_errors off;
        fastcgi_buffer_size 16k;
        fastcgi_buffers 4 16k;
    }

    location ~ /\.ht {
        deny all;
    }
}

server {
    listen      80;
    server_name myShopware.com;

    add_header Strict-Transport-Security max-age=2592000;
    rewrite ^ https://$server_name$request_uri? permanent;
}

Non dimenticare di cambiare il tuo_nome_utente con il tuo nome utente.

Attiva il blocco del server creando un collegamento simbolico :

[user]$ sudo ln -s /etc/nginx/sites-available/myShopware.com /etc/nginx/sites-enabled/myShopware.com

7. Testare e riavviare il server Web Nginx

Testare la configurazione di Nginx e riavviare nginx:

[user]$ sudo nginx -t
[user]$ sudo service nginx restart

Questo è tutto. Hai installato con successo Shopware su Ubuntu 16.04. Il nome utente e la password predefiniti sono entrambi demo. Per ulteriori informazioni su come gestire l'installazione di Shopware, fare riferimento alla documentazione ufficiale di Shopware.

Ovviamente non devi fare nulla di tutto ciò se usi uno dei nostri servizi di hosting VPS Ubuntu ottimizzato, nel qual caso puoi semplicemente chiedere ai nostri esperti amministratori Linux di configurarlo per te. Sono disponibili 24 ore su 24, 7 giorni su 7 e si prenderanno immediatamente cura della tua richiesta.

PS . Se ti è piaciuto questo post, su come installare Shopware 5 su Ubuntu 16.04, condividilo con i tuoi amici sui social network utilizzando i pulsanti a sinistra o semplicemente lascia una risposta qui sotto. Grazie.


Panels
  1. Installa Symphony CMS su un VPS Ubuntu

  2. Installa Mautic su Ubuntu 14.04

  3. Come installare Sonerezh su Ubuntu 14.04

  4. Installa Gogs su un VPS Ubuntu 14.04

  5. Installa Magento 2 su un VPS Ubuntu 14.04

Come installare Rukovoditel su Ubuntu 16.04

Installa Nextcloud 9 su Ubuntu 16.04

Come installare Mahara su Ubuntu

Installa Shopware 5 su Ubuntu 16.04

Installa Paperwork su Ubuntu

Installa GitBucket su Ubuntu 16.04