[步步为营]强力构建我的FreeBSD8-阿里云开发者社区

开发者社区> 数据库> 正文
登录阅读全文

[步步为营]强力构建我的FreeBSD8

简介:

本文最初位于:http://tieba.baidu.com/p/770529005在27楼有本博客地址的声明。

##1.最小化安装我的FreeBSD8
1.1 Country Selection[选择国家,肯定是中国]
小技巧:先按下Home键,然后PageDown三次就到了,我国的数字为45.

1.2 System Console Keymap[系统键盘配置]
默认的是USA ISO标准,就是我们国家的使用标准.此处直接回车即可.

1.3 sysinstall Main Menu[系统安装主菜单]--这是个很重要的界面!!
选择Custom[自定义]安装选项,回车.

1.4 Choose Custom Installation Options[选择自定义安装选项]
选择Partition[分区]选项,回车.

1.5 FDISK Partition Editor[FDISK分区编辑器]--此字符出现在屏幕的右上角
按下A选项,使用全部磁盘空间,再按下Q键完成分区操作.

1.6 Install Boot Manager for drive ad0?[为磁盘ad0安装哪种启动管理器呢?]
使用默认的Standard[标准]选项,回车.

1.7 Choose Custom Installation Options[选择自定义安装选项]--第二次到此
此时应该选择4 Label[标签],在1.4操作中指定的区域,细化分区.
小技巧:按下数字键4即可选择第4个选项,那么按下X呢?[可不要按哦!]

1.8 FreeBSD FDISK Disklabel Editor[FreeBSD FDISK 磁盘标签]
按下A选项,使用全部磁盘空间,再按下Q键完成分区操作.

1.9 Choose Custom Installation Options[选择自定义安装选项]--第三次到此
[此步不操作]按下5,选择Distributions[分配],此步是定制你的软件,我是需要最小化安装我的FreeBSD的.

1.10 Choose Distributions[选择软件包]
[若1.9操作则1.10才有,此处略]

1.11 Choose Custom Installation Options[选择自定义安装选项]--第四次到此
选择6 Media[媒介],选择安装的途径.

1.12 Choose Insatllation Media[选择安装媒介]
1 CD/DVD是最常用的了,我选择的就是这个.

1.13 Choose Custom Installation Options[选择自定义安装选项]--第五次到此
7 Commit[提交],如果你肯定以前的操作没有问题才能选择7,否则要三思.

1.14 Choose Distributions[选择软件包]
由于你前面没有选择安装任何的软件,所以这里再给你一次选择的机会,可惜我不需要珍惜,呵呵.直接按下OK.

1.15 User Confirmation Requested[要求用户确定]
这是以前所有设置生效前的最后一步,也就是说如果你选择Yes,那么将会开始安装[最小化].别害怕,选择Yes.

1.16 接下来的操作都是由系统自动完成有:格式化分区,复制文件到磁盘.

##2.安装完成后的初始设置[重启前]
2.1 User Confirmation Requested[请求用户确认]
选择Yes会有很多的设置要完成,比如IP地址设置,用户和组,Root密码等.
我选择No

2.2 Choose Custom Installation Options[选择自定义安装选项]--第六次到此
!!![此次选择Cancel],一定要知道安装已经结束了.

2.3 sysinstall Main Menu[系统安装主菜单]--第二次到此
为了让读此教程的你能更明白,这里我没有断续配置,而是选择了X Exit Install[退出].

2.4 reboot[重启啦]
系统会提醒你退出你的光盘

##3.安装完成后的初始设置[重启后]
3.1 进入系统
不怕不怕root没有密码,进入时login:后输入root,回车即可.

3.2 sysinstall[相当于windows系统的控制面板很强大]
在终端输入如下命令:
# sysinstall

3.2.1 设置Root[超级用户密码]
选择Configure-->Root Password-->[连续输入再次相同的密码]

