6
3

More than 3 years have passed since last update.

LiteSpeedを試しに動かしてみた

Last updated at Posted at 2020-06-09

LiteSpeedとは

以下の特徴があるWebサーバです。

特徴

  • NGINXの様なイベント駆動型アーキテクチャ
  • キャッシュ機能やページスピード最適化の機能など速さを売りにしている
  • Apachemod_rewriteと互換がある
  • HTTP/3&HTTP/2のサポート
  • 複数バージョンのPHP対応など

※その他詳細は公式サイトを御覧下さい

バージョンの違い

LiteSpeedにはEnterprise版とOSS版があり、今回はOSS版のOpenLiteSpeed(以降OLS)を試しに動かしてみました。

  • Enterprise
    • LiteSpeed Web Server Enterprise
  • OSS
    • OpenLiteSpeed(OLS)

セットアップについて

今回はCentOS7のサーバで試しに動かしてみました。

OLSのインストール手順

OLSのインストール

リポジトリのセットアップを行う

$ sudo rpm -Uvh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el7.noarch.rpm 

そのままopenlitespeedをインストールしようとするとlibargon2.so.0()(64bit)が無くてエラーになるので、予めインストールしておく
参考: How To Install OpenLiteSpeed Web Server on CentOS/RHEL 7

$ cd /var/tmp/
$ wget http://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/l/libargon2-20161029-3.el7.x86_64.rpm
$ sudo yum install libargon2-20161029-3.el7.x86_64.rpm

OLSをインストールする

$ sudo yum install openlitespeed

OLSの起動状態確認

$ sudo /usr/local/lsws/bin/lswsctrl status
[sudo] password for user:
litespeed is running with PID 26887.

PHPを複数バージョンインストールする場合

バージョン指定でPHPをインストールしたい場合はlsphpXXのプリフィクスがついたパッケージをインストールする。
2020/06/09現在最新はlsphp73、一番古いものだとlsphps52がインストールできるようです。
openlitespeedインストール時にlsphp73が依存パッケージとしてインストールされるため、最新よりのパッケージは明示的に入れなくても依存で入ってくる可能性があります。

コマンド例(php53の場合)
$ sudo yum install lsphp53 lsphp53-common lsphp53-mysql lsphp53-gd lsphp53-process lsphp53-mbstring lsphp53-xml lsphp53-mcrypt lsphp53-pdo lsphp53-imap lsphp53-soap lsphp53-bcmath

$ ls -l /usr/local/lsws/fcgi-bin/lsphp5
-r-xr-xr-x 1 root root 4902224 Feb 22 01:28 /usr/local/lsws/fcgi-bin/lsphp5

$ sudo ln -sf /usr/local/lsws/lsphp53/bin/lsphp /usr/local/lsws/fcgi-bin/lsphp5

$ ls -l /usr/local/lsws/fcgi-bin/lsphp5
lrwxrwxrwx 1 root root 33 Mar 16 09:53 /usr/local/lsws/fcgi-bin/lsphp5 -> /usr/local/lsws/lsphp53/bin/lsphp
コマンド例(もし明示的にphp73をインストールする場合)
$ sudo yum install lsphp73 lsphp73-common lsphp73-mysql lsphp73-gd lsphp73-process lsphp73-mbstring lsphp73-xml lsphp73-mcrypt lsphp73-pdo lsphp73-imap lsphp73-soap lsphp73-bcmath

$ ls -l /usr/local/lsws/fcgi-bin/lsphp5
-r-xr-xr-x 1 root root 4902224 Feb 22 01:28 /usr/local/lsws/fcgi-bin/lsphp5

$ sudo ln -sf /usr/local/lsws/lsphp73/bin/lsphp /usr/local/lsws/fcgi-bin/lsphp5

$ ls -l /usr/local/lsws/fcgi-bin/lsphp5
lrwxrwxrwx 1 root root 33 Mar 16 09:53 /usr/local/lsws/fcgi-bin/lsphp5 -> /usr/local/lsws/lsphp73/bin/lsphp

初期設定

OLSの管理画面にログインするため、アカウントが必要なので予め作っておく

管理画面ログイン用のアカウントを作成する
$ sudo /usr/local/lsws/admin/misc/admpass.sh
[sudo] password for user:

Please specify the user name of administrator.
This is the user name required to login the administration Web interface.

User name [admin]: admin

Please specify the administrator's password.
This is the password required to login the administration Web interface.

Password:
Retype password:
Administrator's username/password is updated successfully!

動作確認

サンプルページへのアクセス

http://xxx.xxx.xxx.xxx:8088/ へアクセスし、以下のサンプルページが表示されることを確認する

OpenLiteSpeed_Congratulations.png

管理画面へのアクセス

https://xxx.xxx.xxx.xxx:7080/login.php へアクセスし、予め作成した任意のユーザでログインする

OpenLiteSpeed_manage_page.png

おわりに

このあと、vhosts(virtualhosts)設定ReWrite設定など行いますすが、ひとまず今回はサンプルページと管理画面を表示するところまで記事にしました。

6
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
3