GNU/Linux >> Linux の 問題 >  >> Ubuntu

Ubuntu20.04LTSにLiteCarteコマースプラットフォームをインストールする方法

LiteCartは、PHP、HTML 5、CSS 3で記述されたオープンソースの軽量eコマースプラットフォームです。シンプルで使いやすく、エレガントでエレガントなシンプルな管理パネル。 LiteCartは、世界中のすべてのWebサイトの99%よりも高速です。革新的、高性能、プラグアンドプレイアドオン、SEOフレンドリー、ワンステップチェックアウト、複数の文字セットのサポートなど、豊富な機能セットが付属しています。

このチュートリアルでは、Ubuntu20.04にLiteCartショッピングカートプラットフォームをインストールする方法を紹介します。

前提条件
  • Ubuntu20.04を実行しているサーバー。
  • サーバーで指定された有効なドメイン名。
  • ルートパスワードはサーバーで構成されています。
はじめに

開始する前に、システムを最新の安定バージョンで更新することをお勧めします。次のコマンドで更新できます:

apt-get update -y
apt-get upgrade -y

システムが最新の状態になったら、システムを再起動して変更を適用します。

LAMPサーバーをインストールする

まず、Apache Webサーバー、MariaDBサーバー、PHP、およびその他の必要なPHPライブラリをシステムにインストールする必要があります。次のコマンドですべてをインストールできます:

apt-get install apache2 mariadb-server php7.4 libapache2-mod-php7.4 php7.4-common php7.4-mbstring php7.4-xmlrpc php7.4-soap php7.4-gd php7.4-xml php7.4-intl php7.4-mysql php7.4-cli php7.4-zip php7.4-curl php7.4-soap unzip -y

すべてのパッケージがインストールされたら、php.iniファイルを編集し、必要な設定を微調整します。

nano /etc/php/7.4/apache2/php.ini

次の行を変更します:

memory_limit = 256M
upload_max_filesize = 150M
max_execution_time = 360
date.timezone = Asia/Kolkata

終了したら、ファイルを保存して閉じます。次に、Apacheサービスを再起動して、変更を適用します。

systemctl restart apache2

MariaDBデータベースを構成する

まず、MariaDBを保護し、MariaDBのルートパスワードを設定する必要があります。次のコマンドで実行できます:

mysql_secure_installation

以下に示すように、すべての質問に答えてください。

   Enter current password for root (enter for none):
    Set root password? [Y/n]: N
    Remove anonymous users? [Y/n]: Y
    Disallow root login remotely? [Y/n]: Y
    Remove test database and access to it? [Y/n]:  Y
    Reload privilege tables now? [Y/n]:  Y

終了したら、次のコマンドを使用してMariaDBシェルにログインします。

mysql -u root -p

プロンプトが表示されたらrootパスワードを入力し、次のコマンドを使用してLiteCartのデータベースとユーザーを作成します。

MariaDB [(none)]> CREATE DATABASE litecartdb;
MariaDB [(none)]> CREATE USER 'litecart'@'localhost' IDENTIFIED BY 'password';

次に、次のコマンドを使用して、litecartdbにすべての権限を付与します。

MariaDB [(none)]> GRANT ALL PRIVILEGES ON litecartdb.* TO 'litecart'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;

次に、特権をフラッシュし、次のコマンドを使用してMariaDBシェルを終了します。

MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;

データベースを構成したら、次のステップに進むことができます。

LiteCartをダウンロード

このチュートリアルを書いている時点では、LiteCartの最新バージョンは2.2.3です。公式サイトからダウンロードできます。ダウンロード後、次のコマンドを使用して、ダウンロードしたファイルをApacheWebルートディレクトリに抽出します。

mkdir /var/www/html/litecart
unzip litecart-2.2.3.1.zip -d /var/www/html/litecart

次に、litecartディレクトリの所有権をwww-dataに変更し、次のコマンドを使用して適切な権限を付与します。

chown -R www-data:www-data /var/www/html/litecart/
chmod -R 755 /var/www/html/litecart/

終了したら、次のステップに進むことができます。

LiteCart用にApacheを構成する

まず、次のコマンドを使用して新しいApache仮想ホスト構成ファイルを作成します。

nano /etc/apache2/sites-available/litecart.conf

次の行を追加します:

<VirtualHost *:80>
     ServerAdmin [email protected]
     ServerName litecart.linuxbuz.com
     DocumentRoot /var/www/html/litecart/public_html/

     <Directory /var/www/html/litecart/>
        AllowOverride All
        allow from all
     </Directory>

     ErrorLog /var/log/apache2/litecart_error.log
     CustomLog /var/log/apache2/litecart_access.log combined