3.2.2 设置IP地址[我的是DHCP]
选择Configure-->Networking-->Interfaces-->em0[因网卡而易]-->问是否开启IPv6[N]-->DHCP[Y]-->Network Configuration[Host:填写主机名称(必填).Domain:填写域的名称可以自定义也可用默认值],OK

3.2.3 ssh的开启[方便远程管理]
选择Configure-->Networking-->sshd
[su:sorry]的解决办法:
可以使用如下命令给普通用户su -root的权力:
# pw groupmod wheel -m <username>
# pw user mod <username> -g wheel
解释下:当SSH服务开启后,由于没有进行任何的配置,只能使用普通用户登录,可是在FreeBSD系统中普通用户是没有权限通过su命令向root用户切换.只是可以指定普通用户具有权限,如上配置就是此意.
      若是想要一劳永逸则可以参照如下设置:直接修改/etc/group文件,把相应的用户加到wheel组就可以.
如:添加前:wheel:*:0:root
添加后:wheel:*:0:root,zheng

3.2.4 设置时区[中国人要用中国的时间]
选择Configure-->Time Zone-->NO-->5 Asia-->9 China-->1 east China...-->Yes

3.2.5 添加新用户[我以添加一个名为admin的用户为例]
FreeBSD# adduser
Username: admin
Full name: administrator
Uid (Leave empty for default): 
Login group [admin]: 
Login group is admin. Invite admin into other groups? []: 
Login class [default]: 
Shell (sh csh tcsh nologin) [sh]: 
Home directory [/home/admin]: 
Home directory permissions (Leave empty for default): 
Use password-based authentication? [yes]: 
Use an empty password? (yes/no) [no]: 
Use a random password? (yes/no) [no]: 
Enter password: 
Enter password again: 
Lock out the account after creation? [no]: 
Username   : admin
Password   : *****
Full Name  : administrator
Uid        : 1003
Class      : 
Groups     : admin 
Home       : /home/admin
Home Mode  : 
Shell      : /bin/sh
Locked     : no
OK? (yes/no): yes

## 4.部署更新[cvsup and ports]
4.1 安装cvsup-without-gui
FreeBSD# pkg_add -r cvsup-without-gui ; rehash
//要是没cvsup-withou-gui就不能更新ports

4.2 更新ports
修改以下文件的CHANGE_THIS.FREEBSD.ORG为cvsup.freebsdchina.org(位于第49行,stable-supfile是66行)
/usr/share/examples/cvsup/ports-supfile
/usr/share/examples/cvsup/www-supfile
/usr/share/examples/cvsup/stable-supfile

4.3重启后更新系统
cvsup -g -L 2 /usr/share/examples/cvsup/ports-supfile
cvsup -g -L 2 /usr/share/examples/cvsup/www-supfile
cvsup -g -L 2 /usr/share/examples/cvsup/stable-supfile
****************************************本部分声明作废***************************
* FreeBSD# cd /usr/share/examples/cvsup
* FreeBSD# ee ports-supfile
* //把  
* *default host=CHANGE_THIS.FreeBSD.org
* //改为:  
* *default host=cvsup1.freebsd.org 

*   # cvsup -g -L 2 -h cvsup1.freebsd.org /usr/share/examples/cvsup/standard-supfile ; rehash
*     # cvsup -g -L 2 -h cvsup1.freebsd.org /usr/share/examples/cvsup/ports-supfile ; rehash
**********************************************************************************
## 5.安装网络服务器所需软件
5.1 软件列表
[已经安装]System:
FreeBSD FreeBSD.shenzhi.com 8.0-RELEASE FreeBSD 8.0-RELEASE #0: Sat Nov 21 15:48:17 UTC 2009     root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386

Apache Version:  
httpd-2.2.15.tar.bz2 

mysql Version:  
mysql-5.1.46.tar.gz

PHP Version:
php5 5.3.2


Zend Version:  
ZendOptimizer-3.3.0.a[能安装,不能用的]

