FreeBSD 6.1 Apache-2.0.5.9+PHP-5.2.0+MySQL-5.0.27 安裝手记
作者: chill 日期: 2006-12-22 22:32
因为服务器要迁移到FreeBSD环境,所以最近调试FreeBSD下APM的运行环境,这个一个被很多人记录过的过程,所以你随处的都可以找到这样的资料,但是我还是决定把它记录下来,因为这里要加入我的配置喜好!
首先安装cvsup更新ports tree
pkg_add -r cvsup-without-gui
cvsup -g -L 2 /usr/share/examples/cvsup/ports-supfile 这里记得把默认的cvs地址改一下
然后你可以按照下面的顺序安裝
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
perl 5.8.8
cd /usr/ports/lang/perl5.8
make WITHOUT_PERL_64BITINT=yes\
? ENABLE_SUIDPERL=yes\
? WITH_GDBM=yes\
? WITH_THREADS=yes\
? && make install clean
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
mysql-5.0.27
ports里面的可选编译参数
WITH_XCHARSET=list Define other built-in charsets (may be 'all').
WITH_COLLATION=collate Define default collation (latin1_swedish_ci).
WITH_OPENSSL=yes Enable secure connections.
WITH_LINUXTHREADS=yes Use the linuxthreads pthread library.
WITH_PROC_SCOPE_PTH=yes Use process scope threads
(try it if you use libpthread).
BUILD_OPTIMIZED=yes Enable compiler optimizations
(use it if you need speed).
BUILD_STATIC=yes Build a static version of mysqld.
(use it if you need even more speed).
WITHOUT_INNODB=yes Disable support for InnoDB table handler.
WITH_ARCHIVE=yes Enable support for Archive Storage Engine.
WITH_CSV=yes Enable support for CSV Storage Engine.
WITH_FEDERATED=yes Enable support for Federated Storage Engine.
WITH_NDB=yes Enable support for NDB Cluster.
为了使用libthr.so线程库,请勿选择BUILD_STATIC=yes和WITH_LINUXTHREADS=yes
---------------------------------------------------------------------
cd /usr/ports/databases/mysql50-server/
make WITH_CHARSET=utf8 \ \\如果要安装vhcs请不要选这
WITH_COLLATION=utf8_general_ci \ \\2项,否则中文语言包会失效
WITH_XCHARSET=all \
BUILD_OPTIMIZED=yes \
WITHOUT_INNODB=yes \
&& make install clean
---------------------------------------------------------------------
在/etc/rc.conf中mysql_enable="YES"
然后配置线程库为libthr.so:
---------------------------------------------------------------------
ee /etc/libmap.conf
加入
[mysqld]
libpthread.so.2 libthr.so.2
libpthread.so libthr.so
---------------------------------------------------------------------
看看效果
ldd /usr/local/libexec/mysqld
/usr/local/libexec/mysqld:
libz.so.3 => /lib/libz.so.3 (0x28388000)
libwrap.so.4 => /usr/lib/libwrap.so.4 (0x28398000)
libcrypt.so.3 => /lib/libcrypt.so.3 (0x2839f000)
libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x283b7000)
libm.so.4 => /lib/libm.so.4 (0x28481000)
libpthread.so.2 => /usr/lib/libthr.so.2 (0x28497000)
libc.so.6 => /lib/libc.so.6 (0x284a9000)
---------------------------------------------------------------------
/usr/local/etc/rc.d/mysql-server start //启动mysql
mysqladmin -uroot password yourpassword //初始化mysql口令,否则默认为“none”
mysqladmin –uroot –p password newpassword //以后修改root密码-
password:oldpassword //要用这样的形式
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
Apache 2.0.5.9
To disable a module category: WITHOUT_<CATEGORY>_MODULES
Per default categories are:
AUTH DAV MISC
Categories available:
AUTH DAV EXPERIMENTAL LDAP MISC PROXY SSL SUEXEC THREADS
To see all available knobs, type make show-options
To see all modules in different categories, type make show-categories
You can check your modules configuration by using make show-modules
安装
cd /usr/ports/www/apache20
make WITHOUT_IPV6=yes \ \\不安装IPV6
WITH_MPM=worker \ \\MPM用worker模式
WITH_SUEXEC=yes \ \\使用SUEXEC,如果要搭建VHCS,必须要这个
WITHOUT_PROXY=yes \ \\不使用 PROXY
WITH_THREADS=yes \ \\允许 threads 支持,谨慎使用哦
WITH_STATIC_SUPPORT=yes \
&& make install clean
---------------------------------------------------------------
最后装完了需要在/etc/rc.conf中apache2_enable="YES"
/usr/local/sbin/httpd -l
Compiled in modules:
core.c
worker.c
http_core.c
mod_so.c
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
PHP5.2.0
cd /usr/ports/lang/php5
&& make install clean
弹出选择项,这是我的选择
[X] CGI Build CGI version
[X] APACHE Build Apache module
[ ] DEBUG Enable debug
[X] SUHOSIN Enable Suhosin protection system
[X] MULTIBYTE Enable zend multibyte support
[ ] IPV6 Enable ipv6 support
[ ] MAILHEAD Enable mail header patch
[ ] REDIRECT Enable force-cgi-redirect support (CGI only)
[ ] DISCARD Enable discard-path support (CGI only)
[X] FASTCGI Enable fastcgi support (CGI only)
[X] PATHINFO Enable path-info-check support (CGI only)
ee /usr/local/etc/apache2/http.conf
add line 885
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
--------------------------------------------------------------------------
cp /usr/local/etc/php.ini-dist /usr/local/etc/php.ini
--------------------------------------------------------------------------
PHP5-extensions
cd /usr/ports/lang/php5-extensions
&& make install clean
根据自己的需求选择扩展
加入网摘
显示Tag关联文章
定制Apache索引样式 (网上摘录,很有用) (2009-04-21 22:54)
FreeBSD 下ISO制作工具 mkisofs (2006-12-29 17:10)
FreeBSD Find的介紹 (2006-12-28 23:42)
FreeBSD 6.1 下 VHCS2 安装手记 (2006-12-23 21:54)
linux/unix服务器系统优化入门 (转) (2006-09-27 22:47)
PHP服务器性能最优化配置 (2006-09-04 22:43)
FreeBSD系统优化部分内核参数调整中文注释 (2006-09-04 22:39)
订阅
上一篇
返回
下一篇

