空间管理 您的位置: 东瀛热线 » OK » 日志

FreeBSD6.2架设Discuz!6.0 BBS服务器指南 ZT

上一篇 / 下一篇  2007-10-02 11:39:31 / 个人分类:bsd

菜鸟架站之BBS服务器
=====================================================================================================





FreeBSD6.2架设Discuz!6.0 BBS服务器指南


Discuz!6.0 BBS Server On FreeBSD6.2 HowTo


Mongolia




Index:


  • 简介
  • Step 1 installation Apache22.
  • Step 2 installation MySQL Server.
  • Step 3 installation PHP.
  • Step 4 ZendOptimizer.
  • Step 5 Discuz!6.0.
  • F.A.Q.
  • Links to other sources

简介


学习FreeBSD很久了,一直是菜鸟水平。现在记录下我的BBS on FreeBSD安装历程,发表到CU论坛,请各位达人批评指正。
本文目标:


使用Very Very GoodFreeBSD6.2作为系统,原因是高人们说这个小恶魔很稳定、很快速。而且有独特的FreeBSD最引以为傲的Ports,所以系统使用FreeBSD6.2Ports的好处是,安装程序方便(只需找到程序目录,然后执行make install clean),升级维护程序方便,卸载方便。本文的应用程序均使用Ports方式安装。FreeBSD6.2+Apache22+PHP5+php5-extensions+ZendOptimizer+ Discuz!6.0


软件版本信息:


  • FreeBSD 6.2-RELEASE

  • Apache-2.2.3
  • Mysql-server-5.0.27
  • Php5-5.1.6_3
  • Php5-extensions-1.0
  • ZendOptimizer-3.0.1_1
  • Perl-5.8.8
  • Discuz!_6.0.0_SC_UTF8.zip

  • Step 1 安装 Apache22.


Installation of the Apache server:


跟随下面步骤安装 Apache2.

Shell:


cd /usr/ports/www/apache22
make install clean




安装完成后,需要编辑/etc/rc.conf文件,添加下面内容到/etc/rc.conf(要添加的内容,可以cat /usr/local/etc/rc.d/apache22查看到具体说明)

Editor:


# Apache 22
apache22_enable="YES"



Step 2 安装 MySQL.




Installation of the MySQL server:
安装MySQL server5.0

Shell:


cd /usr/ports/databases/mysql50-server
make install clean



安装完成后,需要编辑/etc/rc.conf文件,添加下面内容到/etc/rc.conf
Editor:


# MySQL Server 5.0
mysql_enable="YES"



启动MySQL服务
Shell:


/usr/local/etc/rc.d/mysql-server start



使用mysqladmin命令更改MySQL密码
Shell:


mysqladmin -uroot password 'passwd' (passwd是你要设置的密码)





Step 3 安装 PHP.





Installation of the PHP:
安装PHP5

Shell:


cd /usr/ports/lang/php5
make install clean




选择如下安装选项


Options for php5 5.1.6_3


[X]


CLI


Build CLI version



[X]


CGI


Build CGI version


[X]


APACHE


Build Apache module


[X]


SUHOSION


Enable Suhosin protection system


[X]


FASTCGI


Enable fastcgi support (CGI only)


[X]


PATHINFO


Enable path-info-check support (CGI only)





安装完成后,备份/usr/local/etc/apache22/httpd.conf文件


Shell:


cp /usr/local/etc/apache22/httpd.conf /usr/local/etc/apache22/httpd.conf.bak




编辑/usr/local/etc/apache22/httpd.conf文件,以使Apache22 Server支持php



编辑/usr/local/etc/apache22/httpd.conf,在AddType application/x-gzip .gz .tgz(大约354)下面添加以下内容

Editor:


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




修改前:




# probably should define those extensions to indicate media types:



#



AddType application/x-compress .Z



AddType application/x-gzip .gz .tgz




修改后:



# probably should define those extensions to indicate media types:



#



AddType application/x-compress .Z



AddType application/x-gzip .gz .tgz



AddType application/x-httpd-php .php



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





先不要退出,添加'index.php' 'DirectoryIndex' 主目录索引(大约212)

Editor:


DirectoryIndex index.php index.html index.html.var



修改前:


#


<IfModule dir_module>



DirectoryIndex index.html


</IfModule>



#



修改后:


#


<IfModule dir_module>



DirectoryIndex index.php index.html index.htm index.html.var


</IfModule>



#





Installation of the PHP Extensions:


安装php5-extensions扩展.

Shell:


cd /usr/ports/lang/php5-extensions
make config
make install clean



安装选项如下:


详细安装选项


Options for php5-extensions 1.0



[X]


BZ2


bzip2 library support


[X]


CALENDAR


calendar conversion support


[X]


CTYPE


ctype functions


[X]


GD


GD library support


[X]


ICONV


iconv support


[X]


MBSTRING


multibyte string support


[X]


MYSQL


MySQL database support


[X]


PCRE


Perl Compatible Regular Expression support


[X]


POSIX


POSIX-like functions


[X]


SESSION


session support


[X]


SOCKETS


sockets support


[X]


TOKENIZER


tokenizer support


[X]


ZIP


ZIP support


[X]


ZLIB


ZLIB support




复制/usr/local/etc/php.ini-dist/usr/local/etc/php.ini
Shell:


cp /usr/local/etc/php.ini-dist /usr/local/etc/php.ini





安装完成后,重新启动你的 web server.

Execute the following command to start / restart the Apache webserver.

Shell:


/usr/local/etc/rc.d/apache22 restart



提示:


如果出现这样的错误


root@WOW[/root]#/usr/local/etc/rc.d/apache22 restart


httpd not running, trying to start


[Sat Sep 29 16:05:07 2007] [warn] (2)No such file or directory: Failed to enable the 'httpready' Accept Filter



解决办法:


/boot/loader.conf添加accf_http_load=”yes”
root@WOW[/root]#echo accf_http_load="YES" >> /boot/loader.conf


然后reboot一下就可以解决了


这是因为Apache无法开启FreeBSDaccept filter 的机制,


FreeBSD 系统还提供了http filter,会自动过滤掉不完整的HTTP请求。


解决方法:


root@WOW[/root]#kldload accf_http


并修改/boot/defaults/loader.conf,以便下次启动自动装载模块(大约364)
修改前:


accf_data_load="NO"
accf_http_load=
"NO"


修改后:


accf_data_load="YES"
accf_http_load=
"YES"




测试Apache Server

浏览器打开http://youipaddress

显示:

It works!

OK,现在Aapche Server工作正常。什么?为什么只有一行It works!?因为FreeBSD开发的达人们只追求速度、简单,呵呵。







TAG:

引用 删除 Guest   /   2007-11-18 01:25:37
-1
 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

Open Toolbar