目次
文書の過去の版を表示しています。
OpenLiteSpeed
本家: Get OpenLiteSpeed!
LiteSpeed | Internet. Accelerated. - LiteSpeed Technologies
ソースコード: litespeedtech/openlitespeed: Our high-performance, lightweight, open source HTTP server
OpenLiteSpeed は、LiteSpeed Web Server Enterprise のオープンソース版である。
主な特徴は、NGINX よりも高速、イベント駆動型アーキテクチャ、Apache 書き換えルールの理解、使いやすい管理インターフェイス、スピードとセキュリティのためのビルド、インテリジェントキャッシュアクセラレーション、PageSpeed の最適化、PHP LiteSpeed SAPI などである。
インストール
バイナリ インストール
参考文献: How to Install OpenLiteSpeed from Binary • OpenLiteSpeed
ダウンロード ページから OpenLiteSpeed バイナリを ダウンロード する。
$ curl -O https://openlitespeed.org/packages/openlitespeed-1.7.0.tgz % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 49.2M 100 49.2M 0 0 635k 0 0:01:19 0:01:19 --:--:-- 941k $ rm -rf openlitespeed/ $ tar zxvf openlitespeed-1.7.0.tgz openlitespeed/ openlitespeed/modules/ openlitespeed/modules/modinspector.so ... $ cd openlitespeed $ sudo ./install.sh $ sudo systemctl start lshttpd $ systemctl status lshttpd ● lshttpd.service - OpenLiteSpeed HTTP Server Loaded: loaded (/usr/lib/systemd/system/lshttpd.service; enabled; vendor preset: disabled) Active: active (running) since Tue 2020-03-31 02:06:35 JST; 2 days ago Main PID: 6545 (litespeed) CGroup: /system.slice/lshttpd.service ├─6545 openlitespeed (lshttpd - main) ├─6550 openlitespeed (lscgid) ├─6551 openlitespeed (lshttpd - #01) ├─6552 openlitespeed (lshttpd - #02) ├─6553 openlitespeed (lshttpd - #03) └─6554 openlitespeed (lshttpd - #04) 3月 31 02:06:32 Cmon-wsl systemd[1]: Starting OpenLiteSpeed HTTP Server... 3月 31 02:06:33 Cmon-wsl lswsctrl[129]: [OK] litespeed: pid=141. 3月 31 02:06:35 Cmon-wsl systemd[1]: Started OpenLiteSpeed HTTP Server. $ sudo firewall-cmd --set-default-zone=FedoraServer $ sudo firewall-cmd --permanent --add-service=http $ sudo firewall-cmd --permanent --add-service=https $ sudo firewall-cmd --reload
※インストール先は /usr/local/lsws である。
http://localhost:8088 にアクセスする。
Demos の phpinfo が何も表示されない場合
恐らく libnsl がシステムにインストールされていないのでインストールする。
$ sudo dnf install libnsl -y
ソースコードのビルド
※configure でエラーになり上手く行かない。
参考文献: OpenLiteSpeed installation from source code • OpenLiteSpeed
依存パッケージのインストール。
$ sudo dnf install gcc gcc-c++ make autoconf glibc rcs $ sudo dnf install pcre-devel openssl-devel expat-devel geoip-devel zlib-devel udns-devel
ソースコードのダウンロード。
$ git clone https://github.com/litespeedtech/openlitespeed.git
configure & make
$ cd openlitespeed $ ./configure $ make
LiteSpeed WebAdmin Console
https://localhost:7080/ にアクセスする。
LiteSpeed WebAdmin Console で 503 Server Unavailable エラーが発生する場合
恐らく libnsl がシステムにインストールされていないのでインストールする。
$ sudo dnf install libnsl -y
LiteSpeed WebAdmin Console のユーザー/パスワードが分からない
初期設定では admin/123456 である。
/usr/local/lsws/admin/misc/admpass.sh でリセットできる。
$ sudo /usr/local/lsws/admin/misc/admpass.sh Please specify the user name of administrator. This is the user name required to login the administration Web interface. User name [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!
WSGI Web アプリの実行
参考文献: Running Python WSGI Apps with LSAPI • OpenLiteSpeed
Documentation for Python LiteSpeed Server API - LiteSpeed Technologies
Python ライブラリのインストール
$ sudo dnf install python3-devel python3-pip
Python モジュールのインストール
LiteSpeed Server API Downloads - LiteSpeed Technologies より Python Module をダウンロードしてインストールする。
$ curl -O https://www.litespeedtech.com/packages/lsapi/wsgi-lsapi-1.5.tgz $ tar xvzf wsgi-lsapi-1.5.tgz $ cd wsgi-lsapi-1.5 $ python ./configure.py Done. $ make $ sudo mv lswsgi /usr/local/lsws/fcgi-bin/lswsgi-1.5 $ sudo chown root.root /usr/local/lsws/fcgi-bin/lswsgi-1.5 $ sudo ln -s /usr/local/lsws/fcgi-bin/lswsgi-1.5 /usr/local/lsws/fcgi-bin/lswsgi
LSAPI Documentation - LiteSpeed Technologies
Documentation for Python LiteSpeed Server API - LiteSpeed Technologies
Python 仮想環境の作成
$ cd /usr/local/lsws/Example/ $ sudo mkdir py3dj3_venv $ sudo chmod 777 py3dj3_venv $ python3 -m venv py3dj3_venv $ cd py3dj3_venv $ . bin/activate (py3dj3_venv) $
Django のインストールと設定
(py3dj3_venv) $ pip install django (py3dj3_venv) $ django-admin startproject django_project
トラブルシューティング
error while loading shared libraries: libcrypt.so.1: cannot open shared object file: No such file or directory が発生する
依存するライブラリがインストールされていないのでインストールする。
$ sudo dnf install libxcrypt-compat