当前位置: 首页 > 工具软件 > OpenLitespeed > 使用案例 >

如何在Ubuntu 18.04上使用OpenLiteSpeed安装WordPress

蒙峰
2023-12-01

介绍 (Introduction)

WordPress is an open-source content management system (CMS). The most popular CMS in the world, WordPress allows you to set up blogs and websites on top of a MySQL database backend, using PHP to execute scripts and process dynamic content.

WordPress是一个开源内容管理系统 (CMS)。 WordPress是世界上最流行的CMS,它使您可以在MySQL数据库后端上建立博客和网站,并使用PHP执行脚本和处理动态内容。

OpenLiteSpeed is an optimized open-source web server that you can use to manage and serve websites. OpenLiteSpeed has some useful features that make it a solid choice for many installations: Apache-compatible rewrite rules, a built-in web-based administration interface, and customized PHP processing optimized for the server.

OpenLiteSpeed是一种经过优化的开源Web服务器,可用于管理和提供网站。 OpenLiteSpeed具有一些有用的功能,使其成为许多安装的可靠选择:Apache兼容的重写规则,内置的基于Web的管理界面以及针对服务器优化的自定义PHP处理。

This guide will walk through the process of installing and setting up a WordPress instance on Ubuntu 18.04 using the OpenLiteSpeed web server. Because both WordPress and OpenLiteSpeed can be administered through a web browser, this configuration is ideal for those who do not have regular access to an SSH session or those who may not feel comfortable managing a web server via the command line.

本指南将逐步介绍使用OpenLiteSpeed Web服务器在Ubuntu 18.04上安装和设置WordPress实例的过程。 由于WordPress和OpenLiteSpeed都可以通过Web浏览器进行管理,因此该配置非常适合那些无法定期访问SSH会话的用户,或者对通过命令行管理Web服务器不满意的用户。

先决条件 (Prerequisites)

Before you begin this guide, you will need the following:

在开始本指南之前,您需要满足以下条件:

第1步-为WordPress创建数据库和数据库用户 (Step 1 — Creating a Database and Database User for WordPress)

WordPress uses MySQL to manage and store site and user information. You already have MySQL installed, but as a preparatory step you need to make a database and a user for WordPress to use.

WordPress使用MySQL来管理和存储站点和用户信息。 您已经安装了MySQL,但是作为准备步骤,您需要创建一个数据库和一个供WordPress使用的用户。

To get started, connect to your server using SSH:

首先,使用SSH连接到服务器:

  • ssh sammy@your_server_IP

    ssh sammy @ your_server_IP

Then log in to the root MySQL account:

然后登录到root MySQL帐户:

  • sudo mysql

    须藤MySQL

Note: If you completed Step 3 in the prerequisite MySQL tutorial and configured your root MySQL user to authenticate with the mysql_native_password plugin, you’ll need to log in with the following command:

注意:如果您完成了前提条件MySQL教程中的步骤3 ,并配置了root MySQL用户以使用mysql_native_password插件进行身份验证,则需要使用以下命令登录:

  • mysql -u root -p

    mysql -u root -p

Then enter your root user’s password when prompted.

然后在出现提示时输入用户的密码。

From the MySQL prompt, create a database with the following command. Here, we will name this database wordpress to keep things simple, but you can name it whatever you’d like:

在MySQL提示符下,使用以下命令创建数据库。 在这里,我们将这个数据库wordpress命名为简单wordpress ,但是您可以随意命名它:

  • CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;

    创建数据库wordpress默认字符集utf8 COLLATE utf8_unicode_ci;

Then, create a user and grant it privileges over the database you just created. Again, you can give this user any name, but for simplicity we will name it wordpressuser. Also, be sure to change password to a strong password of your own choosing:

然后,创建一个用户并授予其对刚创建的数据库的特权。 同样,您可以给该用户任何名称,但为简单起见,我们将其命名为wordpressuser 。 另外,请确保将password更改为您自己选择的强密码:

  • GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpressuser'@'localhost' IDENTIFIED BY 'password';

    将所有特权授予wordpress 。*到' wordpressuser '@'localhost'由' password '标识;

Then, run FLUSH PRIVILEGES which tells the server to reload the grant tables and put your new changes into effect:

