如何在 Ubuntu 22.04 LTS 上安装购物软件

Shopware是一个API优先和无头的核心开放商务平台。如果您使用过Magento OR WooCommerce等电子商务平台或工作过,您会发现与它们类似的Shopware。它提供了一个美观且用户友好的Web UI,用于管理客户和订单。它允许您管理产品价格、更改或更新主题、设计用于营销产品的电子邮件模板以及生成统计结果。Shopware-logo

在 Ubuntu 22.04 LTS Jammy Jellyfish 上安装购物软件

第 1 步。首先,通过在终端中运行以下命令,确保所有系统软件包都是最新的。apt

sudo apt update
sudo apt upgrade

第 2 步。在 Ubuntu 22.04 上安装 LAMP 堆栈。

在开始本教程之前,必须在服务器上安装 LAMP 服务器。如果您没有安装 LAMP 堆栈,您可以按照我们的指南进行操作。

第 3 步。在 Ubuntu 22.04 上安装购物软件。

默认情况下,Shopware 在 Ubuntu 22.04 基本存储库中不可用。现在运行以下命令,从 Ubuntu 系统的官方页面下载最新的稳定版 Shopware:

mkdir /var/www/html/shopware
cd /var/www/html/shopware
wget http://releases.s3.shopware.com.s3.amazonaws.com/install_5.4.5_6847c0845f0f97230aa05c7294fa726a96dda3ff.zip?_ga=2.133696968.774684214.1529926951-1771999509.1528830594 -O shopware.zip

接下来,使用以下命令将 Shopware zip 文件解压缩到 webroot 目录:

unzip shopware.zip

我们需要更改一些文件夹权限:

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

第 4 步。为 Shopware 配置 Apache 。

现在为 Shopware 创建虚拟主机配置文件:

sudo nano /etc/apache2/sites-available/your-domain.com.conf

添加以下文件:

<VirtualHost *:80> 
	ServerName your-domain.com
	DocumentRoot /var/www/html/shopware

	<Directory "/var/www/html/shopware"> 
		Options Indexes FollowSymLinks MultiViews 
		AllowOverride All 
		Order allow,deny 
		allow from all 
	</Directory> 

	ErrorLog ${APACHE_LOG_DIR}/shopware-platform.error.log 
	CustomLog ${APACHE_LOG_DIR}/shopware-platform.access.log combined 
	LogLevel debug
</VirtualHost>

保存并关闭文件,然后重新启动 Apache Web 服务器,以便进行更改:

sudo a2ensite your-domain.com.conf
sudo a2enmod rewrite
sudo systemctl restart apache2

有关安装和管理 Apache 的其他资源,请阅读下面的帖子:

  • 如何在 Ubuntu Linux √ 上安装 Apache。

第5步。使用Let's Encrypt保护购物软件。

首先,您需要安装Certbot才能使用Let's Encrypt获取SSL证书:

sudo apt install certbot python3-certbot-apache

接下来,按照以下步骤使用Let's Encrypt获取SSL证书:

sudo certbot --apache

您需要按照交互式提示安装证书。由于我有两个域,我将为两个域安装 SSL 证书:

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Enter email address (used for urgent renewal and security notices)
 (Enter 'c' to cancel): admin@your-domain.com

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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. Do you agree?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing, once your first certificate is successfully issued, 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: N
Account registered.

Which names would you like to activate HTTPS for?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: your-domain.com
2: www.your-domain.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel): 1,2
Requesting a certificate for your-domain.com and www.your-domain.com
Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/domain.com/fullchain.pem
Key is saved at:         /etc/letsencrypt/live/domain.com/privkey.pem
This certificate expires on 2022-12-10.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.

Deploying certificate
Successfully deployed certificate for domain.com to /etc/apache2/sites-available/www.domain.com-le-ssl.conf
Successfully deployed certificate for www.domain.com to /etc/apache2/sites-available/www.domain.com-le-ssl.conf
Congratulations! You have successfully enabled HTTPS on https://domain.com and https://www.domain.com

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

让我们加密证书的有效期为 90 天,强烈建议在证书过期之前续订证书。您可以通过运行以下命令来测试证书的自动续订:

sudo certbot renew --dry-run

第 6 步。配置防火墙。

现在我们使用Apache设置了一个简单防火墙(UFW),以允许在HTTP和HTTPS的默认Web端口上进行公共访问:

sudo ufw allow OpenSSH
sudo ufw allow 'Apache Full'
sudo ufw enable

步骤 7.访问购物软件 Web 界面。

成功安装后,打开 Web 浏览器并使用 URL 访问 Shopware 安装向导。您将被重定向到以下页面:https://your-domain.com

installation-shopware

感谢您使用本教程在 Ubuntu 22.04 LTS Jammy Jellyfish 系统上安装 带有 LAMP 的购物软件。如需其他帮助或有用信息,我们建议您查看购物软件网站

未经允许不得转载:统信UOS之家 » 如何在 Ubuntu 22.04 LTS 上安装购物软件

相关文章