일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- wordpress
- Apache
- MariaDB
- Mac
- new user
- Liniux
- LetsEncrypt
- SSL
- home page
- front page
- crontab
- Xdebug
- 구글 클라우드
- child theme
- Google Cloud
- git pull
- CentOS7
- php
- Fail2ban
- Linux
- launch.json
- Certbot
- non-www
- centos
- vscode
- root
- mysql
- html
- https
- DOM Parser
- Today
- Total
목록SSL (5)
between 0 and 1
Step 1. create ssl certificate $ letsencrypt Step 2. create .htaccess file on webroot and save below contents. RewriteEngine On RewriteCond %{HTTPS} off RewriteCond %{ENV:HTTPS} off RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE] RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] RewriteRule ^ https://%1%{REQUEST_URI} [L,R=301,NE] Step 3. set vhost.conf ServerName example.com ServerAlias ww..
To renew ssl automatically, We can use crontab. Step 1. enter crontab edit mode $ sudo crontab -e Step 2. certbot auto-renewal script ## certbot 30 4 * * 0 certbot renew >> /home/log/certbot/cert_$(date +\%Y\%m\%d).log above script will be executed 4:30 AM on every Sunday. and the execution log will be stored in the "/home/log/certbot/" folder.
Prerequisites - CentOS - Apache Web Server on CentOS Step 1 - Installing the Crertbot Let's Encrypt Client $ sudo yum install epel-release $ sudo yum install certbot python2-certbot-apache mod_ssl -y Step 2 - Obtaining a Certificate $ sudo letsencrypt Step 3 - set information and select domain for ssl 1) set email address Saving debug log to /var/log/letsencrypt/letsencrypt.log Plugins selected:..
Local SSL development (for localhost) 1) create Certificate authority (CA) for local machine $> openssl req -x509 -nodes -new -sha256 -days 1024 -newkey rsa:2048 -keyout RootCA.key -out RootCA.pem -subj "/C=US/CN=Example-Root-CA" $> openssl x509 -outform pem -in RootCA.pem -out RootCA.crt 2) create Domain name certificate create a domains.ext file with following contents authorityKeyIdentifier=k..
서버 요청이 HTTP에서 이뤄지는지 HTTPS/SSL에서 이뤄지고 있는지 확인이 필요할 때가 있다.Global Vairable인 $_SERVER를 이용해 간단히 확인할 수 있다. function isHttpsRequest() {if ( (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443) {return true; } return false; } HTTPS/SSL 요청은 아래 2가지 조건 중 하나라도 참인 경우로 판정한다. 1. $_SERVER['HTTPS'] 가 존재하면서, 그 값이 off가 아닌 경우 (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !=..