Hướng dẫn cài đặt SSL Let’s Encrypt trên OpenLiteSpeed
Cài đặt SSL Let’s Encrypt trên OpenLiteSpeed. Thực hiện tự đăng ký chứng chỉ SSL Let’s Encrypt cho website theo tên miền bằng cách thực thi lệnh dưới đây:
Bước 1: Trỏ tên miền về Server / VPS
Bước 2: Truy cập SSH Server/VPS thực hiện cài đặt SSL Let’s Encrypt
- thực hiện lệnh
| certbot certonly -w <document-root> -d <domain.tld>Ví dụ: certbot certonly -w /usr/local/lsws/wordpress -d jaeger-incossd.xyz | 
Trong đó:
- 
- <document-root>: là thư mục gốc chứa source code của website
- <domain.tld>: là tên miền website bạn cần đăng ký
 
Certbot cung cấp 2 hình thức xác thực quyền sở hữu với ACME CA. Trong hướng dẫn này, mình sẽ nhấn “2” để chọn cách xác thực bằng đường dẫn chứa mã nguồn website.
Nếu quá trình xác thực thành công sẽ xuất hiện thông báo “Congratulations” kèm đường dẫn các file chứng chỉ và file private key tương tự như bên dưới:
| [root@thangnv-tailieu wordpress]# certbot certonly -w /usr/local/lsws/wordpress -d jaeger-incossd.xyzSaving debug log to /var/log/letsencrypt/letsencrypt.logHow would you like to authenticate with the ACME CA?- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -1: Spin up a temporary webserver (standalone)2: Place files in webroot directory (webroot)- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Select the appropriate number [1-2] then [enter] (press 'c'to cancel): 2Plugins selected: Authenticator webroot, Installer NoneEnter email address (used forurgent renewal and security notices) (Enter 'c'to cancel): thangnv@nhanhoa.com.vnStarting newHTTPS connection (1): acme-v02.api.letsencrypt.org- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Please read the Terms of Service athttps://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You mustagree in order to register with the ACME server. Do you agree?- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -(Y)es/(N)o: Y- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Would you be willing, once your first certificate is successfully issued, toshare your email address with the Electronic Frontier Foundation, a foundingpartner of the Let's Encrypt project and the non-profit organization thatdevelops Certbot? We'd like to send you email about our work encrypting the web,EFF news, campaigns, and ways to support digital freedom.- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -(Y)es/(N)o: YAccount registered.Requesting a certificate forjaeger-incossd.xyzPerforming the following challenges:http-01challenge forjaeger-incossd.xyzUsing the webroot path /usr/local/lsws/wordpress forall unmatched domains.Waiting forverification...Cleaning up challengesSubscribe to the EFF mailing list (email: thangnv@nhanhoa.com.vn).Starting newHTTPS connection (1): supporters.eff.orgIMPORTANT NOTES: - Congratulations! Your certificate and chain have been saved at:   /etc/letsencrypt/live/jaeger-incossd.xyz/fullchain.pem   Your key file has been saved at:   /etc/letsencrypt/live/jaeger-incossd.xyz/privkey.pem   Your certificate will expire on 2022-01-03. To obtain a newor   tweaked version of thiscertificate in the future, simply run   certbot again. To non-interactively renew *all* of your   certificates, run "certbot renew" - 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 | 
Bước 3: Cấu hình SSL cho website trên webAdmin
Sau khi đã đăng ký thành công chứng chỉ SSL từ Let’s Encrypt ở bước trước, ở bước này bạn phải cấu hình SSL cho website (virtual host) từ trang admin của OLS.
Từ giao diện chính, bạn truy cập Virtual Hosts > [virtual host name] >SSL
Nhấn chọn biểu tượng Edit như hình, điền đường dẫn của các file private key và file chứng chỉ Let’s Encrypt vào các ô Private Key File, Certificate File
- Private Key File: /etc/letsencrypt/live/YOUR_DOMAIN/privkey.pem
- Certificate File: /etc/letsencrypt/live/YOUR_DOMAIN/fullchain.pem
Nhấn SAVE để lưu cấu hình.
Bước 3: Mapping website (virtual host) vào Listener
Tới đây, để website có thể hoạt động với giao thức SSL hợp lệ (khóa xanh trên trình duyệt), bạn cần mapping virtual host vào listener HTTPS.
Bạn có thể tạo mới một listener với port 443 hoặc đơn giản là sử dụng listener mặc định (Defaulssl) của OLS bằng thao tác như sau:
Truy cập: Listeners > Defaultssl > General > nhấn vào biểu tượng dấu “+” trong mục Virtual Host Mappings
Bước 4: Kiểm tra chứng chỉ
Cài đặt SSL Let’s Encrypt trên OpenLiteSpeed. Chúc các bạn thành công!!!





 
															