然后,运行FLUSH PRIVILEGES ,告诉服务器重新加载授权表并使新更改生效:

  • FLUSH PRIVILEGES;

    冲洗特权;

Following that, you can close the MySQL prompt:

然后,您可以关闭MySQL提示符:

  • exit

    出口

You’re done setting up your MySQL installation to work with WordPress. Next, we will install a few PHP extensions.

您已经完成将MySQL安装与WordPress配合使用的设置。 接下来,我们将安装一些PHP扩展。

第2步-安装其他PHP扩展 (Step 2 — Installing Additional PHP Extensions)

In the prerequisite OpenLiteSpeed tutorial, you installed the lsphp73 package. This is a compilation of PHP optimized for OpenLiteSpeed which uses the LiteSpeed SAPI to communicate with external applications. Depending on your needs, WordPress may require other certain PHP extensions in order to function as desired.

在必备的OpenLiteSpeed教程中,您安装了lsphp73软件包。 这是针对OpenLiteSpeed进行了优化PHP编译,它使用LiteSpeed SAPI与外部应用程序进行通信。 根据您的需求,WordPress可能需要其他某些PHP扩展才能正常运行。

To install some PHP extensions commonly used with WordPress, run the following command:

要安装一些WordPress常用PHP扩展,请运行以下命令:

  • sudo apt install lsphp73-common lsphp73-curl lsphp73-imagick lsphp73-imap lsphp73-json lsphp73-memcached lsphp73-mysql lsphp73-opcache lsphp73-redis

    须藤apt install lsphp73-common lsphp73-curl lsphp73-imagick lsphp73-imap lsphp73-json lsphp73-memcached lsphp73-mysql lsphp73-opcache lsphp73-redis

Note: The packages in this command may not cover every use case. For a full list of the PHP 7.3 extensions available from the LiteSpeed repository you added to your server in the prerequisite tutorial, see the LiteSpeed Wiki.

注意:此命令中的软件包可能无法涵盖所有​​用例。 有关在前提条件教程中添加到服务器的LiteSpeed存储库中可用PHP 7.3扩展的完整列表, 请参见LiteSpeed Wiki

Following this, you can move on to downloading and setting up WordPress on your server.

之后,您可以继续在服务器上下载并设置WordPress。

第3步-下载WordPress (Step 3 — Downloading WordPress)

Now that your server software is configured, you can install and set up WordPress. For security reasons in particular, it is always recommended that you get the latest version of WordPress directly from their site.

现在已经配置了服务器软件,您可以安装和设置WordPress。 特别是出于安全原因,始终建议您直接从其站点获取最新版本的WordPress。

Change into a writable directory and then download the compressed release by typing:

切换到可写目录,然后通过键入以下命令下载压缩版本:

  • cd /tmp

    cd / tmp
  • curl -O https://wordpress.org/latest.tar.gz

    curl -O https://wordpress.org/latest.tar.gz

Extract the compressed file to create the WordPress directory structure:

解压缩压缩文件以创建WordPress目录结构:

  • tar xzvf latest.tar.gz

    tar xzvf Latest.tar.gz

We will move these files into our document root momentarily, but first we will create a few files and directories that the WordPress installation will depend on.

我们将这些文件暂时移到我们的文档根目录中,但是首先我们将创建一些WordPress安装所依赖的文件和目录。

OpenLiteSpeed supports .htaccess files. This is important for our purposes, since WordPress uses .htaccess files to create and manage permalinks.

OpenLiteSpeed支持.htaccess文件。 这对于我们的目的很重要,因为WordPress使用.htaccess文件来创建和管理永久链接。

Add a dummy .htaccess file so that it will be available for WordPress to use later:

添加一个虚拟的.htaccess文件,以便WordPress稍后可以使用:

  • touch /tmp/wordpress/.htaccess

    触摸/tmp/wordpress/.htaccess

Next, copy over the sample configuration file to the filename that WordPress actually reads:

接下来,将示例配置文件复制到WordPress实际读取的文件名:

  • cp /tmp/wordpress/wp-config-sample.php /tmp/wordpress/wp-config.php

    cp /tmp/wordpress/wp-config-sample.php /tmp/wordpress/wp-config.php

