浏览模式: 标准 | 列表 | 无广告Tag:linux
Post by tywtyw2002 on 2010, March 8, 6:33 AM
发现好久没有写blog,那么闲着没事写一篇吧。
最近的确很忙,研究学校的topology 架构很强大 内接pix 学生网关居然是环路。。。。
目前找到了老师及服务器的出口 学生网络的出口没找到 核心交换机连接到一个hydro 然后就找不到任何ip了。。。。
闲着没事去学校的服务器溜达了一圈,一色linux 系统 debain的 硬盘很大。。。每台大概都是1t左右 一共20多台服务器。
网络设备都是cisco的 3层交换机。
很气人的是 居然用3550 12口交换机做学生的路由 fuk 。。妈的
教师网关是2800.
这几天研究cisco中 ,ccna快看完了 有时间去考个证的了。
昨天又下了1.8g的电子书+2g的视频资料。唉 学习呀。。。。。
还有一点气人的是 tudou的 电子科技大学 ccna 课程视频居然吓编号。。。 气死我了。
下周好像天天test。。。 然后就放假了 爽
Tags: linux, cisco
网络·技术 | 评论:0
| 阅读:359
Post by tywtyw2002 on 2010, February 18, 10:39 AM
闲着无聊给900上安了一vsftpd
上图






gcc编译后的vsftpd包发上来vsftpd-2.2.2.zip
用zip压缩的包。。
#apt-get install make
#make install
即可使用vsftp 别忘了配置一下vsftp~
我没做开机自启动。要用了就用命令启动一下。没用了就kill掉。
我觉得速度比sftp快。资源占用的也少。不过占了1m左右的roofs。
Tags: vsftp, linux, n900
网络·技术 | 评论:0
| 阅读:389
Post by tywtyw2002 on 2010, January 24, 4:32 PM
我都想骂街了,本来10分钟能搞定的问题现在拖了100分钟还没搞定
wp的速度是不敢恭维呀
我的vps跑起来很吃力。。。。。。
载入主页要3s 后台基本10s以上吧 插件都关了。 内存居然能耗到300+我就日了
看看这个数据

我就操了 这还是前台 有文章的标签要4s的处理时间。。。。
我vps跑discuz都没怎么费劲呢。
难道是我的代码有问题?不知道呀 睡觉明天在研究吧
wp还把我的php搞死了n次。。。。
Tags: wp, linux
网络·技术 | 评论:0
| 阅读:486
Post by tywtyw2002 on 2009, November 1, 9:26 AM
前几天显得无聊弄个个asus的wl520gu 回来 52刀 价格还是不错的 主要是可以刷tomato 这样正好可以练习下linux的网关技术 ^_^
下面简单说下吧。
wl520gu 用的是博通的芯片4mflash 16m ddr 带个几台下bt的机器足够用了。我刷的是dualwan 改版的tomato。
好了下面说下实验的环境。学校的网关是172.17.1.1 采用dhcp,我利用自己的权限偷偷给了自己n个静态ip(静态dhcp列表)172.17.167.17/18/19
路由器绑定是172.17.167.19
打算把172.17.167.18绑到laptop上,172.17.167.17绑到bt server上面方便从学校内网的其他机器访问。
拓扑图

