CentOS下mysql+pureftpd的编译安装

操作系统:CentOS

软件:mysql-5.0.22.tar.gz pure-ftpd-1.0.22.tar.gz

一、编译安装mysql

1、下载并解压mysql和pure-ftpd软件包

[root@localhost chenye]# ls
mysql-5.0.22 mysql-5.0.22.tar.gz pure-ftpd-1.0.22 pure-ftpd-1.0.22.tar.gz

2、编译并安装mysql

[root@localhost chenye]# cd mysql-5.0.22

[root@localhost mysql-5.0.22]# ./configure --prefix=/usr/local/mysql --with-mysql-user=mysql --with-extra-charsets=all --with-unix-socket-path=/usr/local/mysql/var/mysql.sock ;make ;make install

--with-mysql-user指定mysql运行的用户
--with-extra-charsets支持扩展字符集
--with-unix-socket-path指定mysql运行后,套接字文件存放位置

3、配置mysql
[root@localhost mysql-5.0.22]# cd /usr/local/mysql/

建立配置文件
[root@localhost mysql]# cp share/mysql/my-large.cnf /etc/my.cnf

建立启动数据库所用的用户mysql
[root@localhost mysql]# adduser -d /usr/local/mysql/var mysql

在用户宿主目录中修改.bashrc文件,添加命令的搜索路径
[root@localhost mysql]# vi var/.bashrc
set PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/sbin/nologin

初始化数据库
[root@localhost mysql]# ./bin/mysql_install_db --user=mysql

[root@localhost mysql]# ls var
mysql mysql-bin.000001 mysql-bin.000002 mysql-bin.index test

4、启动数据库
[root@localhost mysql]# ./bin/mysqld_safe &

[root@localhost mysql]# ls var
ibdata1 localhost.localdomain.err mysql-bin.000001 mysql-bin.index
ib_logfile0 localhost.localdomain.pid mysql-bin.000002 mysql.sock
ib_logfile1 mysql mysql-bin.000003 test

开机自动运行
[root@localhost mysql]# cp share/mysql/mysql.server /etc/init.d/mysqld
[root@localhost mysql]# chkconfig --level 35 mysqld on

5、建立数据库管理员
[root@localhost mysql]# ./bin/mysqladmin -u root password xxxxxxxx

登陆测试
[root@localhost mysql]# ./bin/mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4 to server version: 5.0.22-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

数据库常用管理命令,在/usr/local/mysql/bin目录下:
Mysql 显示和使用mysql数据库
Mysqladmini 创建和维护mysql数据库
Isamachk 修复、检查和优化.ism后缀的数据文件
Mysqldump 备份数据库
Myisamchk 修复.myi后缀的数据文件
Mysql.server start stop 启动和停止mysql

二、编译安装pure-ftpd

1、编译安装pureftp 源代码http://www.pureftpd.org/

[root@localhost pure-ftpd-1.0.22]# ./configure --prefix=/usr/local/pureftpd --with-cookie --with-throttling --with-ratios --with-quotas --with-sysquotas --with-largefile --with-welcomemsg --with-upload_script_ --with-virtualhosts --with-virtualroot --with-virtualchroot --with-diraliases --with-peruserlimits --with-language=simplified-chinese --with-mysql=/usr/local/mysql --with-paranoidmsg --with-altlog --with-puredb

如果出现类似configure: error: Your MySQL client libraries aren't properly installed 的错误,将mysql目录下的 include/mysql下的mysql.h文件以及lib/mysql下的全部文件,连接(直接复制过去或许也可)到 /usr/lib 目录下.

[root@localhost pure-ftpd-1.0.22]# make ; make install

2、建立配置文件

[root@localhost pure-ftpd-1.0.22]# mkdir -m 755 /usr/local/pureftpd/etc

