Marketing, SEO, Web trends, Programming tutorial, Web design, and Life event...
在SSH連線時,會詢問連線密碼
預設等待時間是 2 分鐘,並且可以修改
首先,開啟sshd_config 設定檔案
vim /etc/ssh/sshd_config
將時間設定為 60 秒
LoginGraceTime 30s
接著重新啟動 ssh server
service sshd restart
yum install httpd -y
vim /etc/sysconfig/iptables
在Linux 環境中,常用 grep 來搜尋文本內容,找出匹配的項目
grep 全寫是 (global search regular expression(RE) and print out the line)
底下介紹 grep 參數用法
Continue Reading假設不考慮 CPU 的情況下,由記憶體評估可承載在線人數估算方法為例:
記憶體 3.6 Gb = 3865470566.4 bps
若以 每人佔用 200 Kb 記憶體來說
1.6G (2G) 記憶體可承載約 8.5 K 進程
1.6*1024*1024*1024/200000 = 8589.934592
3.6G (4G) 記憶體可承載約 19.3 K 進程
3.6*1024*1024*1024/200000 = 19327.35283
Continue Reading
查看目前Apache 目前在線人數
可以透過httpd 進程數量來推算
ps -ef|grep httpd|wc -l
43
若要查看每一筆進程則輸入
ps -ef|grep httpd
apache 3817 2860 0 03:41 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 3864 2860 0 03:41 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 3924 2860 0 03:41 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 3944 2860 0 03:41 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 3946 2860 0 03:41 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 3949 2860 0 03:41 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 3950 2860 0 03:41 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 4017 2860 0 03:42 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 4025 2860 0 03:42 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 4038 2860 0 03:42 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 4051 2860 0 03:42 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 4199 2860 0 03:43 ? 00:00:03 /usr/sbin/httpd -DFOREGROUND
apache 4214 2860 0 03:44 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 7368 2860 0 04:10 ? 00:00:02 /usr/sbin/httpd -DFOREGROUND
apache 7406 2860 1 04:10 ? 00:00:02 /usr/sbin/httpd -DFOREGROUND
apache 7493 2860 1 04:11 ? 00:00:02 /usr/sbin/httpd -DFOREGROUND
apache 7591 2860 1 04:12 ? 00:00:01 /usr/sbin/httpd -DFOREGROUND
apache 7618 2860 1 04:12 ? 00:00:02 /usr/sbin/httpd -DFOREGROUND
apache 7702 2860 0 04:12 ? 00:00:01 /usr/sbin/httpd -DFOREGROUND
apache 7714 2860 0 04:12 ? 00:00:01 /usr/sbin/httpd -DFOREGROUND
apache 7717 2860 1 04:12 ? 00:00:01 /usr/sbin/httpd -DFOREGROUND
apache 7860 2860 0 04:13 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 7868 2860 1 04:13 ? 00:00:01 /usr/sbin/httpd -DFOREGROUND
apache 7879 2860 1 04:13 ? 00:00:01 /usr/sbin/httpd -DFOREGROUND
apache 7882 2860 0 04:13 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 7925 2860 1 04:13 ? 00:00:01 /usr/sbin/httpd -DFOREGROUND
apache 7930 2860 0 04:13 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 7931 2860 1 04:13 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 7945 2860 1 04:13 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 7976 2860 1 04:14 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 7992 2860 1 04:14 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 7994 2860 1 04:14 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 7995 2860 1 04:14 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 7996 2860 1 04:14 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 8015 2860 2 04:14 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 8021 2860 0 04:14 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 8062 2860 1 04:14 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 8063 2860 3 04:14 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
root 8093 5429 0 04:14 pts/0 00:00:00 grep --color=auto httpd
Continue Reading
在開始介紹 View composer 之前
首先關於 View 的一些用法為,指定 Template 以及要帶入的參數
Continue Reading這裡記錄一些常見的HTTP Response 回應狀態:
Continue ReadingJson Hijacking 是一項已經存在多年的安全漏洞,目前各大主流瀏覽器都已經修補
這裡進行說明,什麼是 Json Hijacking 以及防範方式:
Continue Reading現有一個專案使用到 FFMPEG 來處理 Media 轉換
這裏紀錄 Mac, Ubuntu, CentOS 安裝 FFMPEG 以及簡介使用方式
Continue ReadingTCP / IP (Transmission Control Protocol over Internet Protocol)使用的是三項交握流程
當你的電腦向某台主機請求資源時,你會發送 SYN 訊息給這台電腦
當這台電腦收到訊息後,會開始將資源 SYN/ACK 傳送給你
Continue Reading紀錄如何查詢 MySQL 資料庫中,所有 database size
語法如下:
SELECT table_schema "DB Name",
ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB"
FROM information_schema.tables
GROUP BY table_schema;