5.2 安装mysql-5.1.46.tar.gz
5.2.1 安装
FreeBSD# cd /usr/ports/databases/mysql51-server
FreeBSD# make WITH_CHARSET=utf8 WITH_XCHARSET=all WITH_PROC_SCOPE_PTH=yes BUILD_OPTIMIZED=yes BUILD_STATIC=yes SKIP_DNS_CHECK=yes WITHOUT_INNODB=yes install clean
make安装时候的参数:
WITH_XCHARSET=all 不加这个的话会不支持GBK编码
BUILD_OPTIMIZED=yes
BUILD_STATIC=yes 这2项都是起到优化作用,都加上的好

5.2.2 配置MySQL

5.2.2.1 让mysql开机自启动
首先在/etc/rc.conf加入mysql_enable=”yes”
FreeBSD# echo 'mysql_enable="yes"'>>/etc/rc.conf

5.2.2.2 根据你的机器配置选择一个作为/etc/my.cnf
mysql默认读取/etc目录下面的my.cnf,但是安装过程不会自动在这目录下创建本文件,默认这个文件在/usr/local/share /mysql目录下面,有3个版本:
my-large.cnf 一般高配置服务器或者mysql专用服务器用这个配置文件
my-medium.cnf 服务器配置并跑有其它应用时用这个配置文件
my-small.cnf 服务器资源紧张的就用这个好了

FreeBSD# cp /usr/local/share/mysql/my-large.cnf /etc/my.cnf

5.2.2.3 手动创建数据库
安装过程并不会自动创建默认的数据库,需要手工创建
FreeBSD# /usr/local/bin/mysql_install_db  --user=mysql

启动mysql,好像第一次用脚本启动的话要使用
FreeBSD# /usr/local/etc/rc.d/mysql-server onestart

启动mysql服务:
FreeBSD# /usr/local/bin/mysqld_safe &

重启系统
FreeBSD# reboot

修改root密码,比如我们要修改成123456
FreeBSD# /usr/local/bin/mysqladmin -u root password '123456'
会提示你再次输入一次密码Enter password:,再输入一次123456即可

****************************************************************

并且需要更改数据库目录的权限,不然会启动不起来
# chown -R mysql:mysql /var/db/mysql
# chown -R root /var/db/mysql
# chgrp -R mysql /var/db/mysql
# chmod -R 777 /var/db/mysql


使用/usr/local/etc/rc.d/mysql-server start不行

================================================================================
经常会出现下面的错误,不要害怕哦.
/usr/local/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!
启动mysql服务:
/usr/local/bin/mysqld_safe &    //此命令执行后上述错误就会出现

 

5.3 安装Apache

5.3.1 安装
FreeBSD# cd /usr/ports/www/apache22
FreeBSD# make WITH_MPM=worker WITHOUT_IPV6=yes WITH_THREADS=yes WITHOUT_SSL=yes install clean
由于没有安装其他软件,所以在安装Apache软件时会附加安装一些其它软件,这是系统自动解决


5.3.2 配置Apache
5.3.2.1 设置Apache为开机启动.
echo 'apache22_enable="yes"'>>/etc/rc.conf

5.3.2.2 错误避免

FreeBSD# kldload accf_http
FreeBSD# echo 'accf_data_load="yes"'>>/boot/defaults/loader.conf
FreeBSD# echo 'accf_http_load="yes"'>>/boot/defaults/loader.conf
FreeBSD# echo 'accf_http_load="yes"'>>/boot/loader.conf

FreeBSD# /usr/local/etc/rc.d/apache22 start
Cannot 'start' apache22. Set apache22_enable to YES in /etc/rc.conf or use 'onestart' instead of 'start'.
错误信息告诉你,要将apache22_enable="yes"写入到文件/etc/rc.conf中去

再次运行还会出现如下错误:[提示不能解析到本机的域名,没关系的了.]
FreeBSD# /usr/local/etc/rc.d/apache22 start
httpd: Could not reliably determine the server's fully qualified domain name, using FreeBSD.shenzhi.com for ServerName
Syntax OK
Starting apache22.
成功!