</VirtualHost>

終了したら、ファイルを保存して閉じます。次に、次のコマンドを使用して、LiteCartサイト、書き換え、およびヘッダーモジュールを有効にします。

a2ensite litecart.conf
a2enmod rewrite
a2enmod headers

最後に、Apacheサービスを再起動して、変更を適用します。

systemctl restart apache2

この時点で、ApacheWebサーバーはLiteCartを提供するように構成されています。

SSLを暗号化しようとするSecureLiteCart

Let'sEncryptの無料SSLを使用してLiteCartWebサイトを保護することをお勧めします。これを行うには、次のコマンドを使用してCertbotLet'sEncryptクライアントをインストールします。

apt-get install certbot python3-certbot-apache -y

Certbotがインストールされたら、次のコマンドを実行して、ドメインにLet'sEncryptSSLをインストールします。

certbot --apache -d litecart.linuxbuz.com

以下に示すように、メールアドレスを入力し、利用規約に同意する必要があります。

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel): [email protected]

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server at
https://acme-v02.api.letsencrypt.org/directory
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(A)gree/(C)ancel: A

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let's Encrypt project and the non-profit
organization that develops Certbot? We'd like to send you email about our work
encrypting the web, EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for litecart.linuxbuz.com
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/apache2/sites-available/litecart-le-ssl.conf
Enabled Apache socache_shmcb module
Enabled Apache ssl module
Deploying Certificate to VirtualHost /etc/apache2/sites-available/litecart-le-ssl.conf
Enabling available site: /etc/apache2/sites-available/litecart-le-ssl.conf

次に、以下に示すように、HTTPトラフィックをHTTPSにリダイレクトするかどうかを選択する必要があります。

Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2

オプション2を選択し、Enterキーを押して、以下に示すようにインストールを完了します。

Redirecting vhost in /etc/apache2/sites-enabled/litecart.conf to ssl vhost in /etc/apache2/sites-available/litecart-le-ssl.conf

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://litecart.linuxbuz.com

You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=litecart.linuxbuz.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/litecart.linuxbuz.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/litecart.linuxbuz.com/privkey.pem
   Your cert will expire on 2020-09-12. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot again
   with the "certonly" option. To non-interactively renew *all* of
   your certificates, run "certbot renew"
 - Your account credentials have been saved in your Certbot
   configuration directory at /etc/letsencrypt. You should make a
   secure backup of this folder now. This configuration directory will
   also contain certificates and private keys obtained by Certbot so
   making regular backups of this folder is ideal.
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

この時点で、LiteCartWebサイトはLet'sEncryptSSLで保護されています。これで、次のステップに進むことができます。

アクセスLiteCart

次に、Webブラウザーを開き、URLhttps://litecart.linuxbuz.comを入力します。次のページにリダイレクトされます:

インストールパス、データベースの詳細、ストア情報、管理者ユーザー名、パスワードを入力し、インストールをクリックします ボタン。インストールが正常に完了すると、次のページが表示されます。

次に、次のコマンドを使用してインストールディレクトリを削除します。

rm -rf /var/www/html/litecart/public_html/install/

管理をクリックします エリア ボタン。以下に示すように、LiteCartログインページにリダイレクトされます。

管理者のユーザー名とパスワードを入力し、ログインをクリックします ボタン。次のページにLiteCartダッシュボードが表示されます。

結論

上記のガイドでは、Ubuntu20.04にLiteCartショッピングカートをインストールして保護する方法を学びました。また、Let'sEncryptの無料SSLを使用して保護する方法も学びました。 LiteCartを使用して独自のショッピングカートアプリケーションをホストできるようになったことを願っています。


Ubuntu
  1. Ubuntu16.04LTSにBookStackをインストールする方法

  2. Ubuntu16.04LTSにLiteCartをインストールする方法

  3. Ubuntu18.04LTSにPHP7.3をインストールする方法

  1. Ubuntu18.04LTSにSOPlanningをインストールする方法

  2. Ubuntu18.04LTSにBookStackをインストールする方法

  3. Ubuntu18.04LTSにLiteCartをインストールする方法

  1. Ubuntu18.04LTSにDokuWikiをインストールする方法

  2. Ubuntu18.04LTSにCezerineコマースプラットフォームをインストールする方法

  3. Ubuntu18.04LTSにFlintCMSをインストールする方法