Thứ Hai, 19 tháng 3, 2012

Enable https in apache (server linux)

File cấu hình của apache  trong linux thường ở: /etc/httpd/conf
1. Copy các file *.crt; *.key, ca-bundle.crt vào các thư mục trong ssl.crt và ssl.key tương ứng

2. Chỉnh file cấu hình httpd-ssl.conf trong thư mục /etc/httpd/conf/extra/
Chú ý các mục:
- ServerName: tên server của bạn (ví dụ: localhost)
- SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt : trỏ đến file public key crt tương ứng
- SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key: trỏ đến file private key tương ứng
- SSLCACertificateFile /etc/httpd/conf/ssl.crt/ca-bundle.crt: trỏ đến file CA tương ứng

3. Chỉnh file php.ini; xem phpinfo() để biết chính xác file php.ini cần sửa (thường sẽ ở: usr/local/lib)
bỏ dấu ; hoặc thêm dòng: extension=php-openssl.dll



4. Alias một tên đến thư mục chứa web nếu cần
(ví dụ: Alias gxd /home/gxd)


5. Restart apacher service:
sudo /etc/init.d/httpd restart

Không có nhận xét nào:

Đăng nhận xét