5.4 安装php5 5.3.2
5.4.1 安装PHP5
5.4.1.1 install php5
FreeBSD# cd /usr/ports/lang/php5
FreeBSD# make install clean
     +--------------------------------------------------------------------+
     |                      Options for php5 5.3.2                        |
     | +----------------------------------------------------------------+ |
     | |        [X] CLI        Build CLI version                        | |
     | |        [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                 | |

5.4.1.2 install php5-extensions
FreeBSD# cd /usr/ports/lang/php5-extensions/
FreeBSD# make config
     +--------------------------------------------------------------------+
     |                 Options for php5-extensions 1.4                    |
     | +----------------------------------------------------------------+ |
     | |    [ ] BCMATH      bc style precision math functions           | |
     | |    [ ] BZ2         bzip2 library support                       | |
     | |    [ ] CALENDAR    calendar conversion support                 | |
     | |    [X] CTYPE       ctype functions                             | |
     | |    [ ] CURL        CURL support                                | |
     | |    [ ] DBA         dba support                                 | |
     | |    [X] DOM         DOM support                                 | |
     | |    [ ] EXIF        EXIF support                                | |
     | |    [ ] FILEINFO    fileinfo support                            | |
     | |    [X] FILTER      input filter support                        | |
     | |    [ ] FRIBIDI     FriBidi support                             | |
     | |    [X] FTP         FTP support                                 | |
     | |    [X] GD          GD library support                          | |
     | |    [ ] GETTEXT     gettext library support                     | |
     | |    [ ] GMP         GNU MP support                              | |
     | |    [X] HASH        HASH Message Digest Framework               | |
     | |    [X] ICONV       iconv support                               | |
     | |    [ ] IMAP        IMAP support                                | |
     | |    [ ] INTERBASE   Interbase 6 database support (Firebird)     | |
     | |    [X] JSON        JavaScript Object Serialization support     | |
     | |    [ ] LDAP        OpenLDAP support                            | |
     | |    [ ] MBSTRING    multibyte string support                    | |
     | |    [ ] MCRYPT      Encryption support                          | |
     | |    [ ] MSSQL       MS-SQL database support                     | |
     | |    [X] MYSQL       MySQL database support                      | |
     | |    [X] MYSQLI      MySQLi database support                     | |
     | |    [ ] ODBC        unixODBC support                            | |
     | |    [ ] OPENSSL     OpenSSL support                             | |
     | |    [ ] PCNTL       pcntl support (CLI only)                    | |
     | |    [ ] PDF         PDFlib support (implies GD)                 | |
     | |    [X] PDO         PHP Data Objects Interface (PDO)            | |
     | |    [X] PDO_SQLITE  PDO sqlite driver                           | |
     | |    [ ] PGSQL       PostgreSQL database support                 | |
     | |    [X] POSIX       POSIX-like functions                        | |
     | |    [ ] PSPELL      pspell support                              | |
     | |    [ ] READLINE    readline support (CLI only)                 | |
     | |    [ ] RECODE      recode support                              | |
     | |    [X] SESSION     session support                             | |
     | |    [ ] SHMOP       shmop support                               | |
     | |    [X] SIMPLEXML   simplexml support                           | |
     | |    [ ] SNMP        SNMP support                                | |
     | |    [ ] SOAP        SOAP support                                | |
     | |    [ ] SOCKETS     sockets support                             | |
     | |    [X] SQLITE      sqlite support                              | |
     | |    [ ] SYBASE_CT   Sybase database support                     | |
     | |    [ ] SYSVMSG     System V message support                    | |
     | |    [ ] SYSVSEM     System V semaphore support                  | |
     | |    [ ] SYSVSHM     System V shared memory support              | |
     | |    [ ] TIDY        TIDY support                                | |
     | |    [X] TOKENIZER   tokenizer support                           | |
     | |    [ ] WDDX        WDDX support (implies XML)                  | |
     | |    [X] XML         XML support                                 | |
     | |    [X] XMLREADER   XMLReader support                           | |
     | |    [ ] XMLRPC      XMLRPC-EPI support                          | |
     | |    [X] XMLWRITER   XMLWriter support                           | |
     | |    [ ] XSL         XSL support (Implies DOM)                   | |
     | |    [ ] YAZ         YAZ support (ANSI/NISO Z39.50)              | |
     | |    [ ] ZIP         ZIP support                                 | |
     | |    [X] ZLIB        ZLIB support                                | |
     +-+--------v(+)----------------------------------------------------+-+
     |                       [  OK  ]       Cancel                        |
     +--------------------------------------------------------------------+
FreeBSD# make install clean


5.4.2 配置PHP5
5.4.2.1 修改PHP配置文件
FreeBSD# cd /usr/local/etc/
FreeBSD# cp php.ini-production php.ini


5.4.2.2 修改httpd.conf
FreeBSD# cd /usr/local/etc/apache22/
FreeBSD# cp httpd.conf httpd.conf.bak
FreeBSD# ee httpd.conf
//说下ee是个编辑器,非常好用,退出时按ESC或END均可.

-Options Indexes FollowSymLinks  
-//改为Options FollowSymLinks  
-//别说我没告诉你.163都会有这种错误.被黑客目录浏览到配置文件.到时候死了没我的事. 

<IfModule dir_module>  
DirectoryIndex index.html index.php  
</IfModule> 

AddType application/x-compress .Z  
AddType application/x-gzip .gz .tgz  
//在下面添加
AddType application/x-httpd-php .php  
AddType application/x-httpd-php-source .phps

5.4.2.4 实验php环境成功与否
FreeBSD# /usr/local/sbin/apachectl restart
FreeBSD# touch /usr/local/www/apache22/data/index.php
FreeBSD# echo '<?php' >> /usr/local/www/apache22/data/index.php
FreeBSD# echo 'phpinfo();' >> /usr/local/www/apache22/data/index.php
FreeBSD# echo '?>' >> /usr/local/www/apache22/data/index.php

在浏览器地址栏中输入:http://192.168.138.130
[注意]上面的IP是我的服务器中的,你要输入你的哦!
如果不行键入reboot命令重启.

5.4.2.5 后继考虑[我们安装环境不是用来放着的,而是要用的,所以要有些符合现实。]
[在安装经典Discuz论坛时会出现]对不起,请将 php.ini 中的 short_open_tag 设置为 On,否则无法继续安装。
FreeBSD3# vi /usr/local/etc/php.ini
将其中的short_open_tag = Off,更改为short_open_tag = On
FreeBSD3# /usr/local/etc/rc.d/apache22 restart

##6 创建Zend Optimizer环境
小提示:安装zend,在freebsd下面,目前只有支持到php5.1.x,对于php5.2.x还不能支持,因为zend还没有为php5.2.x 开发版本,在网上查了好多关于解决此类的问题,但得到的结果是,zend可以顺利安装,phpinfo也显示zend正常了,但程序无法调用,即zend 没有工作,也就是目前无法解决,我想只有等到zend php5.2.x的版本后,才可以解决此问题,也希望哪位已经解决此类问题的兄弟,share一下你的经验。假如你非要使用zend,那就请你将php降到5.1.x,或者你不当心已经升级了ports,那建议你可以安装php4.x,毕竟目前php4.x还通用于大部分的环境,所以整个的##6没有操作的必要。

6.1 安装Zend Optimizer
FreeBSD# cd /usr/ports/devel/ZendOptimizer/
FreeBSD# make install clean
===>  ZendOptimizer-3.3.0.a cannot install: doesn't work with PHP version : 5 (Doesn't support PHP 5).
*** Error code 1

