一、编译安装MYSQL
1、 上传源包到/usr/local/mysql-5.0.24.tar.tar
2、 tar zxvf mysql-5.0.24.tar.tar
3、 cd /usr/local/mysql-5.0.24
4、 groupadd mysql
5、 useradd -g mysql mysql
6、 ./configure --prefix=/usr/local/mysql
7、 make
8、 make install
9、 cp support-files/my-medium.cnf /etc/my.cnf
10、cd /usr/local/mysql
11、bin/mysql_install_db --user=mysql
12、chown -R root .
13、chown -R mysql var
14、chgrp -R mysql .
15、bin/mysqld_safe --user=mysql &
二、编译安装VSFTPD
1、上传源包到 /usr/local/vsftpd-2.0.4.tar.tar
2、tar zxvf vsftpd-2.0.4.tar.tar
3、cd /usr/local/vsftpd-2.0.4
4、vi builddefs.h内容如下
#ifndef VSF_BUILDDEFS_H
#define VSF_BUILDDEFS_H
#define VSF_BUILD_TCPWRAPPERS
#define VSF_BUILD_PAM (这行是关键)
#define VSF_BUILD_SSL
#endif /* VSF_BUILDDEFS_H */
5、make
6、ls -l vsftpd
-rwxr-xr-x 1 root root 86088 Jun 6 22:26 vsftpd //可执行程序已被编译成功
7、创建必要的帐号,目录:
# useradd nobody //可能你的系统已经存在此帐号,那就不用建立
# mkdir /usr/share/empty //可能你的系统已经存在此目录,那就不用建立
# mkdir /var/ftp //可能你的系统已经存在此目录,那就不用建立
# useradd -d /var/ftp ftp //可能你的系统已经存在此帐号,那就不用建立
# chown root:root /var/ftp
# chmod og-w /var/ftp
请记住,如果你不想让用户在本地登陆,那么你需要把他的登陆SHELL设置成/sbin/nologin,比如以上的nobody和ftp我就设置成/sbin/nologin
8、安装vsftp配置文件,可执行程序,man等:
# install -m 755 vsftpd /usr/local/sbin/vsftpd
# install -m 644 vsftpd.8 /usr/share/man/man8
# install -m 644 vsftpd.conf.5 /usr/share/man/man5
# install -m 644 vsftpd.conf /etc/vsftpd/vsftpd.conf
如果该步出错(install: cannot create regular file `/etc/vsftpd/vsftpd.conf': No such file or directory
)是因为没有/etc/vsftpd目录,自己建一下就可以了。
mkdir /etc/vsftpd
9、编译/etc/vsftpd/vsftpd.conf在最后加入一行
listen=YES
10、启动FTP服务
/usr/local/sbin/vsftpd /etc/vsftpd/vsftpd.conf &
此时已经可以匿名登录FTP了,这样就安装完成了。
(如果直接/usr/local/sbin/vsftpd 来启动的话,默认会调用/etc/vsftpd.conf配置文件的内容,请注意!)
三、建MYSQL的启动帐号
1 、useradd -d /home/ftpsite virtual
2、cp /etc/hosts /home/ftpsite
3、chown virtual.virtual /home/ftpsite/hosts
四、建库文件
1、mysql
2、create database vsftpd;
3、use vsftpd;
4、create table users (id int AUTO_INCREMENT NOT NULL,name char(16) binary NOT NULL,passwd char(48) binary NOT NULL,primary key(id));
5、create table logs (msg varchar(255), user char(16), pid int, host char(32), rhost char(32), logtime timestamp );
6、quit
7、mysql
8、grant select on vsftpd.users to virtual@localhost identified by '123456';
grant insert on vsftpd.logs to virtual@localhost identified by '123456';
9、use vsftpd
10、insert into users (name,passwd) values('tom','foo');
insert into users (name,passwd) values('jerry','bar');
11、select * from users;
如果能看到表内容就表示正常了。
五、安装PAM包
1、把源包考到 /usr/local/pam_mysql-0.7RC1.tar.gz
2、tar zxvf pam_mysql-0.7RC1.tar.gz
3、cd pam_mysql-0.7RC1
4、./configure --with-openssl --with-mysql=/usr/lib/mysql
5、make
6、make install
7、配置/pam.d/vsftpd
内容如下(注意一下实际pam_mysql.so的路径,进行相应更改.)
auth required /lib/security/pam_mysql.so user=virtual passwd=123456 host=/tmp/mysql.sock db=vsftpd table=users usercolumn=name passwdcolumn=passwd crypt=0 sqllog=1 logtable=logs logmsgcolumn=msg logusercolumn=user logpidcolumn=pid loghostcolumn=host logrhostcolumn=rhost logtimecolumn=logtime verbose=1
account required /lib/security/pam_mysql.so user=virtual passwd=123456 host=/tmp/mysql.sock db=vsftpd table=users usercolumn=name passwdcolumn=passwd crypt=0 sqllog=1 logtable=logs logmsgcolumn=msg logusercolumn=user logpidcolumn=pid loghostcolumn=host logrhostcolumn=rhost logtimecolumn=logtime verbose=1
说明:如果MYSQL安装好以后,要修改MYSQL某个数据库的启动用户密码的话,只要做如下两步操作:
1)修改/etc/pam.d/vsftpd内容.把2处类似passwd=123456这样的密码改成你要设置的密码.
2)进入mysql后,运行
grant select on vsftpd.users to virtual@localhost identified by 'yourpasswd';
grant insert on vsftpd.logs to virtual@localhost identified by 'yourpasswd';
第1)步与第2)步的密码要一致.
3)重启MYSQL.
六、配置vsftpd
/etc/vsftpd/vsftpd.conf内容如下
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
chroot_local_user=YES
guest_enable=YES
guest_username=virtual
listen=YES
listen_port=21
pasv_enable=YES
pasv_min_port=30000
pasv_max_port=30999
anon_world_readable_only=NO
virtual_use_local_privs=YES
pam_service_name=vsftpd
七、高级配置VSFTPD
在/etc/vsftpd/vsftpd.conf 基础上加入
anon_max_rate=30000 '限制虚拟帐号下载速率
local_max_rate=30000 '限制本地帐号下载速率
max_per_ip=2 '同时只能有2线程在下载
dirlist_enable=NO '关闭帐号登录后的ls功能
修改
anon_upload_enable=NO
anon_mkdir_write_enable=NO
anon_other_write_enable=NO
69.202.107.* 于 2007-09-07 02:34:46发表:
bf6a38b62b835b020ea79e9233e4f6fd http://babylonbreilorologio.ukcvbo.org/varese-volley/ http://hiphopnapoli.npxbkv.org/pellicola-protettive-palm-treo-650/ http://immagine-movimento-fuoco.yojewt.org/ http://officinariparazioneauto.yufywt.org/allevamento-gatto-persiano-milano/ http://cicerone-tusculanae.ufftiy.org/ http://dieta-lemme-dopo-venti-giorno.vozlau.org/ http://manuali-di-modellismo.yavpvy.org/ http://mercedes-srl.odiioj.org/ http://scheda-lg-u310.oxibnl.org/ http://preparareunmenu.ukcvbo.org/canzoni-jon-bon-jovi/ ef5da0821261872f3a177fbd4ce2e9fc
221.82.66.* 于 2007-09-06 09:19:40发表:
d1448bf6416f5c1616cae5558b0ca086 http://iris.lib.virginia.edu/phpBB2/viewtopic.php?t=7689 http://transatlantic.ipo.asu.edu/forum/viewtopic.php?t=208 http://transatlantic.ipo.asu.edu/forum/viewtopic.php?t=208 http://iris.lib.virginia.edu/phpBB2/viewtopic.php?t=7689 http://www.cide.au.edu/audasaforum/viewtopic.php?t=458 http://iris.lib.virginia.edu/phpBB2/viewtopic.php?t=7689 http://transatlantic.ipo.asu.edu/forum/viewtopic.php?t=208 http://transatlantic.ipo.asu.edu/forum/viewtopic.php?t=208 http://iris.lib.virginia.edu/phpBB2/viewtopic.php?t=7689 http://payson.tulane.edu/techeval/forums/viewtopic.php?t=74 d950163e2bc04fe30175aa17834ab13d
76.118.108.* 于 2007-09-05 20:26:03发表:
af2c81baa55a0d6aec07b6ef61742679 https://www.cslu.ogi.edu/forum/viewtopic.php?t=2656 http://www.grahi.upc.edu/ERAD2006/phpBB2/viewtopic.php?t=6839 http://www.mat.ucsb.edu/CUI/viewtopic.php?t=1142 http://www.grahi.upc.edu/ERAD2006/phpBB2/viewtopic.php?t=6839 http://www.grahi.upc.edu/ERAD2006/phpBB2/viewtopic.php?t=6839 https://www.cslu.ogi.edu/forum/viewtopic.php?t=2657 http://forum.jalc.edu/phpBB2/viewtopic.php?t=2267 http://myweb.msoe.edu/~chaversa/phpBB2/viewtopic.php?t=2012 http://www.mat.ucsb.edu/CUI/viewtopic.php?t=1142 https://www.cslu.ogi.edu/forum/viewtopic.php?t=2657 db62d9d137e7999ef0c8bbd27991ea41
75.4.159.* 于 2007-09-05 06:10:59发表:
0998b988556fa1c4411c93d4dbae853a http://bimbi-sani.dfmviz.info/ http://romanzo-emigrazione-napoli-usa.dfmviz.info/ http://pedopornografia-baby-sitter.dfmviz.info/ http://contratto-di-lavoro-sportivo.dfmviz.info/ http://quanto-costa-rifarsi-il-naso.dfmviz.info/ http://ponte-in-ferro.dfmviz.info/ http://suoneria-nokia-tg5.dfmviz.info/ http://decisione-7613-21-12-1999.dfmviz.info/ http://fica-di-mia-moglie.dfmviz.info/ http://roberto-cazzola-forum.dfmviz.info/ 21817dd0dbd87cb119a7471ab31fd121
71.72.122.* 于 2007-08-16 00:12:34发表:
ff0759922298e02d20e983ed0710b714 http://protocollo-riabilitativo-osteosintesi-femore.akrmtn.com/ http://epifania-oman.akrmtn.com/ http://inculata-grosso-cazzo.ddxsak.com/ http://richiesta-docente-scuola-svizzere.akrmtn.com/ http://internet-con-cellulari.zpvztz.com/ http://partiture-musica-classica.ddxsak.com/ http://scuola-privata-giovanni-pascoli.akrmtn.com/ http://frutta-candita-zuccata.akrmtn.com/ http://incontro-hard-umbria.ddxsak.com/ http://cancro-osseo.flroxk.com/ f79720dbd018955dfd9068d527cd2031
89.245.100.* 于 2007-07-26 01:20:00发表:
25469d4b5420ec96d02fc5e7f672427d http://sfilato-preservativo.ftgmns.biz/ http://cantante-elettra.sfupeh.biz/ http://annuncio-di-scambio-di-coppia-toscana.sfupeh.biz/ http://circolari-inps-2006.txcbmz.biz/ http://domenico-luzzi.sfupeh.biz/ http://poggetto-ristorante.sfupeh.biz/ http://territorio-mezzogiorno.fmyrxs.biz/ http://fondo-per-acquari.smtpld.biz/ http://affiliazione-commerciale.sfupeh.biz/ http://polizia-di-stato-punti-patenti.zqemjp.biz/ f0bd15bc4c04b02533089147dbde4c5b
220.72.115.* 于 2007-07-25 19:13:10发表:
6dc9527f9c29ed2690153fb2d4d0fbef http://sito-ufficiale-raffaello-balzo.ggjrfj.biz/ http://iva-rifiuto.ytxxxk.biz/ http://napoli-hobby-foto.mbgzfn.biz/ http://il-cortisone.ggjrfj.biz/ http://espresso-lavoro.pzgvuv.biz/ http://roma-djerba.pzgvuv.biz/ http://nudo-donna-italiana.ytxxxk.biz/ http://malpensa-a-linate.ytxxxk.biz/ http://cavo-batteria.mbgzfn.biz/ http://malattia-professionale-sarcoidosi.gohktw.biz/ bfdd7bec9230a10317341e982495b689
125.132.133.* 于 2007-07-25 16:00:12发表:
217f63e17de35a5795b095b01cf4e252 http://fine-settimana-parigi-torre-effel.kajgdw.biz/ http://trasferimento-perfezionamento-passivo.kajgdw.biz/ http://universita-lingue-straniere.enadzh.biz/ http://affitto-corsica-baia-santa-giulia.ppdpwx.biz/ http://costruzione-vendita-prefabbricato-toscana.ppdpwx.biz/ http://shakespeare-commento.ppdpwx.biz/ http://sesso-con-adolescenti.iuatju.biz/ http://spartito-my-melancholy-blues.ppdpwx.biz/ http://alcolico-angelo-azzurro.enadzh.biz/ http://giochi-stecca.kajgdw.biz/ 69fae163d26a9b1682339a4eb6fc4ad9
222.99.189.* 于 2007-07-24 06:17:49发表:
4c027d3c6c6e750a18e5e70131f0b9c3 http://nip-tuck-foto.mnkcbe.org/ http://chiesa-santo-volto-roma.pvaeyo.org/ http://firenze-notte.gbdrme.org/ http://scherma-catania.jnbwct.org/ http://codice-telecomando-universale-thompson.mnkcbe.org/ http://campiglia-marittima-comune.gbdrme.org/ http://fica-bambola-ramona.hdpwsk.org/ http://centro-medico-torre-bianca.hdpwsk.org/ http://prezzo-pod-nano.gbdrme.org/ http://cappiello-arredamento.gbdrme.org/ eb89aa2351bfb8dd061b0dc25061dcdb
59.21.45.* 于 2007-07-21 13:57:22发表:
2029b51445e8e0db769516c272eeb85d vera magia http://universitastudiochietipescara.nfnzro.org/trucco-soluzione-gratis-syberia/ http://clubaironeelba.cerfmd.org/scaricare-canzoni-per-mp3/ http://collinaastigiane.cerfmd.org/cucina-muratura-componibile/ foto kawasaki 636 nera cucina firenze hotel portogruaro mikonos milano video calcio 1982 tgcom it3 b8fb7d84153cc5c69600cbe1497734b2
88.17.52.* 于 2007-07-20 04:58:16发表:
ca8dd1875a7c390b96f5df9a81d4ae36 http://sfondo-desktop-francesco-totti.kmyeyh.com/ http://convertire-file-amv.jvzulp.in/ http://atto-costitutivo-tipo-srl-artigiana.licoxi.in/ http://jasmine-eurorentola.licoxi.in/ http://costruire-fontana-zen.aoknmm.in/ http://legge-finanziaria-2007-prodi.fzhoas.in/ http://www-aste-giudiziare-it.miwcjz.com/ http://suoneria-cellulare-alcatel-ot511.uylqdg.com/ http://pagamento-spese-lite.fzhoas.in/ http://video-incendio-oleificio-perugia-raffaele-ruggiero.jvzulp.in/ b8a12f78e2ab8d9c8e5e94f78e975725
123.214.200.* 于 2007-07-18 17:52:17发表:
http://0deb515df1f2d4ec368cd2fae3b8cea1-t.xkktxb.org 0deb515df1f2d4ec368cd2fae3b8cea1 http://0deb515df1f2d4ec368cd2fae3b8cea1-b1.xkktxb.org 0deb515df1f2d4ec368cd2fae3b8cea1 http://0deb515df1f2d4ec368cd2fae3b8cea1-b3.xkktxb.org 8d1f2bfe3cbc5359328d95464cab8b7c
123.214.200.* 于 2007-07-18 17:28:49发表:
bb5e8897ea0f2d2366d29c473a932378 http://telefonotorino.wfdklb.org/sonno-letto/ http://palladoloreragazzina.qbmkwd.org/hpp-www-sportitalia-com/ pedane modulari banca monte parma trigono fetale http://hoteldirivaligure.nxaqjj.org/fai-cosa/ http://casagiocodima.vniybd.org/mare-a-genova/ http://frameworkeuropeo.nxaqjj.org/mobile-acciaio-vetro/ http://frameworkeuropeo.nxaqjj.org/mely-satta-fan-club/ http://cicognanerafoto.jpwypc.org/foto-antonella-elia-paparazzo/ 8ea4fcdde1a965ef95e68187f350c6f6
222.121.58.* 于 2007-07-06 00:40:57发表:
http://671e4bef79752c55830118a8fab7c2ef-t.lwgmrw.org 671e4bef79752c55830118a8fab7c2ef http://671e4bef79752c55830118a8fab7c2ef-b1.lwgmrw.org 671e4bef79752c55830118a8fab7c2ef http://671e4bef79752c55830118a8fab7c2ef-b3.lwgmrw.org 7323937625928ec2c2b389a5c949efe8