Wie installiert man die E-Commerce-Plattform LiteCart auf Ubuntu 20.04 LTS
LiteCart ist eine quelloffene und leichtgewichtige E-Commerce-Plattform, die in PHP, HTML 5 und CSS 3 geschrieben ist und über ein elegantes und einfaches Verwaltungspanel verfügt. LiteCart ist schneller als 99% aller Websites auf der Welt. Es ist mit einer Vielzahl von Funktionen ausgestattet, darunter innovative, leistungsstarke, Plug-and-Play-Add-Ons, SEO-freundlich, One-Step-Checkout, Unterstützung mehrerer Zeichensätze und vieles mehr.
In diesem Tutorial zeigen wir Ihnen, wie Sie die LiteCart Warenkorb-Plattform unter Ubuntu 20.04 installieren.
Voraussetzungen
- Ein Server, auf dem Ubuntu 20.04 läuft.
- Einen gültigen Domain-Namen, der auf Ihren Server zeigt.
- Auf Ihrem Server wird ein Root-Passwort konfiguriert.
Erste Schritte
Bevor Sie beginnen, wird empfohlen, Ihr System mit der neuesten stabilen Version zu aktualisieren. Sie können es mit dem folgenden Befehl aktualisieren:
apt-get update -y apt-get upgrade -y
Sobald Ihr System auf dem neuesten Stand ist, starten Sie es neu, um die Änderungen zu übernehmen:
LAMP-Server installieren
Zuerst müssen Sie den Apache-Webserver, MariaDB-Server, PHP und andere erforderliche PHP-Bibliotheken in Ihrem System installieren. Sie können sie alle mit dem folgenden Befehl installieren:
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
Sobald alle Pakete installiert sind, editieren Sie die Datei php.ini und passen Sie einige gewünschte Einstellungen an:
nano /etc/php/7.4/apache2/php.ini
Ändern Sie die folgenden Zeilen:
memory_limit = 256M upload_max_filesize = 150M max_execution_time = 360 date.timezone = Asia/Kolkata
Speichern und schließen Sie die Datei, wenn Sie fertig sind. Starten Sie dann den Apache-Dienst neu, um die Änderungen zu übernehmen:
systemctl restart apache2
Konfigurieren der MariaDB-Datenbank
Zuerst müssen Sie die MariaDB sichern und das MariaDB Root-Passwort festlegen. Sie können dies mit dem folgenden Befehl tun:
mysql_secure_installation
Beantworten Sie alle Fragen wie unten gezeigt:
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
Wenn Sie fertig sind, loggen Sie sich mit folgendem Befehl in die MariaDB-Shell ein:
mysql -u root -p
Geben Sie Ihr Root-Passwort ein, wenn Sie dazu aufgefordert werden, und erstellen Sie dann eine Datenbank und einen Benutzer für LiteCart mit folgendem Befehl: Klicken Sie auf die Schaltfläche Administrationsbereich:
MariaDB [(none)]> CREATE DATABASE litecartdb; MariaDB [(none)]> CREATE USER 'litecart'@'localhost' IDENTIFIED BY 'password';
Als nächstes erteilen Sie der litecartdb alle Berechtigungen mit dem folgenden Befehl:
MariaDB [(none)]> GRANT ALL PRIVILEGES ON litecartdb.* TO 'litecart'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
Als nächstes flushen Sie die Privilegien und verlassen die MariaDB-Shell mit dem folgenden Befehl:
MariaDB [(none)]> FLUSH PRIVILEGES; MariaDB [(none)]> EXIT;
Sobald Ihre Datenbank konfiguriert ist, können Sie mit dem nächsten Schritt fortfahren.
LiteCart herunterladen
Zum Zeitpunkt der Erstellung dieses Tutorials ist die neueste Version von LiteCart 2.2.3. Sie können sie von ihrer offiziellen Website herunterladen. Nach dem Herunterladen entpacken Sie die heruntergeladene Datei mit dem folgenden Befehl in das Apache-Web-Stammverzeichnis:
mkdir /var/www/html/litecart unzip litecart-2.2.3.1.zip -d /var/www/html/litecart
Ändern Sie als nächstes den Eigentümer des Verzeichnisses litecart in www-data und erteilen Sie die entsprechenden Berechtigungen mit dem folgenden Befehl:
chown -R www-data:www-data /var/www/html/litecart/ chmod -R 755 /var/www/html/litecart/
Sobald Sie fertig sind, können Sie mit dem nächsten Schritt fortfahren.
Apache für LiteCart konfigurieren
Erstellen Sie zunächst eine neue Apache-Konfigurationsdatei für virtuelle Hosts mit dem folgenden Befehl:
nano /etc/apache2/sites-available/litecart.conf
Fügen Sie die folgenden Zeilen hinzu:
<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>
Speichern und schließen Sie die Datei, wenn Sie fertig sind. Aktivieren Sie dann das Modul LiteCart site, rewrite und headers mit dem folgenden Befehl:
a2ensite litecart.conf a2enmod rewrite a2enmod headers
Starten Sie abschließend den Apache-Dienst neu, um die Änderungen zu übernehmen:
systemctl restart apache2
Zu diesem Zeitpunkt ist Ihr Apache-Webserver für LiteCart konfiguriert.
Sichere LiteCart mit Let’s Encrypt SSL
Es wird empfohlen, die LiteCart-Website mit Let’s Encrypt free SSL zu sichern. Installieren Sie dazu den Certbot Let’s Encrypt Client mit dem folgenden Befehl:
apt-get install certbot python3-certbot-apache -y
Sobald der Certbot installiert ist, führen Sie den folgenden Befehl aus, um Let’s Encrypt SSL für Ihre Domain zu installieren:
certbot --apache -d litecart.linuxbuz.com
Sie müssen Ihre E-Mail-Adresse angeben und die unten dargestellte Servicebedingung akzeptieren:
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
Als nächstes müssen Sie wählen, ob Sie HTTP-Verkehr auf HTTPS umleiten möchten oder nicht, wie unten gezeigt:
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
Wählen Sie Option 2 und drücken Sie Enter, um die Installation wie unten gezeigt abzuschließen:
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
Zu diesem Zeitpunkt ist Ihre LiteCart-Website mit Let’s Encrypt SSL gesichert. Sie können nun mit dem nächsten Schritt fortfahren.
Zugang zu LiteCart
Öffnen Sie nun Ihren Webbrowser und geben Sie die URL https://litecart.linuxbuz.com ein. Sie werden auf die folgende Seite umgeleitet:
Geben Sie Ihren Installationspfad, Datenbankdetails, Speicherinformationen, Admin-Benutzernamen und Passwort an und klicken Sie auf die Schaltfläche Jetzt installieren. Sobald die Installation erfolgreich abgeschlossen ist, sollten Sie die folgende Seite sehen:
Als nächstes entfernen Sie das Installationsverzeichnis mit dem folgenden Befehl:
rm -rf /var/www/html/litecart/public_html/install/
Klicken Sie auf die Schaltfläche Administrationsbereich. Sie werden zur LiteCart-Anmeldeseite wie unten dargestellt weitergeleitet:
Geben Sie Ihren Admin-Benutzernamen und Ihr Passwort ein und klicken Sie auf die Schaltfläche Login. Sie sollten das LiteCart-Dashboard auf der folgenden Seite sehen:
Schlussfolgerung
In der obigen Anleitung haben Sie gelernt, wie Sie den LiteCart-Warenkorb unter Ubuntu 20.04 installieren und sichern können. Sie haben auch gelernt, wie Sie den Warenkorb mit Let’s Encrypt free SSL sichern können. Ich hoffe, Sie können jetzt Ihre eigene Warenkorb-Anwendung mit LiteCart hosten.