우분투에 OpenLiteSpeed + 워드프레스 원클릭 설치

OpenLiteSpeed 는 Apache Nginx 와 비슷한 웹 서버역할을 한다. LiteSpeed 웹서버 의 무료 버전이지만 주요 기능들은 모두 제공하고 있는 것 같다. OpenLiteSpeed 와 LiteSpeed Enterprise 비교 Apache, Nginx와 비교한 글을 찾아 아래에 남겨둔다.

Nginx보다 빠른지는 의견이 분분하지만 현재 http/3 , .htaccess 를 지원한다는 것 때문에 현재 사용중.

ols1clk.sh 원클릭 설치

우분투 22.04 OpenLiteSpeed 웹서버와 워드프레스를 한꺼번에 설치해주는 스크립트를 이용한다. LiteSpeedTech에서 Github에 공개된 스크립트다.

1-Click Install OLS, PHP, MySQL, WP and LSCache – OpenLiteSpeed

wget --no-check-certificate https://raw.githubusercontent.com/litespeedtech/ols1clk/master/ols1clk.sh

ols1clk.sh 스크립트를 다운로드 받고 실행

bash ./ols1clk.sh --wordpress

root 계정 또는 sudo 로 실행해야 한다.

포트포워딩

  • http/https TCP 80 port, 443 port
  • http3 UDP 443 port
  • webAdmin TCP 7080 port

설치 옵션

  • –wordpress : 워드프레스 설치
  • –wordpressplus : 워드프레스 설치 사용자 생성, LiteSpeed Cache 플러그인 설치
  • –wordpresspath : 워드프레스 경로 지정

추가 옵션 보기

**********************************************************************************************
*                    Open LiteSpeed One click installation, Version 3.1                      *
*                    Copyright (C) 2016 - 2023 LiteSpeed Technologies, Inc.                  *
**********************************************************************************************
Current platform is UBUNTU22 ubuntu jammy.

Starting to install OpenLiteSpeed to /usr/local/lsws/ with the parameters below,
WebAdmin Console URL:     https://xxx.xxx.xxx.xxx:7080
WebAdmin username:        admin
WebAdmin password:        h0m2AQzYAOVxhPk7
WebAdmin email:           root@localhost
LSPHP version:            81
MariaDB version:          10.11
Install WordPress:        Yes
WordPress HTTP port:      80
WordPress HTTPS port:     443
WordPress language:       en_US
Web site domain:          *
MySQL root Password:      I35fVPxtbPxZpsfKEGC8F7O4+YsvL6mAez6vZPHf5mU=
Database name:            olsdbname
Database username:        olsdbuser
Database password:        6ezbyn0YwdK43yII8wR8sTTjfXKm//rHxy4Uypm0S/E=
WordPress plus:           No
WordPress location:       /usr/local/lsws/wordpress (New install)
Your password will be written to file:  /usr/local/lsws/password

Are these settings correct? Type n to quit, otherwise will continue. [Y/n]  y

비밀번호는 랜덤으로 생성해준다. sudo cat /usr/local/lsws/password 로 나중에 다시 확인할 수 있다.

Start OpenLiteSpeed one click installation >> >> >> >> >> >> >>
System update
Start setup OpenLiteSpeed
     - add litespeedtech repo
     - update list
     - Install OpenLiteSpeed
     - Install lsphp81
     - Setup lsphp symlink
End setup OpenLiteSpeed
Set OpenLiteSpeed Web Admin access.
Install wp_cli
/usr/bin/php symlink exist, skip symlink.
Start setup virtual host config
     - Check existing port
     - Create wordpress listener
     - Insert wordpress virtual host
     - Create wordpress virtual host conf
End setup virtual host config
Avoid port 80/443 conflict.
Start Install MariaDB
     - Install software properties
     - Add MariaDB repo
     - Update packages
     - Install MariaDB
     - Start MariaDB
     - Set MariaDB root
End Install MariaDB
Start setup MariaDB
Finished MySQL setup without error.
End setup mysql
Start Download WordPress file
End Download WordPress file
Start Create WordPress config
Done Create WordPress config
Install Postfix
     - Config OpenLiteSpeed
     - Config php.ini
Congratulations! Installation finished.
Please access http://server_IP:80/ to finish setting up your WordPress site.
Also, you may want to activate the LiteSpeed Cache plugin to get better performance.
End OpenLiteSpeed one click installation << << << << << << <<

Start auto testing >> >> >> >>
OK: test webAdmin page passed.
OK: test Example vhost page passed.
OK: test wordpress HTTP first page passed.
OK: test wordpress HTTPS first page passed.
End auto testing << << << <<
Thanks for using OpenLiteSpeed One click installation!

webAdmin Example wordpress HTTP HTTPS 테스트 완료.

SSL 적용하기

apt-get -y install certbot

certbot certonly --webroot -w /usr/local/lsws/wordpress/ -d example.com -d www.example.com

이메일을 입력하고 동의 완료하면

Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/example.com/fullchain.pem
Key is saved at:         /etc/letsencrypt/live/example.com/privkey.pem
This certificate expires on 2023-10-04.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.
We were unable to subscribe you the EFF mailing list because your e-mail address appears to be invalid. You ca
n try again later by visiting https://act.eff.org.

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

fullchain.pem privkey.pem 을 생성하고 경로를 보여준다.

OpenLiteSpeed 웹어드민에 접속해서 Listeners 탭 wordpressssl > SSL 을 선택하고 Private Key File 에는 privkey.pem 경로를 , Certificate File 에는 fullchain.pem 경로로 바꿔주고 Chained Certificate Yes 로 변경한다. LSWS PID 초록색 다시시작 버튼으로 웹서버 재시작.

http https로 리다이렉트 설정

Virtual Hosts 탭 wordpress > Rewrite > Rewrite Rules 에 아래 내용 추가

RewriteCond %{SERVER_PORT} ^80$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]

LSWS PID 초록색 다시시작 버튼으로 웹서버 재시작.

SSL Setup – OpenLiteSpeed

댓글 0개