————————————————————-
#转载请注明来源 http://www.freebsdchina.org/forum/posting.php?mode=editpost&p=213433
#为方便初学者,命令直接在WinSCP3/PuTTY拷贝。
Ports安装过程,那将是很漫长的一个过程,如果原来安装中没有加入ports,那么就运行 sysinstall选择 Configure,Distributions,ports,这个过程可以在网络上搜索,不赘叙。
以下过程假定已经安装了ports开始。cn.freebsd.org有点不正常,所以我们先写一下make.conf,ports-supfile,OK,开始吧。
————————————————————-*/
ee /etc/make.conf
#加入以下内容
代码:
SUPHOST=ftp.freebsdchina.org
SUPFILE= /usr/share/examples/cvsup/stable-supfile
PORTSSUPFILE= /root/ports-supfile
DOCSUPFILE= /usr/share/examples/cvsup/doc-supfile
MASTER_SITE_BACKUP?=\
ftp://ftp.tw.freebsd.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}/\
ftp://ftp.tw.freebsd.org/pub/distfiles/${DIST_SUBDIR}/\
ftp://ftp.kr.freebsd.org/pub/distfiles/${DIST_SUBDIR}/\
ftp://ftp.cn.freebsd.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}/
cp /usr/share/examples/cvsup/ports-supfile /etc
ee /etc/ports-supfile
代码:
#修改*default host=CHANGE_THIS.FreeBSD.org改为
*default host=cvsup2.cn.freebsd.org
#修改为 *default host=cvsup.tw.freebsd.org也可以
cd /usr/ports/net/cvsup-without-gui/
make install clean
source ~/.cshrc
/usr/local/bin/cvsup -g -L 2 /etc/portd s-supfile
#接着我们先安装mysql吧。
cd /usr/ports/databases/mysql50-server
make WITH_CHARSET=gbk install clean
#接着安装Apache2
cd /usr/ports/www/apache20
make install clean
#接着安装php5
cd /usr/ports/lang/php5
make config
代码:
#看情况选择你要的东西,我一般只选
[X] APACHE Build Apache module
[X] MULTIBYTE Enable zend multibyte support
make install clean
#安装GD,比如你Web服务器要支持常见BBS验证码,或者PHP程序要绘统计图等等需求。
cd /usr/ports/graphics/php5-gd
make config
代码:
#默认是选择了这两项,OK退出。
[X] T1LIB Include T1lib support
[X] TRUETYPE Enable TrueType string function
make install clean
#安装php5-extensions
cd /usr/ports/lang/php5-extensions
make config
代码:
#我选择了这些,你看你的需要增加了
[X] BZ2 bzip2 library support
[X] CALENDAR calendar conversion support
[X] CTYPE ctype functions
[X] DOM DOM support
[X] FILTER input filter support
[X] GD GD library support
[X] GETTEXT gettext library support
[X] HASHHASH Message Digest Framework
[X] ICONV iconv support
[X] JSONJavaScript Object Serialization support
[X] MYSQL MySQL database support
[X] PCREPerl Compatible Regular Expression support
[X] PDO PHP Data Objects Interface (PDO)
[X] PDO_SQLITE PDO sqlite driver
[X] POSIX POSIX-like functions
[X] SESSION session support
[X] SIMPLEXML simplexml support
[X] SPL Standard PHP Library
[X] SQLITE sqlite support
[X] TIDYTIDY support
[X] TOKENIZER tokenizer support
[X] XML XML support
[X] XMLREADER XMLReader support
[X] XMLWRITER XMLWriter support
[X] YAZ YAZ support (/NISO Z39.50)
[X] ZIP ZIP support
[X] ZLIBZLIB support
make install clean
cp /usr/local/etc/php.ini-dist /usr/local/etc/php.ini
cd /usr/ports/devel/ZendOptimizer
make install clean
意外 写到:
/*这样安装之后,phpinfo()显示了
This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
而不是:
This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies
with Zend Optimizer v3.3.0, Copyright (c) 1998-2007, by Zend Technologies
安装结束之后还得修改一下php.ini
*/
ee /usr/local/etc/php.ini
代码:
#加入
[Zend]
zend_optimizer.optimization_level=15
zend_extension_manager.optimizer=”/usr/local/lib/php/20060613/Optimizer”
zend_extension_manager.optimizer_ts=”/usr/local/lib/php/20060613/Optimizer_TS”
zend_extension=”/usr/local/lib/php/20060613/ZendExtensionManager.so”
zend_extension_ts=”/usr/local/lib/php/20060613/ZendExtensionManager_TS.so”
#接下来我们来安装pure-ftpd
cd /usr/ports/ftp/pure-ftpd
make config
代码:
#选择如下项
[X] MYSQLSupport for users in MySQL database
[X] PRIVSEP Enable privilege separation
[X] PERUSERLIMITS Per-user concurrency limits
[X] THROTTLINGBandwidth throttling
[X] BANNER Show pure-ftpd welcome upon session start
make install clean
ee /etc/rc.conf
#把安装的Mysql/Apache/Pure-ftpd加入系统启动项
代码:
mysql_enable=”YES”
apache2_enable=”YES”
pureftpd_enable=”YES”
#编辑 httpd.conf
ee /usr/local/etc/apache2/httpd.conf
代码:
#加入
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
cd /usr/local/etc
cp pure-ftpd.conf.sample pure-ftpd.conf
cp pureftpd-mysql.conf.sample pureftpd-mysql.conf
sh /etc/rc
#设置mysqld的root密码,新安装的mysql中root是没密码的,下面的’mypasswd’修改成你要的密码。
/usr/local/bin/mysqladmin -u root password mypasswd
#接下来我们要安装’User manager for PureFTPd’,论坛不能贴图,我就简要说一下过程,这本来也是个简单的过程。
cd /usr/local/www/data
fetch “http://machiel.generaal.net/files/pureftpd/ftp_v2.1.tar.gz”
tar -xzvf ftp_v2.1.tar.gz
mv ftp_v2.1.tar.gz /usr/ports/distfiles #把它保存起来。
cd ftp
chown www config.php
/usr/local/bin/mysql -u root -p
#输入你在以上执行mysqladmin中设置的root密码
#设置一个mysql用户给装’User manager for PureFTPd’程序管理用户用。
引用:
mysql>INSERT INTO mysql.user (Host, User, Password, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv, File_priv, Grant_priv, References_priv, Index_priv, Alter_priv) VALUES(‘127.0.0.1′,’ftp’,PASSWORD(‘tmppasswd’),’Y’,’Y’,’Y’,’Y’,’N’,’N’,’N’,’N’,’N’,’N’,’N’,’N’,’N’,’N’);
mysql>flush privileges;
mysql>exit;
#以上追加的用户名为 ftp ,密码为 tmppasswd
#现在打开IE,(假定FB服务器的IP为 192.168.1.4)输入 http://192.168.1.4/ftp/install.php;按提示输入数据库管理用户/密码(户名为 ftp ,密码为 tmppasswd),在step 6时,生成 pureftpd-mysql.conf的配置,你COPY下来。
ee /usr/local/etc/pureftpd-mysql.conf
#粘贴STEP6生成的内容。
在install的最后设置一下Administrator的密码,这是你以后通过web管理ftp用户时的后台管理密码。
修改后的 pureftpd-mysql.conf, pure-ftpd.conf可以参考
手工在FB7上安装apache+mysql+php+ZendOptimize+pureftp+managerPureFD