• 欢迎访问Ppabc博客网站,专注于Linux、CentOS、Apache、Nginx、MySQL、PHP等开源工具安装优化的技术博客,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站,欢迎加入Ppabc博客
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏Ppabc博客吧

手工在FREEBSD 7.0 上安装apache+mysql+php+ZendOptimize+pureftp+managerPureFD

baidu空间 admin 11年前 (2008-03-13) 178次浏览

手工在 FB7 上安装 apache+mysql+php+ZendOptimize+pureftp+managerPureFD
这个方法可以借鉴下

#转载请注明来源 http://www.freebsdchina.org/forum/posting.php?mode=editpost&p=213242
#为方便初学者,命令直接在 WinSCP3/PuTTY 拷贝。
#手工在 FB7 上安装
#apache2.2.8
#http://apache.mirror.phpchina.com/httpd/httpd-2.2.8.tar.gz
#+mysqlmysql-5.0.45
#ftp://ftp.freebsdchina.org/pub/FreeBSD/distfiles/mysql-5.0.45.tar.gz
#+php-5.2.5
#http://cn2.php.net/distributions/php-5.2.5.tar.gz
#+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
#http://machiel.generaal.net/files/pureftpd/ftp_v2.1.tar.gz
#一、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]http://machiel.generaal.net[/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,访问
http://192.168.1.4/ftp/install.php
进行安装设置,设置完之后请删除 install.php
再访问http://192.168.1.4/ftp/index.php进行 FTP 用户管理。

]]>


Selinux 中国 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:手工在 FREEBSD 7.0 上安装 apache+mysql+php+ZendOptimize+pureftp+managerPureFD
喜欢 (0)