Additionally, create the upgrade directory so that WordPress won’t run into permissions issues when trying to do this on its own following an update to its software:

此外,创建upgrade目录,以使WordPress在软件更新后尝试自行执行此操作时,不会遇到权限问题:

  • mkdir /tmp/wordpress/wp-content/upgrade

    mkdir / tmp / wordpress / wp-content / upgrade

Then, copy the entire contents of the directory into your document root. OpenLiteSpeed comes with a default virtual host named Example located in the /usr/local/lsws/ directory. The document root for the Example virtual host is the html subdirectory:

然后,将目录的全部内容复制到文档根目录中。 OpenLiteSpeed带有默认的虚拟主机命名Example地处/usr/local/lsws/目录。 Example虚拟主机的文档根目录是html子目录:

  • sudo cp -a /tmp/wordpress/. /usr/local/lsws/Example/html/wordpress

    须藤cp -a / tmp / wordpress /。 / usr / local / lsws / Example / html / wordpress

Notice that this command includes a dot at the end of the source directory to indicate that everything within the directory should be copied, including hidden files (like the .htaccess file you created):

请注意,此命令在源目录的末尾包含一个点,指示应复制目录中的所有内容,包括隐藏文件(如您创建的.htaccess文件):

With that, you’ve successfully installed WordPress onto your web server and performed some of the initial configuration steps. Next, we’ll go through some further configuration changes that will give WordPress the privileges it needs to function securely and access the MySQL database and user account you created previously.

这样,您就成功地将WordPress安装到Web服务器上并执行了一些初始配置步骤。 接下来,我们将进行一些进一步的配置更改,这些更改将为WordPress提供安全运行所需的特权,并访问您先前创建MySQL数据库和用户帐户。

第4步-配置WordPress目录 (Step 4 — Configuring the WordPress Directory)

Before we can go through the web-based setup process for WordPress, we need to adjust some items in our WordPress directory.

在我们完成针对WordPress的基于Web的设置过程之前,我们需要调整WordPress目录中的某些项目。

Start by giving ownership of all the files in the directory to the nobody user and the nogroup group, which the OpenLiteSpeed web server runs as by default. The following chown command will grant OpenLiteSpeed the ability to read and write files in the wordpress directory, allowing it to serve the website and perform automatic updates:

通过给所有文件的所有权在目录中nobody用户和nogroup组,其中OpenLiteSpeed运行Web服务器的默认启动。 以下chown命令将使OpenLiteSpeed能够读写wordpress目录中的文件,从而使其能够为网站提供服务并执行自动更新:

  • sudo chown -R nobody:nogroup /usr/local/lsws/Example/html/wordpress

    sudo chown -R none:nogroup / usr / local / lsws / Example / html / wordpress

Next run two find commands to set the correct permissions on the WordPress directories and files:

接下来运行两个find命令来设置WordPress目录和文件的正确权限:

  • sudo find /usr/local/lsws/Example/html/wordpress/ -type d -exec chmod 750 {} \;

    sudo查找/ usr / local / lsws / Example / html / wordpress / -type d -exec chmod 750 {} \;

  • sudo find /usr/local/lsws/Example/html/wordpress/ -type f -exec chmod 640 {} \;

    sudo查找/ usr / local / lsws / Example / html / wordpress / -type f -exec chmod 640 {} \;

These should be a reasonable permissions set to start with, although some plugins and procedures might require additional tweaks.

尽管某些插件和过程可能需要进行其他调整,但这些应该是一个合理的权限设置。

Following this, you will need to make some changes to the main WordPress configuration file.

之后,您将需要对主WordPress配置文件进行一些更改。

When you open the file, your first objective will be to adjust some secret keys to provide some security for your installation. WordPress provides a secure generator for these values so that you do not have to try to come up with good values on your own. These are only used internally, so it doesn’t hurt usability to have complex, secure values here.

打开文件时,您的首要目标是调整一些秘密密钥,以为安装提供一些安全性。 WordPress为这些值提供了安全的生成器,因此您不必自己尝试提出好的值。 这些仅在内部使用,因此在这里使用复杂,安全的值不会损害可用性。

To grab secure values from the WordPress secret key generator, type:

要从WordPress密钥生成器获取安全值,请输入:

  • curl -s https://api.wordpress.org/secret-key/1.1/salt/

    curl -s https://api.wordpress.org/secret-key/1.1/salt/