Stop in /usr/ports/devel/ZendOptimizer.

**烦请直接转到6.1.1.5步正确的操作,如果想看到正确的Zend Optimizer安装的话,不过之所以也保留我的原稿是想让大家知道我是如果应对的,只有走了弯路才能走的更好.

6.1.1 安装故障排除
参考:http://www.freebsdchina.org/forum/viewtopic.php?t=31818

6.1.1.1 更新下Port[应该没有多大必要]
FreeBSD# portsnap fetch extract
Looking up portsnap.FreeBSD.org mirrors... 5 mirrors found.
Fetching public key from portsnap6.FreeBSD.org... done.
Fetching snapshot tag from portsnap6.FreeBSD.org... done.
Fetching snapshot metadata... done.
Fetching snapshot generated at Fri May 14 08:49:25 CST 2010:
61729c55fae2158c0b6f747511203ee0ec058fc7ee241c  4% of   62 MB  174 kBps 05m58s

6.1.1.2 查找Zend及其依赖关系
FreeBSD# make index
FreeBSD3# make search key=^Zend
Port:   ZendOptimizer-3.3.0.a
Path:   /usr/ports/devel/ZendOptimizer
Info:   An optimizer for PHP code
Maint:  ale@FreeBSD.org
B-deps: compat6x-i386-6.4.604000.200810_3
R-deps: apache-2.2.15_5 apr-devrandom-gdbm-db42-ldap24-mysql51-1.4.2.1.3.9_1 compat6x-i386-6.4.604000.200810_3 db42-4.2.52_5 expat-2.0.1_1 gdbm-1.8.3_3 libiconv-1.13.1_1 libxml2-2.7.7 mysql-client-5.1.46 openldap-client-2.4.22 pcre-8.02 perl-5.10.1_1 php5-5.3.2 pkg-config-0.23_1