[root@localhost pure-ftpd-1.0.22]# cp pureftpd-mysql.conf /usr/local/pureftpd/etc/
[root@localhost pure-ftpd-1.0.22]# cp configuration-file/pure-ftpd.conf /usr/local/pureftpd/etc/
[root@localhost pure-ftpd-1.0.22]# cp configuration-file/pure-config.pl /usr/local/pureftpd/bin/
[root@localhost pure-ftpd-1.0.22]# chmod u+x /usr/local/pureftpd/bin/pure-config.pl

三、建立mysql认证数据库表
[root@localhost pure-ftpd-1.0.22]# ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql

mysql> create database pureftpd;
mysql> grant all on pureftpd.* to pureftpd@localhost identified by 'pureftpd';
mysql> use pureftpd

mysql> CREATE TABLE users (
id int(32) unsigned NOT NULL auto_increment,
User varchar(16) NOT NULL default '*',
Password varchar(64) NOT NULL default '*',
Uid varchar(11) NOT NULL default '-1',
Gid varchar(11) NOT NULL default '-1',
Dir varchar(128) NOT NULL default '-1',
QuotaSize smallint(5) NOT NULL default 0,
QuotaFiles int(11) NOT NULL default 0,
ULBandwidth smallint(5) NOT NULL default 0,
DLBandwidth smallint(5) NOT NULL default 0,
ULRatio smallint(6) NOT NULL default 0,
DLRatio smallint(6) NOT NULL default 0,
comment tinytext NOT NULL,
ipaccess varchar(15) NOT NULL default '*',
status enum('0','1') NOT NULL default '0',
create_date datetime NOT NULL default '0000-00-00 00:00:00',
modify_date datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (id,User),
UNIQUE KEY User (User)
) TYPE=MyISAM AUTO_INCREMENT=5;

建立用户
INSERT INTO users VALUES (1,'chenye', 'qqqqqq', '2000', '2000', '/var/pureftp', 0, 0, 0, 0, 0, 0, '*', '*', '1', '2009-7-11 09:20:33', '2009-7-11 09:20:33');

四、建立用于pureftpd认证用户的系统信息

[root@localhost /]# groupadd -g 2000 pureftp
[root@localhost /]# useradd -u 2000 -g pureftp -d /var/pureftp -s /sbin/nologin pureftp

五、修改pureftpd的配置文件

[root@localhost var]# vi /usr/local/pureftpd/etc/pure-ftpd.conf

MySQLConfigFile /usr/local/pureftpd/etc/pureftpd-mysql.conf
NoChmod yes
IPV4Only yes
DisplayDotFiles no 不显示隐藏文件

CreateHomeDir yes 自动建立家目录

[root@localhost var]# vi /usr/local/pureftpd/etc/pureftpd-mysql.conf

MYSQLSocket /usr/local/mysql/var/mysql.sock
MYSQLUser pureftpd
MYSQLPassword pureftpd
MySQLGetQTAFS SELECT QuotaFiles FROM users WHERE User="\L"
MySQLGetQTASZ SELECT QuotaSize FROM users WHERE User="\L"

六、运行pureftpd

启动pureftpd
[root@localhost ~]# /usr/local/pureftpd/bin/pure-config.pl /usr/local/pureftpd/etc/pure-ftpd.conf

启动自动运行
[root@localhost ~]# vi /etc/init.d/pureftpd

#!/bin/bash
#
# Startup script for the pure-ftpd FTP Server $Revision: 1.3 $
#
# chkconfig: 2345 85 15
# description: Pure-FTPd is an FTP server daemon based upon Troll-FTPd
# processname: pure-ftpd
# pidfile: /var/run/pure-ftpd.pid
# config: /etc/pure-ftpd.conf

# Source function library.
. /etc/rc.d/init.d/functions

RETVAL=0

# Path to the pure-ftp binaries.
prog=pure-config.pl
fullpath=/usr/local/pureftpd/bin/$prog
pureftpwho=/usr/local/pureftpd/sbin/pure-ftpwho