You will get back unique values that look something like this:

您将获得看起来像这样的唯一值:

Warning! It is important that you request unique values each time. Do NOT copy the values shown below!

警告! 每次都要求唯一值很重要。 不要复制下面所示的值!


   
   
Output
define('AUTH_KEY', '1jl/vqfs<XhdXoAPz9 DO NOT COPY THESE VALUES c_j{iwqD^<+c9.k<J@4H'); define('SECURE_AUTH_KEY', 'E2N-h2]Dcvp+aS/p7X DO NOT COPY THESE VALUES {Ka(f;rv?Pxf})CgLi-3'); define('LOGGED_IN_KEY', 'W(50,{W^,OPB%PB<JF DO NOT COPY THESE VALUES 2;y&,2m%3]R6DUth[;88'); define('NONCE_KEY', 'll,4UC)7ua+8<!4VM+ DO NOT COPY THESE VALUES #`DXF+[$atzM7 o^-C7g'); define('AUTH_SALT', 'koMrurzOA+|L_lG}kf DO NOT COPY THESE VALUES 07VC*Lj*lD&?3w!BT#-'); define('SECURE_AUTH_SALT', 'p32*p,]z%LZ+pAu:VY DO NOT COPY THESE VALUES C-?y+K0DK_+F|0h{!_xY'); define('LOGGED_IN_SALT', 'i^/G2W7!-1H2OQ+t$3 DO NOT COPY THESE VALUES t6**bRVFSD[Hi])-qS`|'); define('NONCE_SALT', 'Q6]U:K?j4L%Z]}h^q7 DO NOT COPY THESE VALUES 1% ^qUswWgn+6&xqHN&%');

These are configuration lines that you will paste directly into your configuration file to set secure keys. Copy the output you received to your clipboard, and then open the WordPress configuration file located in your document root:

这些是配置行,您将直接将其粘贴到配置文件中以设置安全密钥。 将收到的输出复制到剪贴板,然后打开文档根目录中的WordPress配置文件:

  • sudo nano /usr/local/lsws/Example/html/wordpress/wp-config.php

    须藤nano / usr / local / lsws / Example / html / wordpress /wp-config.php

Find the section that contains the dummy values for those settings. It will look something like this:

找到包含那些设置的虚拟值的部分。 它看起来像这样:

/var/www/wordpress/wp-config.php
/var/www/wordpress/wp-config.php
. . .

define('AUTH_KEY',         'put your unique phrase here');
define('SECURE_AUTH_KEY',  'put your unique phrase here');
define('LOGGED_IN_KEY',    'put your unique phrase here');
define('NONCE_KEY',        'put your unique phrase here');
define('AUTH_SALT',        'put your unique phrase here');
define('SECURE_AUTH_SALT', 'put your unique phrase here');
define('LOGGED_IN_SALT',   'put your unique phrase here');
define('NONCE_SALT',       'put your unique phrase here');

. . .

Delete these lines and paste in the values you copied from the command line:

删除这些行并粘贴从命令行复制的值:

/var/www/wordpress/wp-config.php
/var/www/wordpress/wp-config.php
. . .

define('AUTH_KEY',         'VALUES COPIED FROM THE COMMAND LINE');
define('SECURE_AUTH_KEY',  'VALUES COPIED FROM THE COMMAND LINE');
define('LOGGED_IN_KEY',    'VALUES COPIED FROM THE COMMAND LINE');
define('NONCE_KEY',        'VALUES COPIED FROM THE COMMAND LINE');
define('AUTH_SALT',        'VALUES COPIED FROM THE COMMAND LINE');
define('SECURE_AUTH_SALT', 'VALUES COPIED FROM THE COMMAND LINE');
define('LOGGED_IN_SALT',   'VALUES COPIED FROM THE COMMAND LINE');
define('NONCE_SALT',       'VALUES COPIED FROM THE COMMAND LINE');

. . .

Next, modify the database connection settings at the top of the file. You need to adjust the database name, database user, and the associated password that you configured within MySQL.

接下来,修改文件顶部的数据库连接设置。 您需要调整数据库名称,数据库用户以及在MySQL中配置的关联密码。