因为不论tomato、dd-wrt还是dualwan的web设置都是很简单的 所以直接ssh到 路由
telnet 192.168.1.1
用户名为root 不要输成admin。
进入后就是busybox busybox是个linux的命令行 他简化了linux 可以自己添加命令 主要用于工程机。 具体信心google吧。
先用ifconfig 查看下网卡状态
# ifconfig
br0 Link encap:Ethernet HWaddr 00:26:18:13:54:65
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4738408 errors:0 dropped:0 overruns:0 frame:0
TX packets:4377015 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:796135268 (759.2 MiB) TX bytes:4205217353 (3.9 GiB)
eth0 Link encap:Ethernet HWaddr 00:26:18:13:54:65
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:40477302 errors:12636 dropped:0 overruns:3651 frame:3651
TX packets:3943571 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:3945465567 (3.6 GiB) TX bytes:692054944 (659.9 MiB)
Interrupt:4 Base address:0x1000
eth1 Link encap:Ethernet HWaddr 00:26:18:13:54:67
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4741308 errors:0 dropped:0 overruns:0 frame:57195958
TX packets:4633764 errors:2023 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:862835253 (822.8 MiB) TX bytes:4266446464 (3.9 GiB)
Interrupt:13 Base address:0x5000
imq0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00
0-00
UP RUNNING NOARP MTU:1500 Metric:1
RX packets:4181208 errors:0 dropped:0 overruns:0 frame:0
TX packets:4181001 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:30
RX bytes:4083558188 (3.8 GiB) TX bytes:4083286490 (3.8 GiB)
imq1 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00
0-00
UP RUNNING NOARP MTU:1500 Metric:1
RX packets:3052447 errors:0 dropped:0 overruns:0 frame:0
TX packets:3052447 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:30
RX bytes:476100316 (454.0 MiB) TX bytes:476100316 (454.0 MiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MULTICAST MTU:16436 Metric:1
RX packets:467 errors:0 dropped:0 overruns:0 frame:0
TX packets:467 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:36671 (35.8 KiB) TX bytes:36671 (35.8 KiB)
vlan0 Link encap:Ethernet HWaddr 00:26:18:13:54:65
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:368198 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:67479636 (64.3 MiB)
vlan1 Link encap:Ethernet HWaddr 00:26:18:13:54:68
inet addr:172.17.167.19 Bcast:172.17.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:40477302 errors:0 dropped:0 overruns:0 frame:0
TX packets:3575373 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3216874131 (2.9 GiB) TX bytes:624575308 (595.6 MiB)
vlan1就是wan1口
vlan0是wan2口 我把它禁用了
然后给vlan1增加ip
ifconfig vlan1:1 172.17.167.18 broadcast 172.17.255.255 netmask 255.255.0.0
ifconfig vlan1:2 172.17.167.17 broadcast 172.17.255.255 netmask 255.255.0.0
再用ifconfig查看
vlan1:1 Link encap:Ethernet HWaddr 00:26:18:13:54:68
inet addr:172.17.167.18 Bcast:172.17.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
vlan1:2 Link encap:Ethernet HWaddr 00:26:18:13:54:68
inet addr:172.17.167.17 Bcast:172.17.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
多出2个vlan1 这样ip就绑定对了 你再试试用几个ip能访问到80端口不。
为了安全在iptables先做下安全
iptables -A INPUT -i vlan1 -p tcp --dport 23 -s ! 192.168.1.1/255.255.255.0 -j REJECT --reject-with tcp-reset
iptables -A INPUT -i vlan1 -p tcp --dport 80 -s ! 192.168.1.1/255.255.255.0 -j REJECT --reject-with tcp-reset
幽默点对于非192.168.1.1/24这段ip 访问路由器 全部返回 tcp-reset 就是连接重置。
开始进行nat
先把192.168.1.254 nat 到172.17.167.17上
iptables -t nat -I POSTROUTING -s 192.168.1.1/255.255.255.0 -d 192.168.1.254 -j SNAT --to-source 172.17.167.17
iptables -t nat -I PREROUTING -d 172.17.167.17 -j DNAT --to-destination 192.168.1.254
iptables -t nat -I POSTROUTING -o vlan1 -s 192.168.1.254 -j SNAT --to 172.17.167.17
iptables -I FORWARD -i vlan1 -d 192.168.1.254 -j ACCEPT
在吧192.168.1.118 nat 到172.17.167.18上
iptables -t nat -I POSTROUTING -s 192.168.1.1/255.255.255.0 -d 192.168.1.118 -j SNAT --to-source 172.17.167.18
iptables -t nat -I PREROUTING -d 172.17.167.18 -j DNAT --to-destination 192.168.1.118
iptables -t nat -I POSTROUTING -o vlan1 -s 192.168.1.118 -j SNAT --to 172.17.167.18
iptables -I FORWARD -i vlan1 -d 192.168.1.118 -j ACCEPT
ok 这样nat 就ok了
为了开机自动执行脚本
把
ifconfig vlan1:1 172.17.167.18 broadcast 172.17.255.255 netmask 255.255.0.0
ifconfig vlan1:2 172.17.167.17 broadcast 172.17.255.255 netmask 255.255.0.0
加到wan联网时
把
iptables -t nat -I POSTROUTING -s 192.168.1.1/255.255.255.0 -d 192.168.1.254 -j SNAT --to-source 172.17.167.17
iptables -t nat -I PREROUTING -d 172.17.167.17 -j DNAT --to-destination 192.168.1.254
iptables -t nat -I POSTROUTING -o vlan1 -s 192.168.1.254 -j SNAT --to 172.17.167.17
iptables -I FORWARD -i vlan1 -d 192.168.1.254 -j ACCEPT
iptables -t nat -I POSTROUTING -s 192.168.1.1/255.255.255.0 -d 192.168.1.118 -j SNAT --to-source 172.17.167.18
iptables -t nat -I PREROUTING -d 172.17.167.18 -j DNAT --to-destination 192.168.1.118
iptables -t nat -I POSTROUTING -o vlan1 -s 192.168.1.118 -j SNAT --to 172.17.167.18
iptables -I FORWARD -i vlan1 -d 192.168.1.118 -j ACCEPTiptables -A INPUT -i vlan1 -p tcp --dport 23 -s ! 192.168.1.1/255.255.255.0 -j REJECT --reject-with tcp-reset
iptables -A INPUT -i vlan1 -p tcp --dport 80 -s ! 192.168.1.1/255.255.255.0 -j REJECT --reject-with tcp-reset
加入到防火墙中
结束
目前严重策略路由中 过几天写一下
Tags: linux, iptables, tomato
网络·技术 | 评论:0
| 阅读:892
Post by tywtyw2002 on 2009, October 21, 2:29 AM
最近宿舍网很烂 所以就在vps 上按了个mldonkey下东西看
下面介绍一下 mldonkey是一个 服务器式的 p2p下载工具 支持bt emule ftp http
他本身没有界面 是通过3种方式进行管理的
http tentel 还有gui插件
号称mldonkey是下载最快 最节省内存的下载利器
我一般都是同时连接5个服务器 开始下emule。。。。速度基本是300kb左右 (限速了)
===========================================
mldonkey的官方主页
http://mldonkey.berlios.de/ 是一个wiki样式的
download http://sourceforge.net/projects/mldonkey/files/
下面开始介绍安装
我建议大家 下载编译好的文件
因为方便快捷 但是有个中文名bug 不过可以解决。
#wget http://sourceforge.net/projects/mldonkey/files/mldonkey/3.0.0/mldonkey-3.0.0.static.i386-Linux_glibc-2.7.tar.bz2/download
#tar jxvf mldonkey-3.0.0.static.i386-Linux_glibc-2.7.tar.bz2
#mv mldonkey-3.0.0 mldonkey
#cd mldonkey
#./mlnet &
好了mldonkey就开始后台运行了
然后会出现一堆字符。。 直接crtl +c跳过
下面开始连接 mldonkey
默认的mldonkey是只允许127.0.0.1 访问的
因为我的服务器只有内核 没法用http加auth ip 所以只能通过 telnet
#yum -y install nc
安装完nc后
#nc 127.0.0.1 4000
>set allowed_ips "127.0.0.1 你服务器的ip 你自己的ip“
最好给服务开个s5代理 这样走到哪里都可以登录了
>useradd admin 你的密码
改下密码
>save
保存下设置
>kill
关闭核心 因为一会要调设置 还有解决中文名bug问题
因为用root用户开启的 mldonkey 所以配置在root目录下
#cd
#cd /.mldonkey
# vi downloads.ini
MLdonkey默认目录分别为 ~/.mldonkey/incoming/files (BT则为~/.mldonkey/incoming/directories) 和 ~/.mldonkey/temp
可以通过修改~/.mldonkey/download.ini来变更。
在download.ini里找到"temp_directory =",然后修改temp目录路径
incoming则要找到:
{ dirname = "incoming/files"
strategy = incoming_files
priority = 0
};
{ dirname = "incoming/directories"
strategy = incoming_directories
priority = 0
};]
由于我服务器是e文的中文名会乱码
所以开启mldonkey的时候要先执行
然后开启mldonkey服务器
#./mlnet &
好了
mldonkey服务器端就配置好了
然后X掉你的ssh 注意是X 不退出root 退如果出root了mldonkey就关了
下面下载mldonkey的gui界面 调emule的配置
http://sancho-gui.sourceforge.net/
安装完了填好参数 链接服务器
调参数了
1.加大缓存大小,以保护硬盘:
浏览器的查找功能找到下列选项并设置(->左边为选项名称,右边为值):
buffer_writes->true 打开缓存写入模式
buffer_writes_delay->30.或者更高,它表示写缓存的延时单位秒
buffer_writes_threshold 4000或更高,它表示缓存,到了XXXX KB后强制写入
client_buffer_size 50 000 000或者更高,它表示缓存的总大小,单位字节
2.设置一个客户端昵称(据说是登录VeryCD的服务器需要校验,实际上没有多大效果。)
找到client_name,改为[CHN][VeryCD]xxxx的形式。
3.打开想要的协议:
ED2K <==> enable_donkey->true
BT <==> enable_bittorrent->true
DIRECTCONNECT <==> enable_directconnect -> true(不常用可关闭)
FASTTRACK <==> enable_fasttrack -> true (貌似已经停用了)
FTP/HTTP <==> enable_fileTP -> true
KAD <==> enable_kademlia -> true
OVERNET <==> enable_overnet -> true
SOULSEEK <==> enable_soulseek -> true (不常用可关闭)
4.带宽设置
max_concurrent_downloads -> 50或者更高 它表示同时下载文件数目
max_hard_download_rate -> 0 它表示下载速度限制,0表示不限制
max_hard_upload_rate -> 30或者更高, 它表示上传限制, 0表示不限制
max_indirect_connections -> 50或者70,它表示客户端允许的外来连接数为最大打开连接的百分比
max_opened_connections -> 924,它表示客户端最大打开连接,924为最大值
5.ED2K微调
ED2K-dynamic_upload_lifetime -> true
ED2K-force_client_high_id -> true 它表示强制客户端为高ID
ED2K-force_high_id -> true 它表示强制自己为高ID(当高ID可用的时候)
ED2K-good_client_rank -> 800 (数值自便),它表示需要维持连接的队列长度,这里表示的是队列800以内的连接会维持,大于800将断开,等待下一次访问
ED2K-max_connected_servers -> 40 它表示最大服务器的数目。
差不多主要的就这些 输入几个ed2k 链接让他下吧
文件下载到本地问题
由于linux是utf8编码的而win是gbk所以必然会乱码
用winscp的话请选择强制utf8编码 下载到本地就正常了
用vsftp的也一样 最好用filezilla 他支持强制utf8 编码
我基本下完文件就del 防止麻烦 本人的统计
| eDonkey |
Session Uptime: 11h 31m 18s |
41478 seconds |
|
| Brand |
: |
Seen |
% |
| |
Reqs |
% |
| |
B |
% |
| |
UL |
% |
KB/s |
| |
DL |
% |
KB/s |
| |
U:DL |
| unknown |
: |
13 |
(1%) |
| |
0 |
(0%) |
| |
0 |
(0%) |
| |
0 |
(0%) |
0.0 |
| |
396.4k |
(0%) |
0.0 |
| |
1:0.00 |
| eMule |
: |
1247 |
(98%) |
| |
62 |
(100%) |
| |
1 |
(100%) |
| |
67.8M |
(100%) |
1.7 |
| |
198.7M |
(98%) |
4.9 |
| |
1:2.93 |
| trusted mld |
: |
15 |
(1%) |
| |
0 |
(0%) |
| |
0 |
(0%) |
| |
0 |
(0%) |
0.0 |
| |
3.6M |
(2%) |
0.1 |
| |
1:0.00 |
| Total |
: |
1275 |
(100%) |
| |
62 |
(100%) |
| |
1 |
(100%) |
| |
67.8M |
(100%) |
1.7 |
| |
202.7M |
(100%) |
5.0 |
| |
1:2.99 |
|
| |
eDonkey |
Total Uptime: 23d 13h 3m 45s |
2034225 seconds |
|
| Brand |
: |
Seen |
% |
| |
Reqs |
% |
| |
B |
% |
| |
UL |
% |
KB/s |
| |
DL |
% |
KB/s |
| |
U:DL |
| unknown |
: |
8074 |
(1%) |
| |
6868 |
(1%) |
| |
65 |
(1%) |
| |
334.8M |
(1%) |
0.2 |
| |
81.8M |
(1%) |
0.0 |
| |
1:0.24 |
| eDonkey |
: |
474 |
(0%) |
| |
35 |
(0%) |
| |
0 |
(0%) |
| |
9.4M |
(0%) |
0.0 |
| |
6.8M |
(0%) |
0.0 |
| |
1:0.73 |
| eMule |
: |
750142 |
(96%) |
| |
630120 |
(96%) |
| |
7874 |
(99%) |
| |
34.71G |
(93%) |
17.9 |
| |
8.81G |
(93%) |
4.5 |
| |
1:0.25 |
| trusted mld |
: |
11262 |
(1%) |
| |
11392 |
(2%) |
| |
0 |
(0%) |
| |
1001.2M |
(3%) |
0.5 |
| |
251.5M |
(3%) |
0.1 |
| |
1:0.25 |
| shareaza |
: |
1206 |
(0%) |
| |
566 |
(0%) |
| |
0 |
(0%) |
| |
20.3M |
(0%) |
0.0 |
| |
192.5M |
(2%) |
0.1 |
| |
1:9.47 |
| aMule |
: |
6545 |
(1%) |
| |
4217 |
(1%) |
| |
0 |
(0%) |
| |
491.1M |
(1%) |
0.2 |
| |
95.2M |
(1%) |
0.0 |
| |
1:0.19 |
| lPhant |
: |
1809 |
(0%) |
| |
1466 |
(0%) |
| |
0 |
(0%) |
| |
136.2M |
(0%) |
0.1 |
| |
85.3M |
(1%) |
0.0 |
| |
1:0.63 |
| ePlus |
: |
5275 |
(1%) |
| |
4275 |
(1%) |
| |
0 |
(0%) |
| |
522.1M |
(1%) |
0.3 |
| |
40.0k |
(0%) |
0.0 |
| |
1:0.00 |
| Total |
: |
784787 |
(100%) |
| |
658939 |
(100%) |
| |
7939 |
(100%) |
| |
37.17G |
(100%) |
19.2 |
| |
9.51G |
(100%) |
4.9 |
| |
1:0.26 |
|
最后加入一句http管理地址是http://yourip:4080/
Tags: linux, emule, mldonkey
网络·技术 | 评论:0
| 阅读:750
Post by tywtyw2002 on 2009, September 22, 4:03 AM
我发现这个东西 vnstat是在vpser.com 还是net我也记不得了
按照他的教程思路大致装了一下
发现他写的东西里面出现了不少的错误
下面我结合自己的实践给大家写个完整版的教程吧
vnstat--一款简单监测指定网卡每日的传输流量软件
vnStat是一个Linux下的网络流量监控软件,它记录指定网卡每日的传输流量日志.
它并非基于网络包的过滤,而是分析文件系统- /proc, 所以vnStat无需root的权限就可使用
vnstat 有多个*nix版本:
vnstat 官网 : http://humdi.net/vnstat/
目前最新的是 vnstat-1.9.tar.gz
代码
- # wget http://humdi.net/vnstat/vnstat-1.9.tar.gz //下载
- # tar xvzf vnstat-1.9.tar.gz //解压
- # cd vnstat-1.9
- # make
- # make install
这样就安装完成了
本人系统为centos 5.3 64bit
建立流量数据库:
ifconfig 指令查看需要监控的网卡,假设只有eth0
然后生成数据库:
/usr/bin/vnstat -u -i eth0
然后做下计划任务
crontab -e
然后再最后加入
*/05 * * * * /usr/bin/vnstat --dumpdb -i eth0 >/data0/vnstat/vnstat_dump_eth0
*/05 * * * * if [ -x /usr/bin/vnstat ] && [ `ls /var/lib/vnstat/ | wc -l` -ge 1 ]; then /usr/bin/vnstat -u;fi
/data0/vnstat/vnstat_dump_eth0 为dump数据的位置可以自己定义 但是要跟php 文件匹配
把http://www.sqweek.com/sqweek/files/vnstat_php_frontend-1.4.1.tar.gz解压到http的目录里就ok了
然后调下config。php
$data_dir = ’/data0/vnstat/‘;要跟前面输出的目录一样
将要监控的网卡指定为1个:
// list of network interfaces monitored by vnStat
//$iface_list = array(’eth0′, ‘eth1′, ’sixxs’);
$iface_list = array(’eth0′,);
// will be displayed instead
//
$iface_title['eth0'] = ‘Internal’;
//$iface_title['eth1'] = ‘Internet’;
//$iface_title['sixxs'] = ‘SixXS IPv6′;
$graph_format='svg';要改成png 如 $graph_format='png';
否则你看不见图 svg 的ie插件很恶心 我试过svg的图 每次一进去ie就死。。。
效果:http://landon.v70.us/vnstat
Tags: vnstat, linux, 教程
网络·技术 | 评论:0
| 阅读:624
Post by tywtyw2002 on 2009, September 21, 2:56 PM
由于最及网络卡的很 ssl连接基本连不上所以改用ftp了。下面就是在64位操作系统上安装vsftp
下载地址是ftp://vsftpd.beasts.org/users/cevans/
目前最新版本是2。20 吧
我习惯2.04 所以就用2.04了
[root@v70.us software]#wget ftp://vsftpd.beasts.org/users/cevans/vsftpd-2.0.4.tar.gz
[root@v70.us software]#tar zxvf vsftpd-2.0.4.tar.gz
[root@v70.us software]#cd vsftpd-2.0.4
因为实在64位操作系统上安装 所以要打个补丁 2.20是不用2.04是一定要 其他版本不详
如果编译到sysdeputil文件时出现如下错误
specified for parameter 'sendfile'
sysdeputil.c:186: error: storage class specified for parameter 'environ'
sysdeputil.c:187: error: storage class specified for parameter 's_proctitle_space'
sysdeputil.c:187: error: parameter 's_proctitle_space' is initialized
sysdeputil.c:188: error: storage class specified for parameter 's_proctitle_inited'
sysdeputil.c:188: error: parameter 's_proctitle_inited' is initialized
sysdeputil.c:189: error: storage class specified for parameter 's_p_proctitle'
sysdeputil.c:189: error: parameter 's_p_proctitle' is initialized
sysdeputil.c:201: error: storage class specified for parameter 'do_sendfile'
sysdeputil.c:202: error: storage class specified for parameter 'vsf_sysutil_setproctitle_internal'
sysdeputil.c:203: error: storage class specified for parameter 's_proctitle_prefix_str'
sysdeputil.c:278: error: storage class specified for parameter 's_pamh'
sysdeputil.c:279: error: storage class specified for parameter 's_pword_str'
sysdeputil.c:281: error: storage class specified for parameter 'pam_conv_func'
sysdeputil.c:282: error: storage class specified for parameter 'vsf_auth_shutdown'
sysdeputil.c:288: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
sysdeputil.c:383: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
sysdeputil.c:398: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
sysdeputil.c:436: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
sysdeputil.c:474: error: storage class specified for parameter 'do_checkcap'
sysdeputil.c:478: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
sysdeputil.c:497: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
sysdeputil.c:514: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
sysdeputil.c:527: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
sysdeputil.c:604: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
sysdeputil.c:641: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
sysdeputil.c:796: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
sysdeputil.c:803: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
sysdeputil.c:809: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
sysdeputil.c:856: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
sysdeputil.c:889: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
sysdeputil.c:930: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
sysdeputil.c:935: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
sysdeputil.c:976: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
sysdeputil.c:1012: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
sysdeputil.c:1128: error: storage class specified for parameter 's_uwtmp_inserted'
sysdeputil.c:1129: error: storage class specified for parameter 's_utent'
sysdeputil.c:1134: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
sysdeputil.c:1173: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
sysdeputil.c:1189: error: old-style parameter declarations in prototyped function definition
sysdeputil.c:162: error: parameter name omitted
sysdeputil.c:162: error: parameter name omitted
sysdeputil.c:162: error: parameter name omitted
sysdeputil.c:1189: error: expected '{' at end of input
make: *** [sysdeputil.o] Error 1
就需要打补丁了
不打补丁的跳过这步
=========================================
[root@v70.us vsftpd-2.0.4]#wget http://linuxfromscratch.org/pipermail/lfs-dev/attachments/20061019/fd9b9f56/attachment.bin
[root@v70.us vsftpd-2.0.4]#patch sysdeputil.c attachment.bin
====================================================
64位的话make 还会出错是找不到 /lib/libpam.so,这个需要更改文件vsf_findlibs.sh
把第15行(我的文件是15行)locate_library /lib/libpam.so.0 && echo "/lib/libpam.so.0";中的lib 改成 lib64
如locate_library /lib64/libpam.so.0 && echo "/lib64/libpam.so.0";
[root@v70.us vsftpd-2.0.4]#make &&make install
安装完成 最后如果出现man config无法安装不用管了
反正用的也是自己的配置
安装到这里就结束了
下面该是配置了
一般都是pam+db数据库吧 然后使用虚拟用户映射到本地用户
添加ftp 用户 useradd -d /data0/ftp -s /sbin/nologin vsftpd
mkdir /data0/ftp
chown /data0/ftp ftp
然后编写pam文件
如果是32位系统就用 example里面的就ok了
如下 vi / etc/pam.d/vsftpd.pam
auth required /lib/security/pam_userdb.so db=/etc/vsftp/vsftpd_login
account required /lib/security/pam_userdb.so db=/etc/vsftp/vsftpd_login
如果是64位的加个64就ok了 如下
auth required /lib64/security/pam_userdb.so db=/etc/vsftp/vsftpd_login
account required /lib64/security/pam_userdb.so db=/etc/vsftp/vsftpd_login
这样pam就ok了
然后配置vsftp的配置文件
vsftp的配置目录在/etc/vsftp/
建议一个vsftpd.conf
vi /etc/vsftp/vsftpd.conf
必须写入
guest_username=ftp 这句是用户映射 使用ftp作为虚拟用户
pam_service_name=vsftpd.pam 这句是调用pma
其他的就按自己实际情况来写了
具体的看。。。
下面的是我自己用的 具体的先不解释了 最好别用我的 我的是如果不在user_list.ftp1加入用户名的话是不能登陆的
加了用户名后还要在/etc/vsftp/ftp1_userconf/ 建立一个是用户名的文件设置具体的权限
guest_enable=YES
pam_service_name=vsftpd.pam
anonymous_enable=NO
local_enable=YES
write_enable=no
local_umask=022
dirmessage_enable=YES
xferlog_enable=no
connect_from_port_20=YES
chroot_local_user=YES
guest_username=ftp
userlist_enable=YES
userlist_deny=no
userlist_file=/etc/vsftp/user_list.ftp1
listen=yes
listen_port=21
tcp_wrappers=no
virtual_use_local_privs=YES
chroot_local_user=YES
chroot_list_enable=yes
chroot_list_file=/etc/vsftp/chroot_list.ftp1
ascii_download_enable=yes
ascii_upload_enable=yes
pasv_max_port=6000
pasv_min_port=5000
user_config_dir=/etc/vsftp/ftp1_userconf/
ftpd_banner=welcome to coshim
用虚拟用的话还有建立db数据库下面开始建立db数据库
先安装
yum -y install db4 db4-utils
然后 进入目录/etc/vsftp/
cd /etc/vsftp/
添加用户名文件
单行为用户名,双行为密码,例如
#vi userpass
xuchen
12345
然后把文本转换成db4
# db_load -T -t hash -f userpass vsftpd_login.db
# chmod 600 vsftpd_login.db
这样配置就完成了
启动vsftpd /etc/vsftp/vsftpd.conf &就可以了
如果要自动启动就 vi /etc/rc.local
加入vsftpd /etc/vsftp/vsftpd.conf &就可以了
每台服务器的状况都不一样
本文只作为一个大致参考的文章
我也没有太认真的写,但是基本思路及做法肯定都是没问题的。有什么问题可以留言 我会帮你解决。
Tags: linux, vsftp, 教程
网络·技术 | 评论:0
| 阅读:747
Post by tywtyw2002 on 2009, July 8, 12:23 AM
闲着没事写了个nginx的脚本 使nginx的日常维护变得简单一些
改好以下变量就可以了 (我是按照张宴老大那篇教程位置写的)
nginx_path="/usr/local/webserver/nginx/sbin/nginx" //nginx执行文件位置
nginx_pid="/usr/local/webserver/nginx/nginx.pid"//nginx pid文件位置
nginx_conf="/usr/local/webserver/nginx/conf/nginx.conf" //nginx 配置文件的位置
把它扔到/bin 里面 我起名叫www 最后 chmod +x /bin/www 就ok了
支持一下命令
start 启动
stop 停止
restart 重启
kill 停止失败的时候 直接杀掉
check 检查配置文件
edit 更改配置文件
其他命令或者不打 显示nginx的版本
shell代码
-
- nginx_path="/usr/local/webserver/nginx/sbin/nginx"
- nginx_pid="/usr/local/webserver/nginx/nginx.pid"
- nginx_conf="/usr/local/webserver/nginx/conf/nginx.conf"
-
- function_check_config()
- {
- ${nginx_path} -t
- }
-
- function_kill_nginx()
- {
- kill -9 $(ps -ef | grep "nginx: master process" | grep -v "grep" | awk -F ' ' '{print $2}')
- }
-
- function_restart_nginx()
- {
- kill -HUP `cat ${nginx_pid}`
- }
-
- function_stop_nginx()
- {
- ${nginx_path} -s stop
- }
-
- function_start_nginx()
- {
- ${nginx_path} &
- }
-
- function_edit_nginx()
- {
- vi ${nginx_conf}
- }
-
-
- if [ "$1" = "start" ]; then
- function_start_nginx
- elif [ "$1" = "stop" ]; then
- function_stop_nginx
- elif [ "$1" = "restart" ]; then
- function_restart_nginx
- elif [ "$1" = "kill" ]; then
- function_kill_nginx
- elif [ "$1" = "check" ]; then
- function_check_config
- elif [ "$1" = "edit" ]; then
- function_edit_config
- else
- ${nginx_path} -v
- fi
Tags: nginx, lemp, shell, linux
网络·技术 | 评论:0
| 阅读:695