Techyou labs
真正的爱应该超越生命的长度,心灵的宽度,灵魂的深度
常用标签
您正在查看:标签 pureftpd 下的文章

Nginx+Apache(suexec+fcgid)+PHP5.3.x+Mysql5.1.x+Pureftpd+Quota服务器部署笔记
首选32bit centos
源码包全部放在/usr/src/source_package下
1:初始化环境

#yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel mhash mhash-devel libmcrypt libmcrypt-devel libc-client libc-client-devel

2:安装libevent

#wget http://monkey.org/~provos/libevent-1.4.14b-stable.tar.gz#tar xf libevent-1.4.14b-stable.tar.gz#cd libevent-1.4.14b-stable #./configure --enable-shared#make && make install

3:安装pcre

#wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.10.tar.gz#tar xf pcre-8.10.tar.gz#cd pcre-8.10/#./configure --enable-shared --enable-utf8 --enable-unicode-properties#make && make install

4:安装libunwind

#wget http://download.savannah.gnu.org/releases/libunwind/libunwind-0.99.tar.gz#tar xf libunwind-0.99.tar.gz#cd libunwind-0.99#./configure --enable-shared#make && make install

5:安装google-perftools

#wget http://google-perftools.googlecode.com/files/google-perftools-1.6.tar.gz#tar xf google-perftools-1.6.tar.gz#cd google-perftools-1.6#./configure --enable-shared##注:64bit 必须加上--enable-frame-pointers#make && make install

6:安装nginx.

#wget http://labs.frickle.com/files/ngx_cache_purge-1.0.tar.gz#tar zxvf ngx_cache_purge-1.0.tar.gz#wget http://nginx.org/download/nginx-0.8.50.tar.gz#tar zxvf nginx-0.8.50.tar.gz#cd nginx-0.8.50/#cd ../#useradd -d /dev/null -s /sbin/nologin -c "Nginx Runner" -r www-data#mkdir -p /zh/nginx#mkdir -p /tmp/nginx/client/cache#mkdir -p /tmp/nginx/proxy/cache#mkdir -p /tmp/nginx/fastcgi/cache

如想提速,可以将缓存目录划到/dev/shm下

#./configure --prefix=/zh/nginx --user=www-data --group=www-data --with-rtsig_module --with-select_module --with-poll_module --with-ipv6 --with-http_ssl_module --with-http_realip_module --with-http_sub_module --with-http_flv_module --with-http_gzip_static_module -–with-file-aio --with-http_stub_status_module --http-client-body-temp-path=/tmp/nginx/client --http-proxy-temp-path=/tmp/nginx/proxy --http-fastcgi-temp-path=/tmp/nginx/fastcgi --with-google_perftools_module --add-module=/usr/src/source_package/ngx_cache_purge-1.0#make && make install

如需要无缝升级:

#cp -r --force objs/nginx /zh/nginx/sbin#/etc/init.d/nginx restart

7:Mysql5.1、PHP5.3.x安装编译mysql

#./configure --prefix=/usr/local/mysqld --enable-assembler --with-charset=utf8 --with-extra-charsets=all --enable-thread-safe-client --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile --with-plugins=max-no-ndb --enable-shared --with-tcp-port=3306 --with-mysqld-user=mysqld --with-low-memory --with-mysqlmanager

安装并初始化环境

# make # make install# cp support-files/my-medium.cnf /usr/local/mysqld/etc/my.cnf

更改目录权限

# chown -R mysqld /usr/local/mysqld # chown -R mysqld /var/mysqldata # chown -R mysqld:mysqld /usr/local/mysqld # chown -R mysqld:mysqld /var/mysqldata   # chmod 711 /usr/local/mysqld -R# chmod 755 /usr/local/mysqld/lib/ -R# chmod 700 /var/mysqldata -R

初始化数据库

# /usr/local/mysqld/bin/mysql_install_db --user=mysqld --datadir=/var/mysqldata --basedir=/usr/local/mysqld --skip-name-resolve --defaults-file=/usr/local/mysqld/etc/my.cnf

php编译:

#./configure --prefix=/zh/php5 --enable--mod-charset --enable-roxen-zts --with-libxml-dir=/usr --with-layout=GUN --with-config-file-path=/zh/php5/etc --with-config-file-scan-dir=/home/*/etc --with-openssl --with-zlib --enable-sigchild --enable-bcmath --enable-calendar --with-curl --with-curlwrappers --enable-exif --enable-ftp --disable-rpath --with-gd --with-jpeg-dir --with-png-dir --enable-gd-native-ttf --with-gettext --with-mhash --with-imagick --with-imap --with-imap-ssl --enable-mbstring --with-mcrypt --with-mysql=mysqlnd --enable-mbregex --with-mysql-sock --with-mysqli --with-pdo-mysql --with-pdo-sqlite --enable-soap --enable-sockets --enable-sqlite-utf8 --enable-sysvsem --with-xmlrpc --enable-zip --without-pear --enable-shmop --enable-pcntl --with-libevent=shared --with-kerberos --enable-phar --enable-session --enable-simplexml --enable-snmp --enable-sqlite3 --enable-tidy --enable-tokenizer --enable-xml --enable-xmlreader --enable-xmlrpc --enable-xmlwriter --enable-xsl --enable-fastcgi --enable-cgi --enable-shared#make#make install

安装eAccelerator、Memcache、suhosin扩展:

1:memcache#/zh/php5/bin/phpize#./configure --with-php-config=/zh/php5/bin/php-config --enable-shared --enable-memcache#make && make install2:eaccelerator#/zh/php5/bin/phpize#./configure --with-php-config=/zh/php5/bin/php-config --enable-shared --enable-eaccelerator --with-gnu-ld#make && make install3:suhosin#/zh/php5/bin/phpize#./configure --with-php-config=/zh/php5/bin/php-config --enable-shared --enable-suhosin#make && make install

添加至php.ini

5:Apache(suexec+mod_fcgid)安装

http://blog.37hi.com/archives/229/

http://blog.37hi.com/archives/221/

6:为Apache安装mod_rpaf模块获取真实IP

tar -xf mod_rpaf-0.6.tar.gzcd mod_rpaf-0.6/usr/local/apache2/bin/apxs -i -c -n mod_rpaf-2.0.so mod_rpaf-2.0.c

编辑httpd.conf文件添加:

#rpaf_moduleLoadModule rpaf_module modules/mod_rpaf-2.0.so#Mod_rpaf settingsRPAFenable OnRPAFproxy_ips 127.0.0.1 [your_ips]RPAFsethostname OnRPAFheader X-Forwarded-For#rpaf_module end

[your_ips]请修改为你本机所监听web服务的ip.多个IP用空格空开.

7:pureftpd安装。

8:简单优化

9:编写web控制端。

./configure --prefix=/zh/pureftpd --with-minimal -with-sysquotas --with-altlog --with-puredb --with-ratios --with-throttling --with-ftpwho --with-welcomemsg --with-virtualhosts --with-diraliases --with-peruserlimits --with-language=simplified-chinese --with-mysql --with-tls --with-rfc2640 --enable-shared

错误:configure: error: Your MySQL client libraries aren't properly installed
解决办法:yum install mysql-devel

September 17, 2010
./configure --prefix=/zh/pureftpd --with-minimal -with-sysquotas --with-altlog --with-puredb --with-ratios --with-throttling --with-ftpwho --with-welcomemsg --with-virtualhosts --with-diraliases --with-peruserlimits --with-language=simplified-chinese --with-mysql --with-tls --with-rfc2640 --enable-shared

错误:configure: error: Your MySQL client libraries aren't properly installed
解决办法:yum install mysql-devel

November 20, 2009

干了个通宵,一边玩一边把配置文件翻译完了,翻得不好的地方还请各位多多提点,少许不是很明白的地方就留在那了。

鼓励转贴,分发,为所有看到E文头痛的兄弟们帮点小忙,PureFTPd的文档本来就不多,中文的更少了。从配置文件中就能看出不少PureFTPd的好功能来了。

来CU很久了,收获很多,这篇小文算是对CU的一点点小贡献。

############################################################
#                                                          #
#         Configuration file for pure-ftpd wrappers        #
#                                                          #
############################################################

# 如果你想要使用配置文件代替命令行选项来运行 Pure-FTPd ,请运行下面的命令:
#
# /usr/local/pureftpd/sbin/pure-config.pl /usr/local/pureftpd/etc/pure-ftpd.conf
#
# RPM 缺省使用另外一个配置文件:
# /etc/sysconfig/pure-ftpd
#
# 请不要忘了浏览一下 http://www.pureftpd.org/documentation.html 的
# 文档,查看全部的选项列表。

# 限制所有用户在其主目录中

  ChrootEveryone              yes

# 如果前一个指令被设置为了 "no",下面组的成员(GID)就不受主目录的限制了。而其他的用户还是
# 会被限制在自己的主目录里。如果你不想把任何用户限制在自己的主目录里,只要注释掉 ChrootEveryone
# 和 TrustedGID 就可以了。

# TrustedGID                    100

# 兼容ie等比较非正规化的ftp客户端

  BrokenClientsCompatibility  no

# 服务器总共允许同时连接的最大用户数

  MaxClientsNumber            50

# 做为守护(doemon)进程运行(Fork in background)

  Daemonize                   yes

# 同一IP允许同时连接的用户数(Maximum number of sim clients with the same IP address)

  MaxClientsPerIP             8

# 如果你要记录所有的客户命令,设置这个指令为 "yes"。
# This directive can be duplicated to also log server responses.

  VerboseLog                  no

# 即使客户端没有发送 '-a' 选项也列出隐藏文件( dot-files )。

  DisplayDotFiles             yes

# 不允许认证用户 - 仅作为一个公共的匿名FTP。

  AnonymousOnly               no

# 不允许匿名连接,仅允许认证用户使用。

  NoAnonymous                 no

# Syslog facility (auth, authpriv, daemon, ftp, security, user, local*)
# 缺省的功能( facility )是 "ftp"。 "none" 将禁止日志。

  SyslogFacility              ftp

# 定制用户登陆后的显示信息(Display fortune cookies)

# FortunesFile              /usr/share/fortune/zippy

# 在日志文件中不解析主机名。日志没那么详细的话,就使用更少的带宽。在一个访问量很大 
# 的站点中,设置这个指令为 "yes" ,如果你没有一个能工作的DNS的话。

  DontResolve                 yes

# 客户端允许的最大的空闲时间(分钟,缺省15分钟)

  MaxIdleTime                 15

# LDAP 配置文件 (参考 README.LDAP)

# LDAPConfigFile                /etc/pureftpd-ldap.conf

# MySQL 配置文件 (参考 README.MySQL)

# MySQLConfigFile               /etc/pureftpd-mysql.conf

# Postgres 配置文件 (参考 README.PGSQL)

# PGSQLConfigFile               /etc/pureftpd-pgsql.conf

# PureDB 用户数据库 (参考 README.Virtual-Users)

# PureDB                        /etc/pureftpd.pdb

# pure-authd 的socket 路径(参考 README.Authentication-Modules)

# ExtAuth                       /var/run/ftpd.sock

# 如果你要启用 PAM 认证方式, 去掉下面行的注释。

# PAMAuthentication             yes

# 如果你要启用 简单的 Unix系统 认证方式(/etc/passwd), 去掉下面行的注释。

# UnixAuthentication            yes

# 请注意,LDAPConfigFile, MySQLConfigFile, PAMAuthentication 和
# UnixAuthentication 这些指令只能被使用一次,不过,他们能被混合在一起用。例如:如果你使用了
# MySQLConfigFile 和 UnixAuthentication,那么 SQL 服务器将被访问。如果因为用户名未找
# 到而使 SQL 认证失败的话,就会在/etc/passwd 和 /etc/shadow 中尝试另外一种认证,如果因
# 为密码错误而使 SQL 认证失败的话,认证就会在此结束了。认证方式由它们被给出来的顺序而被链
# 接了起来。