Linux: May 2014 Archives

Apache mod_bw

user-pic
Vote 0 Votes

Apache Bandwidth Mod
wget http://ivn.cl/files/source/mod_bw-0.92.tgz
tar zxf mod_bw-0.92.tgz
apxs -i -a -c mod_bw.c
or
apxs2 -i -a -c mod_bw.c

httpd.conf 加入 config
例: 來自 192.168.0.0/16 不限速, 最大連線數 50, 其他 share 1M Bytes/s (8Mbps), 最大連線數 100,
all 一定要放在最後, 順序有差, 若放在前面, 就會先 match 到而套用設定
mod_bw 的限速都是 by IP group 的, 並非 per IP, 即某 IP group 共用指定頻寬及最大連線數
BandWidthModule On
ForceBandWidthModule On
BandWidth 192.168.0.0/16 0
BandWidth all 1000000
MaxConnection 192.168.0.0/16 50
MaxConnection all 100 # 超過此數目, 會回應 503: Service Temporarily Unavailable
IP 欄位, 可以用 USER AGENT(支援 RE), 例如 "u:^Mozilla/5(.*)" "u:wget"
若再加入以下可以用 http://yourhost/modbw 看簡單的統計
<location /modbw>
SetHandler modbw-handler
</location>

ref. mod_bw v0.92 Readme

OpenMandriva Linux

user-pic
Vote 0 Votes

OpenMandriva 算是 Mandriva Linux 的社群分支, 另一個分支是 Mageia
(更早之前叫 Mandrake Linux)
跟 RedHat/CentOS 相同都是用 RPM 套件管理系統(urpmi,urpme,urpmf,urpmq)

剛裝好預設的 /etc/urpmi/urpmi.cfg 是空的, 需先 add media
urpmi.addmedia --distrib --mirrorlist http://downloads.openmandriva.org/mirrors/openmandriva.2014.0.x86_64.list

systemctl

user-pic
Vote 0 Votes

在比較新的 Linux, Service Manager 已用 systemctl 取代舊的 chkconfig, service

chkconfig --list = systemctl list-units or systemctl list-unit-files
chkconfig sshd on = systemctl enable sshd.service
chkconfig sshd off = systemctl disable sshd.service
service sshd start = systemctl start sshd.service
service sshd stop = systemctl stop sshd.service
service sshd restart = systemctl restart sshd.service
service sshd status = systemctl status sshd.service

SSH VPN

user-pic
Vote 0 Votes

man ssh /VPN 可以找到相關說明
使用前需設定 sshd_config
PermitTunnel yes
PermitRootLogin yes
可以在 local 及 remote 建立 interface tun0, 也可以綁 IP, 跑路由
這個 Script sshtun.sh 可以跟遠端主機建立 SSH VPN tunnel,
default route 走遠端的 IP 出去, 遠端主機需開啟 ip_forward 及 NAT 設定

Old CentOS ISOs

user-pic
Vote 0 Votes

About this Archive

This page is an archive of entries in the Linux category from May 2014.

Linux: April 2014 is the previous archive.

Linux: July 2014 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Linux: Monthly Archives

Monthly Archives