Cấu hình SSL trên Wamp Server trên localhost

Các trang web trong môi trường phát triển sử dụng máy chủ WAMP đôi khi yêu cầu phải có https để phát triển thêm ứng dụng / trang web.WampServer là một công cụ tuyệt vời để xây dựng trang web trên local của bạn nhưng hiện tại nó không hỗ trợ HTTPS / SSL. Để

Các trang web trong môi trường phát triển sử dụng máy chủ WAMP đôi khi yêu cầu phải có https để phát triển thêm ứng dụng / trang web.WampServer là một công cụ tuyệt vời để xây dựng trang web trên local của bạn nhưng hiện tại nó không hỗ trợ HTTPS / SSL. Để bật https trên máy chủ phát triển, chúng ta cần bật SSL theo cách thủ công

  1. Bước 1: Download and install Opend SSL

Trước tiên cần thêm PATH biến môi trường tới C:wamp64binapacheapache2.4.46bin
(Chú ý phiên bản apache ở đường dẫn)
Tạo thư mục key trong đường dẫn C:wamp64binapacheapache2.4.46confkey

openssl genrsa -aes256 -out private.key 2048
openssl rsa -in private.key -out private.key
openssl req -new -x509 -nodes -sha1 -key private.key -out certificate.crt -days 36500 -config c:wamp64binapacheapache2.4.27confopenssl.cnf

image.png
2. Bước 2:
Bỏ comment 3 dòng sau trong file C:wamp64binapacheapache2.4.46confhttpd.conf

LoadModule ssl_module modules/mod_ssl.so
Include conf/extra/httpd-ssl.conf
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
  1. Bước 3
    Cập nhật confextra]httpd-ssl.conf
DocumentRoot "${INSTALL_DIR}/www"
ServerName localhost:443
SSLCertificateFile "${SRVROOT}/conf/key/certificate.crt"
SSLCertificateKeyFile "${SRVROOT}/conf/key/private.key"
  1. Bước 4
    Cập nhật confextrahttpd-ssl.conf
#
<VirtualHost *:443>
	ServerName epic10.local
	DocumentRoot "d:/microsite/2022_lazada_epic10/public"
	<Directory  "d:/microsite/2022_lazada_epic10/public/">
            Options +Indexes +Includes +FollowSymLinks +MultiViews
            AllowOverride All
            Require local
	</Directory>
    SSLEngine on
    SSLCertificateFile "${SRVROOT}/conf/key/certificate.crt"
    SSLCertificateKeyFile "${SRVROOT}/conf/key/private.key"
</VirtualHost>

Nguồn: viblo.asia

Bài viết liên quan

9 Mẹo lập trình Web “ẩn mình” giúp tiết kiệm hàng giờ đồng hồ

Hầu hết các lập trình viên (kể cả những người giỏi) đều tốn thời gian x

Can GPT-4o Generate Images? All You Need to Know about GPT-4o-image

OpenAI‘s GPT-4o, introduced on March 25, 2025, has revolutionized the way we create visual con

Khi nào nên dùng main, section, article, header, footer, và aside trong HTML5

HTML5 đã giới thiệu các thẻ ngữ nghĩa giúp cấu trúc nội dung web một cách có

So sánh Webhook và API: Khi nào nên sử dụng?

Trong lĩnh vực công nghệ thông tin và phát triển phần mềm, Webhook và API là hai th