WordPress – OpenLiteSpeed

  • A+
所属分类:WordPress技巧

已发布

最后更新时间

经过埃里克

安装:在 OpenLiteSpeed 上快速安装 WordPress

The easiest way to install OpenLiteSpeed, WordPress, MySQL, and PHP is using our ols1clk script.
Otherwise, after you install OpenLiteSpeed, follow the instructions below to get your WordPress site working.

  1. Install PHP modules
  2. MariaDB Installation
  3. Create WordPress DB Account
  4. Download and Extract WordPress
  5. Set Index File and rewrite rules
  6. Run the WordPress install script

Install PHP Modules

The easiest way to install PHP for OpenLiteSpeed (without ols1clk) is through our CentOS repository. If the LiteSpeed Repository was not installed and enabled during the web server installation, follow this guide to install and enable the LiteSpeed Repository.

Step 1. Install PHP

Use the following command to install PHP with the modules required:

yum install lsphp72 lsphp72-common lsphp72-gd lsphp72-process lsphp72-mbstring lsphp72-mysqlnd lsphp72-xml lsphp72-opcache

Note: There are multi versions of LSPHP (lsphp53, lsphp54, lsphp55, lsphp56, lsphp70, lsphp71, lsphp72, lsphp73) available.

Step 2. Set up PHP

Visit http://your_server_IP:7080. Navigate to Server Configuration > External app, then click the second icon Edit on the right hand side in order to edit this application.
Modify:
Name: lsphp → lsphp72
Address: uds://tmp/lshttpd/lsphp.sock → uds://tmp/lshttpd/lsphp72.sock
Command: $SERVER_ROOT/fcgi-bin/lsphp5 → $SERVER_ROOT/lsphp72/bin/lsphp

If you are not using RPM/APT, or you prefer to build PHP by yourself, see our instructions for building PHP for WordPress here.

Step 3. Restart LSWS

When you are finished, click the Save icon to save your changes, then click the Graceful Restart button.

Step 4. PHP Verification (Optional)

Visit http://your_server_IP:8088/phpinfo.php and make sure PHP Version shows 7.2.x.

WordPress – OpenLiteSpeed

MariaDB Installation

Install MariDB:

yum install mariadb-server
systemctl start mariadb

Set new password:

/usr/bin/mysql_secure_installation

Enter $yourpassword

Create WordPress DB Account

mysql -u root -p$yourmysqlpassword
create database wordpress; 
grant all privileges on wordpress.* to wordpress@localhost identified by 'wordpress'; 
exit;

Download and Extract WordPress

To illustrate setting up WordPress on a vhost we’ll use the default virtual host, “Example”. You can download WordPress from command or their official download page. Please note that the document root of ‘Example’ virtual host is /usr/local/lsws/Example/html/.

cd /usr/local/lsws/Example/html
wget http://wordpress.org/latest.zip
unzip latest.zip

Grant the Web Server User Write Permission to Create wp-config.php During Installation

chown -R nobody:nobody wordpress

Set Index File

需要在 LiteSpeed Web Admin Console 中设置索引文件。导航到 Virtual Hosts > Select Virtual Host from List > General > Index Files,点击右上角 的Edit , 在 Index Files 框中 输入 index.html,index.php 。

WordPress – OpenLiteSpeed

在 vHost 中添加重写规则以使永久链接工作

转到WebAdmin 控制台 > 虚拟主机 > 示例 > 常规 > 重写然后更改以下设置:

  • 启用重写 > 是。
  • 从 .htaccess 自动加载 > 是

优雅重启

完成后,单击“ 保存” 图标以保存更改,然后单击“正常 重启” 按钮。

运行 WordPress 安装脚本

步骤 1.运行安装脚本

将默认端口的浏览器指向 http://server_ip:8088/wordpress/wp-admin/install.php

如您所见,WordPress 将在下一步询问所有与数据库相关的信息,并将 wp-config.php 使用此信息创建文件。如果由于某些原因(主要是权限问题)WordPress 无法创建此文件,它将为您提供数据,您可以 wp-config.php 在 WordPress 主页中复制和手动创建文件。

WordPress – OpenLiteSpeed

步骤 2.数据库配置

我们已经在上面创建了数据库。只需输入详细信息,然后单击 Next

WordPress – OpenLiteSpeed

Step 3. 输入通用配置

在此页面上,安装程序会询问有关该站点的一些一般性问题。您可以根据需要填写它们。

完成后,单击安装。

WordPress – OpenLiteSpeed

WordPress 现已成功安装,您可以浏览:

  • Front page: http://server_IP:8088/wordpress/

  • Admin page: http://server_IP:8088/wordpress/wp-admin

Set Up WordPress Caching (Optional)

Follow the steps described on this page to set up the LSCache for WordPress plugin

Tags:

  • 我的微信
  • 这是我的微信扫一扫
  • weinxin
  • 我的微信公众号
  • 我的微信公众号扫一扫
  • weinxin