The other change you must make is to set the method that WordPress should use to write to the filesystem. Since we’ve given the web server permission to write where it needs to, we can explicitly set the filesystem method to direct. Failure to set this with our current settings would result in WordPress prompting for FTP credentials when you perform certain actions.

您还必须进行的另一项更改是设置WordPress用于写入文件系统的方法。 由于我们已授予Web服务器写入所需位置的权限,因此我们可以将filesystem方法显式设置为direct 。 如果未使用我们当前的设置进行设置,则当您执行某些操作时,WordPress会提示您输入FTP凭据。

This setting can be added below the database connection settings, or anywhere else in the file:

此设置可以添加到数据库连接设置下面,或文件中的其他任何位置:

/var/www/wordpress/wp-config.php
/var/www/wordpress/wp-config.php
. . .

define('DB_NAME', 'wordpress');

/** MySQL database username */
define('DB_USER', 'wordpressuser');

/** MySQL database password */
define('DB_PASSWORD', 'password');

. . .

define('FS_METHOD', 'direct');

Save and close the file when you are finished.

完成后保存并关闭文件。

At this point, WordPress is not quite fully configured on your system, as you still need to apply a few finishing touches before you can start publishing content. In order to do that, though, you’ll first need to make a few configuration changes to your OpenLiteSpeed installation.

此时,WordPress尚未在您的系统上完全配置,因为在开始发布内容之前,您仍然需要进行一些修饰。 但是,为此,您首先需要对OpenLiteSpeed安装进行一些配置更改。

第6步-配置OpenLiteSpeed (Step 6 — Configuring OpenLiteSpeed)

Currently, you have WordPress installed on your Ubuntu server, but your OpenLiteSpeed installation hasn’t yet been configured to serve it. In this step, we’ll access the OpenLiteSpeed administrative interface and make a few changes to your server’s configuration.

当前,您已在Ubuntu服务器上安装了WordPress,但尚未配置OpenLiteSpeed安装来为其提供服务。 在此步骤中,我们将访问OpenLiteSpeed管理界面,并对服务器的配置进行一些更改。

In your preferred web browser, navigate to the OpenLiteSpeed administrative interface. You can find this by entering your server’s public IP address or the domain name associated with it, followed by :7080, in your browser’s address bar:

在您喜欢的Web浏览器中,导航到OpenLiteSpeed管理界面。 您可以通过在浏览器的地址栏中输入服务器的公共IP地址或与之关联的域名来找到它,然后输入:7080

https://server_domain_or_IP:7080

There, you will be presented with a login screen. Enter the username and password you defined in the prerequisite OpenLiteSpeed installation tutorial:

在那里,您将看到一个登录屏幕。 输入您在必备的OpenLiteSpeed安装教程中定义的用户名和密码:

From the OpenLiteSpeed console, find and click on Server Configuration in the left-hand sidebar menu. Then navigate to the External App tab, find the row of the LiteSpeed SAPI App, and click on its Edit button:

在OpenLiteSpeed控制台中,找到并单击左侧边栏菜单中的“ 服务器配置 ”。 然后导航到“ 外部应用程序”选项卡,找到LiteSpeed SAPI App的行,然后单击其“ 编辑”按钮:

Recall that in the prerequisite OpenLiteSpeed tutorial, you installed the lsphp73 package, a compilation of PHP optimized to work with OpenLiteSpeed through the LiteSpeed SAPI. However, the default settings in the External App page point to lsphp rather than lsphp73. Because of this, your OpenLiteSpeed installation won’t be able to correctly execute PHP scripts.

回想一下,在必备的OpenLiteSpeed教程中,您安装了lsphp73软件包,该软件包是PHP的一个优化版本,经过优化可通过LiteSpeed SAPI与OpenLiteSpeed一起使用。 但是,“ 外部应用程序”页面中的默认设置指向lsphp而不是lsphp73 。 因此,您的OpenLiteSpeed安装将无法正确执行PHP脚本。

To correct this, change the Name field to lsphp73, change the Address field to uds://tmp/lshttpd/lsphp73.sock, and change the Command field to read $SERVER_ROOT/lsphp73/bin/lsphp:

要解决此问题,请将“ 名称”字段更改为lsphp73 ,将“ 地址”字段更改为uds://tmp/lshttpd/lsphp73.sock ,然后将“ 命令”字段更改为$SERVER_ROOT/lsphp73/bin/lsphp

After making those changes, click on the Save icon in the upper right-hand corner of the LiteSpeed SAPI App box.

进行这些更改后,单击LiteSpeed SAPI App框右上角的Save图标。

Next, click on Virtual Hosts in the left-hand menu. On the Virtual Hosts page, find the virtual host you plan to use and click on its View icon. Here, we’ll use the default Example virtual host:

接下来,单击左侧菜单中的虚拟主机 。 在“ 虚拟主机”页面上,找到您计划使用的虚拟主机,然后单击其“ 查看”图标。 在这里,我们将使用默认的示例虚拟主机:

Navigate to the virtual host’s General tab. There, find the General section, and click on its Edit button:

导航到虚拟主机的“ 常规”选项卡。 在此处找到“ 常规”部分,然后单击其“ 编辑”按钮:

OpenLiteSpeed looks at the contents of the Document Root field for content to serve. Because all of your WordPress content and files are stored in the wordpress directory you created earlier, update the Document Root field to point to that directory. To do this, all you need to do is append wordpress/ to the end of the default value:

OpenLiteSpeed在“ 文档根目录”字段中查找要提供的内容。 由于所有WordPress内容和文件都存储在您先前创建的wordpress目录中,因此请更新“ 文档根目录”字段以指向该目录。 为此,您需要做的就是将wordpress/附加到默认值的末尾:

Click the Save icon to save this change.

单击保存图标以保存此更改。

Next, you need to enable index.php files so that they can be used to process requests that aren’t handled by static files. This will allow the main logic of WordPress to function correctly.

接下来,您需要启用index.php文件,以便可以将它们用于处理静态文件未处理的请求。 这将使WordPress的主要逻辑能够正确运行。

While still in the General tab, scroll down to find the Index Files section and click on its Edit icon:

仍在“ 常规”选项卡中时,向下滚动以找到“ 索引文件”部分,然后单击其“ 编辑”图标:

In the Index Files field, precede index.html with index.php,. By putting index.php before index.html, you’re allowing PHP index files to take precedence. After updating this field, it will look like this:

在“ 索引文件”字段中,在index.html之前加上index.php, 通过将index.php放在index.html之前,可以使PHP索引文件具有优先权。 更新此字段后,它将如下所示:

Be sure to click the Save icon before continuing.

在继续操作之前,请确保单击“ 保存”图标。

Next, navigate to the virtual host’s Rewrite tab. Find the Rewrite Control section and press the Edit button:

接下来,导航到虚拟主机的“ 重写”选项卡。 找到“ 重写控件”部分,然后按“ 编辑”按钮:

Set both the Enable Rewrite and Auto Load from .htaccess options to Yes by clicking the respective radial buttons. Configuring rewrite instructions in this fashion will allow you to use permalinks within your WordPress installation:

通过单击相应的径向按钮,将Yes 从.htaccess 启用重写自动加载”选项都设置为“ Yes 。 以这种方式配置重写指令将使您可以在WordPress安装中使用永久链接:

Click the Save icon after making those changes.

进行更改后,单击“ 保存”图标。

The default virtual host that is included with the OpenLiteSpeed installation includes some password protected areas to showcase OpenLiteSpeed’s user authentication features. WordPress includes its own authentication mechanisms and we will not be using the file-based authentication included in OpenLiteSpeed. We should get rid of these in order to minimize the stray configuration fragments active on our WordPress installation.

OpenLiteSpeed安装随附的默认虚拟主机包括一些受密码保护的区域,以展示OpenLiteSpeed的用户身份验证功能。 WordPress包含自己的身份验证机制,我们将不会使用OpenLiteSpeed中包含的基于文件的身份验证。 我们应该摆脱这些限制,以最大程度地减少WordPress安装中活跃的配置错误片段。

First, click on the Security tab, and then click the Delete button next to SampleProtectedArea within the Realms List table:

首先,单击“ 安全性”选项卡,然后在“ 领域列表”表中单击SampleProtectedArea旁边的“ 删除”按钮:

You will be asked to confirm the deletion. Click Delete to proceed.