6.1.1.3 查看系统安装的软件列表
FreeBSD3# pkg_info
apache-2.2.15_5     Version 2.2.x of Apache web server with prefork MPM.
apr-devrandom-gdbm-db42-ldap24-mysql51-1.4.2.1.3.9_1 Apache Portability Library
autoconf-2.62       Automatically configure source code on many Un*x platforms 
autoconf-wrapper-20071109 Wrapper script for GNU autoconf
automake-1.10.1     GNU Standards-compliant Makefile generator (1.10)
automake-1.9.6_3    GNU Standards-compliant Makefile generator (1.9)
automake-wrapper-20071109 Wrapper script for GNU automake
bash-4.0.33         The GNU Project's Bourne Again SHell
bigreqsproto-1.1.0  BigReqs extension headers
cvsup-without-gui-16.1h_4 File distribution system optimized for CVS (non-GUI version
db42-4.2.52_5       The Berkeley DB package, revision 4.2
expat-2.0.1_1       XML 1.0 parser written in C
freetype2-2.3.12    A free and portable TrueType font rendering engine
gdbm-1.8.3_3        The GNU database manager
gettext-0.17_1      GNU gettext package
gmake-3.81_3        GNU version of 'make' utility
help2man-1.38.2     Automatically generating simple manual pages from program o
inputproto-2.0      Input extension headers
jpeg-8_2            IJG's jpeg compression utilities
kbproto-1.0.4       KB extension headers
libICE-1.0.6,1      Inter Client Exchange library for X11
libSM-1.1.1,1       Session Management library for X11
libX11-1.3.3,1      X11 library
libXau-1.0.5        Authentication Protocol library for X11
libXaw-1.0.7,1      X Athena Widgets library
libXdmcp-1.0.3      X Display Manager Control Protocol library
libXext-1.1.1,1     X11 Extension library
libXmu-1.0.5,1      X Miscellaneous Utilities libraries
libXp-1.0.0,1       X print library
libXpm-3.5.7        X Pixmap library
libXt-1.0.7         X Toolkit library
libcheck-0.9.8      A unit test framework for C
libgcrypt-1.4.5     General purpose crypto library based on code used in GnuPG
libgpg-error-1.7    Common error values for all GnuPG components
libiconv-1.13.1     A character set conversion library
libpthread-stubs-0.3_3 This library provides weak aliases for pthread functions
libtool-2.2.6b      Generic shared library support script
libxcb-1.6          The X protocol C-language Binding (XCB) library
libxml2-2.7.7       XML parser library for GNOME
libxslt-1.1.26      The XSLT C library for GNOME
m4-1.4.14,1         GNU m4
mysql-client-5.1.46 Multithreaded SQL database (client)
mysql-server-5.1.46 Multithreaded SQL database (server)
openldap-client-2.4.22 Open source LDAP client implementation
p5-gettext-1.05_2   Message handling functions
pcre-8.02           Perl Compatible Regular Expressions library
perl-5.10.1_1       Practical Extraction and Report Language
php5-5.3.2          PHP Scripting Language
php5-ctype-5.3.2    The ctype shared extension for php
php5-dom-5.3.2      The dom shared extension for php
php5-extensions-1.4 A "meta-port" to install PHP extensions
php5-filter-5.3.2   The filter shared extension for php
php5-gd-5.3.2       The gd shared extension for php
php5-hash-5.3.2     The hash shared extension for php
php5-iconv-5.3.2    The iconv shared extension for php
php5-json-5.3.2     The json shared extension for php
php5-mysql-5.3.2    The mysql shared extension for php
php5-mysqli-5.3.2   The mysqli shared extension for php
php5-pdo-5.3.2      The pdo shared extension for php
php5-pdo_sqlite-5.3.2 The pdo_sqlite shared extension for php
php5-posix-5.3.2    The posix shared extension for php
php5-session-5.3.2  The session shared extension for php
php5-simplexml-5.3.2 The simplexml shared extension for php
php5-sqlite-5.3.2   The sqlite shared extension for php
php5-tokenizer-5.3.2 The tokenizer shared extension for php
php5-xml-5.3.2      The xml shared extension for php
php5-xmlreader-5.3.2 The xmlreader shared extension for php
php5-xmlwriter-5.3.2 The xmlwriter shared extension for php
php5-zlib-5.3.2     The zlib shared extension for php
pkg-config-0.23_1   A utility to retrieve information about installed libraries
png-1.4.1_1         Library for manipulating PNG images
printproto-1.0.4    Print extension headers
python26-2.6.5      An interpreted object-oriented programming language
sqlite3-3.6.23.1_1  An SQL database engine in a C library
t1lib-5.1.2_1,1     A Type 1 Rasterizer Library for UNIX/X11
tcl-8.5.8           Tool Command Language
tcl-modules-8.5.8   Tcl common modules
xcb-proto-1.6       The X protocol C-language Binding (XCB) protocol
xcmiscproto-1.2.0   XCMisc extension headers
xextproto-7.1.1     XExt extension headers
xf86bigfontproto-1.2.0 XFree86-Bigfont extension headers
xorg-macros-1.6.0   X.Org development aclocal macros
xproto-7.0.16       X11 protocol headers
xtrans-1.2.5        Abstract network code for X

6.1.1.4 发现问题症结所在[可惜最终没有解决问题]
B-deps: compat6x-i386-6.4.604000.200810_3 中的compat6x没有安装[在6.1.1.3中没有记录].
FreeBSD3# pkg_add -r compat6x-i386-6.4.604000.200810_3 ; rehash[!!失败]

FreeBSD3# cd /usr/ports/misc/compat6x && make install clean
===>  Vulnerability check disabled, database not found
=> compat6x-i386-6.4.604000.200810.tar.bz2 doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch from ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/local-distfiles/mnag/compat6x/.
compat6x-i386-6.4.604000.200810.tar.bz2         4% of 3060 kB   36 kBps

6.1.1.5 再次安装Zend

FreeBSD# pkg_add -r ZendOptimizer ; rehash

执行结果将类似如下:
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-8.0-release/Latest/ZendOptimizer.tbz... Done.
pkg_add: warning: package 'ZendOptimizer-3.3.0.a' requires 'libxml2-2.7.5', but 'libxml2-2.7.7' is installed
pkg_add: warning: package 'ZendOptimizer-3.3.0.a' requires 'php5-5.2.11', but 'php5-5.3.2' is installed

********************************************************************************

You have installed the ZendOptimizer package.

Edit /usr/local/etc/php.ini and add:

[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"

NOTE: PHP should be compiled in non-debug mode (default).

********************************************************************************
居然成功了!!呵呵!

6.2 配置ZendOptimizer[修改的是php.ini文件]
根据提示在php.ini文件中添加ZendOptimizer支持[一定记得要先备份php.ini文件哦]

FreeBSD3# cp /usr/local/etc/php.ini /usr/local/etc/php.ini.bak
FreeBSD3# ee /usr/local/etc/php.ini

重启apahce服务
FreeBSD3# /usr/local/etc/rc.d/apache22 restart


********************************************
小技巧集锦:

##1.freebsd下快速重启网卡

# ifconfig vr0 down  //STOP网卡,vr0指的是网卡型号,大多时候你的和这个是不一样的
# ifconfig vr0 up  //START网卡,可以通过ifconfig命令来查看本机的网卡型号哦

##2.FreeBSD系统开启telnet服务

#如何开启telnet
首先,用netstat -na先看一下你的22,23端口开启没有,如果没有,说明根本没有开启相应的服务;
然后,检查、修改/etc/inetd.conf文件,把telnet项前面的注释符号去掉;
    ee /etc/inetd.conf
   把
   #telnet stream tcp     nowait root    /usr/libexec/telnetd    telnetd
   #telnet stream tcp6    nowait root    /usr/libexec/telnetd    telnetd
最后,用 ps -aux | grep inetd 看一下是否有这个名称的进程存在,如果有的话最好kill掉然后再重新启动,如果没有的话,手工启动
/usr/sbin/inetd -wW ;

#允许root用户telnet
telnet 不是很安全,默认的情况之下不允许 root 以 telnet 进入主机。
若要允许root用户登入,可用下列方法:
ee /etc/pam.d/login
将这一行加上注释!
account                requisite       pam_securetty.so

#当重启机子后会发现在Windows运行框中输入命令:telnet 192.168.0.205
并不能成功运行,只有再次通过SSH登陆后,在ROOT用户状态下输入命令:/usr/sbin/inetd -wW 在启动此服务后才能够,成功运行telnet.
好的解决方法就是让telnet服务随系统启动.


##3.软件的自动安装特性[当然要联网哦,也忘记说了,FreeBSD系统要始终处于联网状态.]
FreeBSD# portsnap fetch extract
Looking up portsnap.FreeBSD.org mirrors... 5 mirrors found.
Fetching public key from portsnap6.FreeBSD.org... done.
Fetching snapshot tag from portsnap6.FreeBSD.org... done.
Fetching snapshot metadata... done.
Fetching snapshot generated at Fri May 14 08:49:25 CST 2010:
61729c55fae2158c0b6f747511203ee0ec058fc7ee241c 15% of   62 MB   58 kBps 15m29s
fetch: transfer timed out
fetch: 61729c55fae2158c0b6f747511203ee0ec058fc7ee241c372228f8cfb345b696.tgz appears to be truncated: 9916416/65766877 bytes
##4.安装本地搜索引擎[注意哦硬盘会很忙]
FreeBSD3# make search key=^Zend
The search target requires INDEX-8. Please run make index or make fetchindex.
FreeBSD# make index

本文被转载链接:

http://www.2cto.com/os/201109/102445.html

http://www.linuxso.com/linuxrumen/3927_3.html

http://hi.baidu.com/cnwangyl/blog/item/1d4acdc4b73e70b28226ac8e.html

http://jmq.lubakuaikai.com/48cb04f1/uwyqitql-vztl-58iut-itm/924842/655294

http://www.360doc.com/content/11/0903/20/4171006_145553109.shtml



本文转自tiancong 51CTO博客,原文链接:http://blog.51cto.com/tiancong/655873

版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

分享:
数据库
使用钉钉扫一扫加入圈子
+ 订阅

分享数据库前沿,解构实战干货,推动数据库技术变革

其他文章
最新文章
相关文章