GNU/Linux >> Linux の 問題 >  >> Debian

PrestaShopをDebianにインストールする

この投稿では、PHP-FPMとNginxを使用してDebianにPrestaShopをインストールする方法を紹介します。 PrestaShopはオープンソースのeコマースソリューションであり、消費者と商人の両方に最高のオンラインショッピング体験を提供することをお約束します。 PrestaShopには、カタログ管理、製品表示、サイト管理、検索エンジン最適化、マルチストア管理、分析とレポートなど、多くの機能が備わっています。以下の手順に注意深く従えば、DebianにPrestaShopをインストールするのは簡単な作業です。


Nginx、MySQL、PHP-FPMをインストールします

apt-get install nginx php5-fpm php5-cli php5-gd php5-mcrypt php5-mysql mysql-server mysql-client

ショップの新しいデータベースを作成する

CREATE DATABASE presta CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT ALL PRIVILEGES ON presta.* TO db_user@localhost IDENTIFIED BY 'db_user_passwd';

ショップのルートディレクトリを作成する

mkdir -p /var/www/shopdomain.com/{public_html,logs}

PrestaShopをダウンロードして抽出する

cd /var/www/shopdomain.com/public_html
wget http://www.prestashop.com/download/prestashop_1.5.6.1.zip
unzip prestashop_1.5.6.1.zip
mv prestashop/* .
rm prestashop_1.5.6.1.zip
rmdir prestashop/

次のコマンドを実行して、正しい所有権を設定します

chown -R www-data: /var/www/shopdomain.com/public_html/

Nginx構成。

次のコンテンツで新しいNginxサーバーブロックを作成します

# /etc/nginx/sites-available/shopdomain.com
server {
  server_name shopdomain.com;
  listen 80;
  root /var/www/shopdomain.com/public_html;
  access_log /var/www/shopdomain.com/logs/access.log;
  error_log /var/www/shopdomain.com/logs/error.log;

  index index.php;

  rewrite ^/api/?(.*)$ /webservice/dispatcher.php?url=$1 last;
  rewrite ^/([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$1$2.jpg last;
  rewrite ^/([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$1$2$3.jpg last;
  rewrite ^/([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$1$2$3$4.jpg last;
  rewrite ^/([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$4/$1$2$3$4$5.jpg last;
  rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6.jpg last;
  rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7.jpg last;
  rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8.jpg last;
  rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9.jpg last;
  rewrite ^/c/([0-9]+)(-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*.jpg$ /img/c/$1$2.jpg last;
  rewrite ^/c/([a-zA-Z-]+)/[a-zA-Z0-9-]+.jpg$ /img/c/$1.jpg last;
  rewrite ^/([0-9]+)(-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*.jpg$ /img/c/$1$2.jpg last;
  try_files $uri $uri/ /index.php?$args;

  location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
    access_log off;
    expires max;
  }

  location ~ \.php {
    fastcgi_index index.php;
    fastcgi_split_path_info ^(.+\.php)(.*)$;
    include /etc/nginx/fastcgi_params;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  }
}

シンボリックリンクしてサーバーを再起動します

ln -s /etc/nginx/sites-available/shopdomain.com /etc/nginx/sites-enabled/shopdomain.com
/etc/init.d/nginx restart

ブラウザを開き、http://shopdomain.com/install/に移動して、画面の指示に従います。インストールが完了したら、インストールディレクトリを削除することを忘れないでください。

rm -rf var/www/shopdomain.com/public_html/install

もちろん、DebianにPrestaShopをインストールする必要はありません。PrestaShopホスティングサービスを使用している場合は、専門のLinux管理者にDebianのPrestaShopを依頼するだけです。 24時間年中無休でご利用いただけます。リクエストはすぐに処理されます。

PS 。この投稿が気に入った場合は、DebianにPrestaShopをインストールする方法について、左側のボタンを使用してソーシャルネットワーク上の友達と共有するか、下に返信を残してください。ありがとう。


Debian
  1. Debian7にGLPIをインストールする

  2. Debian8にosCommerceをインストールします

  3. DebianにExpressionEngineをインストールする

  1. Debian 10(バスター)のインストール方法

  2. Debian11にGnomeをインストールする

  3. Debian – Debianの月光?

  1. FirefoxDebianのインストール

  2. Python3.9をDebian10にインストールする方法

  3. Debian10にTeamViewerをインストールする方法