系统将要求您确认删除。 单击删除继续。

Next, click on the Context tab. In the Context List, delete the /protected/ context that was associated with the security realm you just deleted:

接下来,单击“ 上下文”选项卡。 在“ 上下文列表”中 ,删除与刚删除的安全领域关联的/protected/上下文:

Again, you will have to confirm the deletion by clicking Delete.

同样,您将必须通过单击Delete确认删除

You can safely delete any or all of the other contexts as well using the same technique, as we will not be needing them. We specifically deleted the /protected/ context because otherwise an error would be produced due to the deletion of its associated security realm (which we just removed in the Security tab).

您也可以使用相同的技术安全删除任何或所有其他上下文,因为我们将不需要它们。 我们专门删除了/protected/上下文,因为否则会由于删除与其相关的安全领域(我们刚刚在“ 安全性”选项卡中将其删除)而产生错误。

Following that, press the green Graceful Restart icon in the upper-right corner of the OpenLiteSpeed console. This will restart the OpenLiteSpeed server, causing the changes you’ve made to go into effect:

之后,请按OpenLiteSpeed控制台右上角的绿色Graceful Restart图标。 这将重新启动OpenLiteSpeed服务器,使您所做的更改生效:

With that, your OpenLiteSpeed server is fully configured. You’re ready to finish setting up WordPress in your browser.

这样,您的OpenLiteSpeed服务器就已完成配置。 您已经准备好在浏览器中完成WordPress的设置。

第7步-通过WordPress界面完成安装 (Step 7 — Completing the Installation through the WordPress Interface)

Now that the server configuration is complete, we can complete the installation through the web interface.

现在服务器配置已完成,我们可以通过Web界面完成安装。

In your web browser, navigate to your server’s domain name or public IP address:

在Web浏览器中,导航到服务器的域名或公共IP地址:

http://server_domain_or_IP

Select the language you would like to use:

选择您要使用的语言:

Next, you will come to the main setup page. Select a name for your WordPress site and choose a username (it is recommended not to choose something like “admin” for security purposes). A strong password is generated automatically. Save this password or select an alternative strong password.

接下来,您将进入主设置页面。 为您的WordPress网站选择一个名称,然后选择一个用户名(出于安全考虑,建议不要选择“ admin”之类的名称)。 系统会自动生成一个强密码。 保存此密码或选择其他强密码。

Enter your email address and select whether you want to discourage search engines from indexing your site:

输入您的电子邮件地址,然后选择是否要阻止搜索引擎将您的网站编入索引:

When ready, click the Install WordPress button. You’ll be taken to a page that prompts you to log in:

准备就绪后,单击“ 安装WordPress”按钮。 您将被带到一个页面,提示您登录:

Once you log in, you will be taken to the WordPress administration dashboard:

登录后,您将被带到WordPress管理仪表板:

From the dashboard, you can begin making changes to your site’s theme and publishing content.

在仪表板上,您可以开始更改网站的主题并发布内容。

结论 (Conclusion)

By completing this guide, you installed and configured a WordPress instance on Ubuntu 18.04 server running OpenLiteSpeed. Some common next steps are to choose the permalinks setting for your posts (which can be found in Settings > Permalinks) or to select a new theme (in Appearance > Themes). If this is your first time using WordPress, explore the interface a bit to get acquainted with your new CMS.

通过完成本指南,您可以在运行OpenLiteSpeed的Ubuntu 18.04服务器上安装并配置WordPress实例。 接下来的一些常见步骤是为您的帖子选择永久链接设置(可以在“设置” >“ 永久链接”中找到)或选择一个新主题(在“ 外观” >“ 主题”中 )。 如果这是您第一次使用WordPress,请稍微探索一下界面以熟悉新的CMS。

To enhance your new WordPress site’s security, we recommend that you configure it to function with SSL so it can serve content over HTTPS. Check out this tutorial from the OpenLiteSpeed documentation to install LetsEncrypt and set this up.

为了增强新WordPress网站的安全性,建议您将其配置为可与SSL配合使用,以便它可以通过HTTPS提供内容。 从OpenLiteSpeed文档中查看本教程,以安装LetsEncrypt并进行设置。

翻译自: https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-openlitespeed-ubuntu-1804

 类似资料: