Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1476404
  • 博文数量: 295
  • 博客积分: 10051
  • 博客等级: 上将
  • 技术积分: 3850
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-11 08:50
文章分类

全部博文(295)

文章存档

2011年(1)

2009年(4)

2008年(290)

我的朋友

分类: BSD

2008-04-21 11:35:52

#为方便初学者,命令直接在WinSCP3/PuTTY拷贝。
#手工在FB7上安装
#apache2.2.8
#
#+mysqlmysql-5.0.45
#ftp://ftp.freebsdchina.org/pub/FreeBSD/distfiles/mysql-5.0.45.tar.gz
#+php-5.2.5
#
#+ZendOptimize3.3.0a
#ftp://ftp.freebsdchina.org/pub/FreeBSD/distfiles/ZendOptimizer-3.3.0a-freebsd6.0-i386.tar.gz
#+pure-ftpd-1.0.21
#ftp://ftp.freebsdchina.org/pub/FreeBSD/distfiles/pure-ftpd-1.0.21.tar.gz
#+manager_PureFTPd_v2.1
#
#一、mini安装FB7,并选上mysql-client-5.0.45_1 ;perl5;linux_base-fc-4_10;安装时添加wheel组用户admin;并在inetd里打开sshd启动。
#二、下载
#pache2.2.8+mysqlmysql-5.0.45+php-5.2.5+ZendOptimize3.3.0a+pure-ftpd-1.0.21+manager_PureFTPd_v2.1包
#放到 /home/admin/doc目录上
#三、安装
#admin登陆
*/

cd ~
cd doc
tar -zxvf mysql-5.0.45.tar.gz
tar -xzvf httpd-2.2.8.tar.gz
tar -xzvf php-5.2.5.tar.gz
tar -xzvf ZendOptimizer-3.3.0a-freebsd6.0-i386.tar.gz
tar -xzvf pure-ftpd-1.0.21.tar.bz2
tar -xzvf manager_PureFTPd_v2.1.tar.gz

pw groupadd mysql
pw useradd mysql -g mysql -s /sbin/nologin

cd /usr/home/admin/mysql-5.0.45
./configure --prefix=/usr/local/mysql --with-charset=gbk
make
make install
cp support-files/my-medium.cnf /etc/my.cnf
cd /usr/local/mysql
cp share/mysql/mysql.server /usr/local/etc/rc.d/mysql.server.sh
bin/mysql_install_db --user=mysql
chown -R root .
chown -R mysql var
chgrp -R mysql .
bin/mysqld_safe --user=mysql &
bin/mysql -uroot
use mysql
update user set password=old_password('mysqldpassword');
exit;
/usr/local/etc/rc.d/mysql.server.sh restart

cd /usr/home/admin/doc/httpd-2.2.8
./configure --enable-so
make install

cd /usr/home/admin/doc/php-5.2.5
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql
make install
cp php.ini-dist /usr/local/lib/php.ini

ee /usr/local/apache2/conf/httpd.conf
#并加入
代码:

AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps

cd /lib
ln -s /lib/libm.so.5 /lib/libm.so.4
ln -s /lib/libutil.so.7 /lib/libutil.so.5
ln -s /lib/libcrypt.so.4 /lib/libcrypt.so.3
ln -s /lib/libc.so.7 /lib/libc.so.6
cd /usr/home/admin/doc/ZendOptimizer-3.3.0a-freebsd6.0-i386
./install-tty

kldload accf_http
ee /boot/defaults/loader.conf
#并将以下两行加入到loader.conf中,以便下次启动自动装载模块
代码:

accf_data_load="YES"
accf_http_load="YES"


ee /etc/rc.local
#并加入
代码:

/usr/local/apache2/bin/apachectl start
/usr/local/sbin/pure-config.pl /usr/local/etc/pure-ftpd.conf

#安装pureftpd
pw groupadd ftpusers -g 2002
pw useradd ftp -g ftpusers -u 2002 -s /sbin/nologin
cd /usr/home/admin/doc/pure-ftpd-1.0.21
./configure --with-mysql=/usr/local/mysql --with-paranoidmsg --with-shadow --with-welcomemsg --with-uploadscript --with-quotas --with-cookie --with-pam --with-virtualhosts --with-virtualroot --with-diraliases --with-sysquotas --with-ratios --with-ftpwho --with-throttling --with-language=simplified-chinese
make
make check
make install
cp pureftpd-mysql.conf /usr/local/etc
cd configuration-file
cp pure-config.pl /usr/local/sbin
cp pure-ftpd.conf /usr/local/etc
cd /usr/local/etc
#编辑你的pure-ftpd.conf和pureftpd-mysql.conf
#我的pure-ftpd.conf配置文件如下
代码:

############################################################################
#                                                                          #
# PureFTPd  configuration file.                                       #
############################################################################

ChrootEveryone yes
BrokenClientsCompatibility no
MaxClientsNumber 50
Daemonize yes
MaxClientsPerIP 8
VerboseLog no
DisplayDotFiles yes
AnonymousOnly no
NoAnonymous yes
SyslogFacility ftp
DontResolve yes
MaxIdleTime 15
MySQLConfigFile /usr/local/etc/pureftpd-mysql.conf
LimitRecursion 2000 8
AnonymousCanCreateDirs no
MaxLoad 4
PassivePortRange 30000 50000
AntiWarez yes
Bind 192.168.1.4,21
Umask 133:022
MinUID 100
AllowUserFXP yes
AllowAnonymousFXP no
ProhibitDotFilesWrite no
ProhibitDotFilesRead no
AutoRename no
AnonymousCantUpload no
CreateHomeDir yes
MaxDiskUsage 99
CustomerProof yes


代码:

############################################################################
#                                                                          #
# PureFTPd MySQL configuration file.                                       #
# Generated by the installation wizard for the 'User manager for PureFTPd' #
# See [url][/url] for more info                 #
# or read the README.MySQL for explanations of the syntax.                 #
#                                                                          #
############################################################################
# Optional : MySQL server name or IP. Don't define this for unix sockets.
MYSQLServer     127.0.0.1
# Optional : MySQL port. Don't define this if a local unix socket is used.
# MYSQLPort       3306
# Optional : define the location of mysql.sock if the server runs on this host.
MYSQLSocket     /tmp/mysql.sock
# Mandatory : user to bind the server as.
MYSQLUser      root
# Mandatory : user password. You must have a password.
MYSQLPassword   mysqldpassword
# Mandatory : database to open.
MYSQLDatabase  ftpusers
# Mandatory : how passwords are stored
# Valid values are : "cleartext", "crypt", "md5" and "password"
# ("password" = MySQL password() function)
# You can also use "any" to try "crypt", "md5" *and* "password"
MYSQLCrypt      md5
# In the following directives, parts of the strings are replaced at
# run-time before performing queries :
#
# \L is replaced by the login of the user trying to authenticate.
# \I is replaced by the IP address the user connected to.
# \P is replaced by the port number the user connected to.
# \R is replaced by the IP address the user connected from.
# \D is replaced by the remote IP address, as a long decimal number.
#
# Very complex queries can be performed using these substitution strings,
# especially for virtual hosting.
# Query to execute in order to fetch the password
MYSQLGetPW      SELECT Password FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R")
# Query to execute in order to fetch the system user name or uid
MYSQLGetUID     SELECT Uid FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R")
# Optional : default UID - if set this overrides MYSQLGetUID
#MYSQLDefaultUID 1000
# Query to execute in order to fetch the system user group or gid
MYSQLGetGID     SELECT Gid FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R")
# Optional : default GID - if set this overrides MYSQLGetGID
#MYSQLDefaultGID 1000
# Query to execute in order to fetch the home directory
MYSQLGetDir     SELECT Dir FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R")
# Optional : query to get the maximal number of files
# Pure-FTPd must have been compiled with virtual quotas support.
MySQLGetQTAFS  SELECT QuotaFiles FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R")
# Optional : query to get the maximal disk usage (virtual quotas)
# The number should be in Megabytes.
# Pure-FTPd must have been compiled with virtual quotas support.
MySQLGetQTASZ  SELECT QuotaSize FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R")
# Optional : ratios. The server has to be compiled with ratio support.
MySQLGetRatioUL SELECT ULRatio FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R")
MySQLGetRatioDL SELECT DLRatio FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R")
# Optional : bandwidth throttling.
# The server has to be compiled with throttling support.
# Values are in KB/s .
MySQLGetBandwidthUL SELECT ULBandwidth FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R")
MySQLGetBandwidthDL SELECT DLBandwidth FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R")
# Enable ~ expansion. NEVER ENABLE THIS BLINDLY UNLESS :
# 1) You know what you are doing.
# 2) Real and virtual users match.
# MySQLForceTildeExpansion 1
# If you upgraded your tables to transactionnal tables (Gemini,
# BerkeleyDB, Innobase...), you can enable SQL transactions to
# avoid races. Leave this commented if you are using the
# traditionnal MyIsam databases or old (< 3.23.x) MySQL versions.
# MySQLTransactions On

#启动pureftpd
cd /usr/local/sbin
chmod u+x pure-config.pl
./pure-config.pl /usr/local/etc/pure-ftpd.conf

#安装PureFTPD-Manager
cd /usr/home/admin/doc/
cp -R ftp /usr/local/apache2/htdocs
cd /usr/local/apache2/htdocs/ftp
chown www config.php

好了,以上假定HTTPD的IP是192.168.1.4,MysqlD的密码是mysqldpassword你自己安装过程中,可以做修改,现在打开IE,访问

进行安装设置,设置完之后请删除 install.php
再访问进行FTP用户管理。




/*--------------------以下再说明一下以ports安装的过程-------------------------------*/



Ports安装Apache+mysql+php+ZendOptimize+pureftp+managerPureFD

//内网使用就用手工安装算了,安装个系统等它半天,晕都晕死。
论坛不能贴图不方便啊.
阅读(1140) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~