日本免费全黄少妇一区二区三区-高清无码一区二区三区四区-欧美中文字幕日韩在线观看-国产福利诱惑在线网站-国产中文字幕一区在线-亚洲欧美精品日韩一区-久久国产精品国产精品国产-国产精久久久久久一区二区三区-欧美亚洲国产精品久久久久

建立一個帶寬、線程可控的下載型WEB網(wǎng)站( 二 )


MaxConnPerIP 2 限制每個IP的最大線程數(shù)



完成mod_bandwidth模塊的安裝

創(chuàng)建 mod_bandwidth 運(yùn)行需要的目錄

mkdir /var/apachebw
mkdir /var/apachebw/link
mkdir /var/apachebw/master
chmod -R 777 /var/apachebw

修改httpd.conf增加下列內(nèi)容


BandWidthDataDir "/var/apachebw/"
BandWidthModule on


BandWidth 192.168.0 0 200000 制局域網(wǎng)內(nèi)用戶的下載速度為200k
BandWidth all 51200 限制其他用戶的下載速度為每秒 51200 字節(jié)




修改/etc/init.d/httpd

# vi /etc/init.d/httpd

在三行之后添加如下內(nèi)容:
#!/bin/sh
#
# Startup script for the Apache Web Server
# chkconfig: - 85 15
# description: Apache is a World Wide Web server. It is used to serve
# HTML files and CGI.
# processname: httpd
# pidfile: /usr/local/apache/log/httpd.pid
# config: /usr/local/apache/conf/httpd.conf

把a(bǔ)pache服務(wù)設(shè)置為開機(jī)啟動:

# chkconfig –-add httpd
# chmod 755 /etc/init.d/httpd
# chkconfig httpd on

六、安裝porftpd-1.2.9

# tar –zxvf proftpd-1.2.9.tar.gz
# cd proftpd-1.2.9
# ./configure --prefix=/usr/local/proftpd
# make
# make install

建立啟動文件、把proftpd設(shè)置為開機(jī)啟動

# cp ./contrib/dist/rpm/proftpd.init.d /etc/rc.d/init.d/proftpd


# chkconfig --add proftpd
# chmod 755 /etc/rc.d/init.d/proftpd

# vi /etc/rc.d/init.d/functions
export PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/proftpd/
sbin"

# vi /etc/rc.d/init.d/proftpd
config: /usr/local/proftpd/etc/proftpd.conf
PATH="$PATH:/usr/local/proftpd/sbin"

# chkconfig proftpd on

建立帳號和目錄:

# mkdir /home/test
# chmod 755 /home/test
# adduser -d /home/test -g ftp -s /sbin/nologin test
# passwd test

# adduser -d /home/upload -g ftp -s /sbin/nologin upload
# passwd upload

配置/usr/local/proftpd/etc/proftpd.conf , 禁用匿名登陸

ServerName "llzqq"s ftp service"
ServerType standalone
DefaultServer on

# Port 21 is the standard FTP port.
Port 21

# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask 022

MaxInstances 10

# Set the user and group under which the server will run.
User nobody
Group ftp

# To cause every FTP user to be "jailed" (chrooted) into their home
# directory, uncomment this line.
DefaultRoot ~

# Normally, we want files to be overwriteable.

AllowOverwrite on


# We want "welcome.msg" displayed at login, and ".message" displayed
# in each newly chdired directory.
DisplayLogin welcome.msg
DisplayFirstChdir .message
RequireValidShell no

#Limit User of being enbled login ftp server

AllowGroup ftp
DenyAll

#


DenyGroup ftp

TransferRate RETR 51200 group ftp



DenyGroup ftp

TransferRate STOR 256000 group ftp


ServerIdent off
MaxClientsPerHost 2
TimeoutIdle 600
TimeoutLogin 300
TimeoutNoTransfer 300
TimeoutStalled 300


七、reboot計(jì)算機(jī)

# shutdown –r now

打開瀏覽器輸入:http://loaclhost/test.php

如果你看到了關(guān)于:mysql;apache;php的一大堆信息 , 恭喜 , 你的安裝基本上成功了 , 下一步可以測試一下proftp和帶寬的設(shè)置了 。


八、建立一個簡單有效的防火墻

export PATH=/sbin:/usr/sbin:/bin:/usr/bin

modprobe iptable_nat
modprobe ip_nat_ftp
modprobe ip_nat_irc
modprobe ip_conntrack

推薦閱讀