start() {
echo -n $"Starting $prog: "
$fullpath /usr/local/pureftpd/etc/pure-ftpd.conf --daemonize
RETVAL=$?
[ $RETVAL = 0 ] && touch /var/lock/subsys/$prog
echo
}

stop() {
echo -n $"Stopping $prog: "
kill $(cat /var/run/pure-ftpd.pid)
RETVAL=$?
[ $RETVAL = 0 ] && rm -f /var/lock/subsys/$prog
echo
}

# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart)

stop
start
;;
condrestart)
if [ -f /var/lock/subsys/$prog ] ; then
stop
# avoid race
sleep 3
start
fi
;;
status)
status $prog
RETVAL=$?
if [ -f $pureftpwho ] && [ $RETVAL -eq 0 ] ; then
$pureftpwho
fi
;;
*)
echo $"Usage: $prog {start|stop|restart|condrestart|status}"
RETVAL=1
esac
exit $RETVAL

**********不能把用户的dir放在其他用户的dir下面,否则会出现不能登录的问题。************

QUICK TAGS

centosmysqlpureftpd

13 USER COMMENTS

  1. "Silva is definitely a talent for the future and Mourinho will have to battle former club, Real Madrid, for the Monaco aces signature.""asked about the rumours surrounding Carvalho, he told Chinese media: I have a good relationship with Carvalho, who has a wonderful professional career."Former Barcelona star Pedro opened the scoring in the 7th minute after slotting low into the corner after great play from Victor Moses.
    atlanta falcons practice jersey
    銈儷銉嗐偅銈?鍚嶅埡 銉°兂銈?/a>
    la rams 2018 roster

    Watch Wayne Rooney star in some classic Casillero del Diablo wine advertsAs you get older there are ."s, results and live match commentary by clicking HEREIts normal when you play with the same players in the same roles — they take confidence."
    "We cant go to Ireland, sit back for 90 minutes and wish our lives away, hoping that we nick one, because we have done that before."

  2. after inflationON THE REBOUNDRonaldo leads the charge as Real Madrid get back to basics in training ."rs seat to maintain the passing style that became the teams hallmark, before giving the reins to Monk."Every player who we feel can make the team stronger is welcome at Everton.
    giannis antetokounmpo jersey medium
    銈儷銉嗐偅銈?銈裤兂銈偨銉?銈炽儭鍏?/a>
    lakers baseball jersey

    could look close to home having been charged with finding Joyces successor along with club secretary John Alexander.He crowed about how his team were supposed to be the clowns of the show but ended up stealing it instead.
    A superb second-half turnaround ended Birminghams unbeaten start to the season.

  3. "Liverpools Dream Team ratingsMignolet 6, Clyne 6, Matip 6, Lucas 6 (Woodburn 84, 6), Milner 6, Lalla."School kids watched on in awe as the Frenchman spread his arms out before applauding his own piece of skill.I can guarantee is that if one day Wayne leaves the club it is not because I want him to leave the club.
    銈儷銉嗐偅銈?銈裤兂銈?銉┿偊銉炽儔
    銈儷銉嗐偅銈?銉┿兂銈兂銈?/a>
    seattle seahawks standings

    "res, results and live match commentaryIt will be the first time Spurs have paid a player that sum outright.""They have had a massive run from League One and as soon as the switch was turned, they have had success after success."
    And he appears set to clinch two massive signings by the end of the summer.

  4. 喜多福,乾拌麵,拌麵,乾麵,呷什麵,關廟麵,手工麵,手作麵,沙茶咖哩,川味麻辣 牛肉風味,油蔥香菇,香蒜麻醬,紅油烏醋,麻辣麻醬,川味麻辣,團購美食,sidofu,日曬麵條,古法手工精製,日光自然曬乾,乾拌麵網路票選,拌麵網路票選 ,乾拌麵台灣票選 ,拌麵台灣票選,乾拌麵排名,拌麵排名,2018乾拌麵之王

    https://www.sidofu.net/

  5. birkenstock shoes
    yeezy boost 350
    moncler outlet
    barbour jackets
    michael kors cyber monday
    air vapormax
    lebron 11
    kyrie 3nike kyrie 3
    vans for sale
    pandora charms sale clearance
    pandora bracelets
    nike factory outlet
    pandora jewelry
    ugg outlet
    birkenstocks
    balenciaga shoes
    adidas soccer
    nike outlet store online
    vapormax flyknit
    adidas yeezy
    pandora bijoux
    salvatore ferragamo outlet
    kobe shoes
    nike huarache
    ultra boost adidas
    red bottom
    plein
    jordans shoes
    scarpe hogan
    adidas shoes
    soccer cleats
    timberland boots for women
    nike kd 10
    yeezy
    coach cyber monday
    polo lacoste
    mcm bags
    pandora jewelry
    nike vapor max
    swarovski outlet
    pandora
    nike factory
    nike outlet store online shopping
    air jordan shoes
    air max 97 silver bullet
    pandora jewelry official site
    mbt shoes
    salvatore ferragamo
    timberland outlet stores
    longchamp outlet
    fitflops sale
    retro 13
    jordan 11 red
    mbt shoes clearance outlet
    fitflops sale clearance
    pandora rings
    pandora bracelets clearance
    moncler official
    vapormax nike
    hermes handbags
    north face canada
    canada goose outlet
    timberland shoes
    louboutin
    michael kors outlet clearance
    oakley sunglasses wholesale
    ray ban sunglasses
    north face
    under armour outlet
    air jordan
    curry 4 shoes
    yeezy boost 350 v2
    pandora bracelet
    拧perky pandora akce
    kyrie 4
    adidas sneakers
    off white
    air jordan 11
    nike air vapormax flyknit
    ugg boots
    ultra boost
    adidas outlet online
    pandora soldes 2018
    curry shoes
    nike outlet
    air max pas cher
    asics gel
    timberland outlet
    clarks outlet
    under armour outlet black friday
    oakley sunglasses
    huarache shoes
    kobe 11
    curry 4
    yeezy boost 350 v2
    yeezy boost 350 v2
    louboutin shoes
    air force 1
    ultra boost
    valentino shoes
    canada goose sale
    curry 4 shoes
    nike air huarache
    michael kors outlet
    air jordan 11 win like 82
    pandora bracciali
    polo ralph lauren outlet online
    yeezy 350
    pandora bracelet
    under armour shoes
    skechers outlet
    kate spade black friday deals
    pandora charms
    pandora jewelry official site
    adidas yeezy
    coach outlet
    oakley eyeglasses
    pandora jewelry
    fitflops clearance
    birkenstock outlet
    nike vapor max flyknit
    air max pas cher
    nike air max 2018
    nike air max
    yeezy boost 350 v2
    christian louboutin mens shoes
    coach cyber monday
    nike outlet
    north face black friday deals
    longchamp bags
    pandora jewelry
    valentino outlet
    yeezy boost
    cheap soccer cleats
    ugg slippers
    red bottom shoes
    clarks boots
    north face black friday deals
    pandora bracelet
    michael kors cyber monday
    pandora jewelry
    coach outlet
    nike outlet store online
    north face jackets black friday
    air max pas cher
    nike air vapor
    ray ban eyeglasses
    nike air max 97
    under armour clearance
    pandora
    cortez shoes
    air max 270
    nike clearance
    michael kors handbags
    pandora bracelet charms
    pandora charms sale clearance
    pandora
    oakley
    nike hyperdunk 2017
    lebron shoes
    yeezy
    woolrich sito ufficiale
    jordan retro
    adidas shoes
    nike air max 97 scontatissime
    air max 95 neon
    win like 96
    nike vapor max
    nike air max 97
    yeezy shoes
    pandora charms
    birkenstock cyber monday
    nike factory
    birkenstock shoes
    pandora jewellery
    north face outlet online
    fake rolex
    tory burch handbags
    harden shoes
    north face outlet
    nike outlet online
    birkenstock outlet
    jordan 12
    pandora
    nike air max 2017
    kate spade handbags
    pandora jewelry black friday
    red bottom
    nike air presto
    nike shoes
    goyard
    nike outlet store
    nike vapormax
    timberland outlet
    skechers boots
    yeezy shoes
    kd shoes
    nike shox for women
    kyrie 4
    north face clearance

  6. 喜多福,乾拌麵,拌麵,乾麵,呷什麵,關廟麵,手工麵,手作麵,沙茶咖哩,川味麻辣 牛肉風味,油蔥香菇,香蒜麻醬,紅油烏醋,麻辣麻醬,川味麻辣,團購美食,sidofu,日曬麵條,古法手工精製,日光自然曬乾

    https://www.sidofu.net/

  7. 【揚歌-教學麥克風直營店】官方線上購物網站─JM-180B有線麥克風擴音器│無線麥克風擴音器│揚歌小蜜蜂│專營教學麥克風及教學擴音器

    https://mic-shop.com/

  8. Thanks for finally writing about >CentOS下mysql+pureftpd的编译安装 - PageDNS
    主机播报|VPS主机|美国VPS|美国主机|Linux vps|低价VPS|主机代购|免费空间

  9. Hello my name is Britney and I just wanted to drop you a quick note here instead of calling you. I discovered your CentOS下mysql pureftpd的编译安装 - PageDNS 主机播报|VPS主机|美国VPS|美国主机|Linux vps|低价VPS|主机代购|免费空间 page and noticed you could have a lot more hits. I have found that the key to running a successful website is making sure the visitors you are getting are interested in your website topic. There is a company that you can get keyword targeted traffic from and they let you try their service for free for 7 days. I managed to get over 300 targeted visitors to day to my site. https://oje.lol/4n

  10. Anetheron美服魔兽世界100-110级代练。PLS173.com这个平台不错,24小时客服很方便,价格不是最便宜的,但是代练要的是安全。我的职业是德鲁伊。

  11. Whhat you posted was very logical. However, what about this?

    what if you added a little content? I am not suggesting your
    information isn't good, however suppose you added a title that grabbed folk's attention? I mean CentOS下mysql+pureftpd的编译安装 - PageDNS 主机播报|VPS主机|美国VPS|美国主机|Linux vps|低价VPS|主机代购|免费空间 is kinda plain.
    You could look at Yahoo's front page and watch how they create article titles to grab viewers to open the links.
    You might try adding a video or a related picture or two to grab readers excited about what
    you've written. Just my opinion, it might bring your posts
    a little livelier.

  12. Hallo!Schön dass das Forum so schnell online gegangen ist!Golden Carriage (chin. Jin Yu 金輿) wird anhand der TD mit den Ez berechnet:+H -H +F -F +E -E +M -M +W -WE+ F- E2- M+ E2- M+ E2+ W- E- H+Über die Bedeutung habe ich nichts gefunden.

  13.  ( 2012.12.20 05:13 ) : 感谢博主,前几次借助博主的分享成功卸载了几次,但是反复多卸载重装个几次,不管用了,卸载不干净。后来用这个搞定了如果运行这些第二步、apt-get rvoeme mysql-server purge第三步、apt-get rvoeme mysql-common purge 您没卸载干净,那你可以 第一步、apt-get -f autoremove 第二步、apt-get rvoeme mysql-server purge 第三步、apt-get rvoeme mysql-common purge

Leave a Comment

Other

Copyright © 2007-2010 PageDNS, Some Rights Reserved. Theme by M4 | Powered by Typecho))) | Hosted by 37hi.com.