發表文章

目前顯示的是 9月, 2017的文章

和人月神話一樣, 經過 10 年後來看還是一樣的貼切

和人月神話一樣, 經過 10 年後來看還是一樣的貼切。 「你進入狀況後, 要繼續維持並不算太難. 我的一天通常都是這樣子的: (1) 上班 (2) 看信看網頁等等 (3) 決定應該吃過午飯後再做事 (4) 吃完午飯回來 (5) 看信看網頁... 由 巴克里 貼上了  2017年9月14日

使用AWS EC2當OpenVPN Server

圖片
使用AWS EC2當OpenVPN Server * 透過 AWS 設定 OpenVPN server * 先看一下 EC2 價格 https://aws.amazon.com/tw/ec2/pricing/ * 首先去申請一台乾淨的 AWS EC2 server , 新使用者可以免費使用 750HR . * 可以參考網路上的教學文章,把 OpenVPN 安裝設定好。 * How to Setup and Configure an OpenVPN Server on CentOS 6 https://www.digitalocean.com/community/tutorials/how-to-setup-and-configure-an-openvpn-server-on-centos-6 * 在 CentOS 6 架設 OpenVPN Server http://jamyy.us.to/blog/2013/09/5220.html * How To Set Up an OpenVPN Server on Ubuntu 16.04 https://www.digitalocean.com/community/tutorials/how-to-set-up-an-openvpn-server-on-ubuntu-16-04 * 本人推薦官方的說明, 比較準確 https://help.ubuntu.com/lts/serverguide/openvpn.html * 將設定檔及憑證全部設定在設定檔內 , 因為手機 IPHONE 才可安裝 https://community.openvpn.net/openvpn/wiki/IOSinline * 設定主機的 NAT 轉換 IP , 讓 IP 有可以出去。 root@ip-172-31-10-225:~# cat fire.sh # -------------------------------------------------------------- #!/bin/bash # linux firewall rule sample EXTIF="eth0"               # ...

NGINX的status狀態

圖片
NGINX的status狀態 # 在 nginx config server 段加入 location /nginx_status { # Turn on stats stub_status on; # only allow access from 192.168.1.5 # allow 192.168.211.112; deny all; } * Active connections 1: 目前連線數,包含 Waiting 量 * server accepts handled requests 20 20 12 第1個值是伺服器接受的連線數 第2個值是伺服器已經處理的連線數 第3個值則是伺服器已經處理的請求數 若將第3個數值除以第2個數值,就會得到平均每個連線的請求數 * Reading  正在讀取的請求數 * Writing  正在讀取主體、處理與回應的請求數 * Waiting  keep-alive 的連線數這個值跟 keepalive_timeout 有關 REF: https://www.cyberciti.biz/faq/nginx-see-active-connections-connections-per-seconds/ https://blog.gtwang.org/linux/nginx-enable-stub_status-module-to-collect-metrics/

CENTOS7 安裝 NGINX 並請申請 Letsencrypt SSL憑證使用

圖片
CENTOS7 安裝 NGINX 並請申請 Letsencrypt SSL憑證使用 # 首先先看看網路上的教學安裝文章, 照著作把 nginx 安裝起來 https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-centos-7 # 然後安裝憑證, 這個 Letsencrypt 目前用程式安裝憑證 https://letsencrypt.org/ # 請依據制這裡的說明, 安裝程式及工具 https://certbot.eff.org/#centosrhel7-nginx # 先把 domain FQDN 對應 IP 設定好 # 執行憑證申請及安裝, 因為 Letsencrypt 有縣市 IP 及 Domain 所以申請盡可能一次就成功。 # 依據說明執行 [root@dev letsencrypt]# certbot --nginx Saving debug log to /var/log/letsencrypt/letsencrypt.log Starting new HTTPS connection (1): acme-v01.api.letsencrypt.org Which names would you like to activate HTTPS for? ------------------------------------------------------------------------------- 1: api.jangmt.com 2: dev.jangmt.com ------------------------------------------------------------------------------- Select the appropriate numbers separated by commas and/or spaces, or leave input blank to select all options shown (Enter 'c' to cancel): 2 Obtaining a new certificate Perfor...