免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12345下一页
最近访问板块 发新帖
查看: 20638 | 回复: 46
打印 上一主题 下一主题

菜鸟架站之BBS服务器 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-10-01 13:50 |只看该作者 |倒序浏览
菜鸟架站之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"




[ 本帖最后由 freemongolia 于 2007-10-2 09:34 编辑 ]

index.JPG (103.09 KB, 下载次数: 97)

index.JPG

论坛徽章:
0
2 [报告]
发表于 2007-10-01 13:51 |只看该作者

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是你要设置的密码)



[ 本帖最后由 freemongolia 于 2007-10-2 09:35 编辑 ]

论坛徽章:
0
3 [报告]
发表于 2007-10-01 13:53 |只看该作者

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




[ 本帖最后由 freemongolia 于 2007-10-1 13:55 编辑 ]

论坛徽章:
0
4 [报告]
发表于 2007-10-01 13:56 |只看该作者
先不要退出,添加'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>


#

论坛徽章:
0
5 [报告]
发表于 2007-10-01 13:59 |只看该作者

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



[ 本帖最后由 freemongolia 于 2007-10-1 14:01 编辑 ]

论坛徽章:
0
6 [报告]
发表于 2007-10-01 14:00 |只看该作者
安装完成后,重新启动你的 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"



[ 本帖最后由 freemongolia 于 2007-10-2 09:37 编辑 ]

论坛徽章:
0
7 [报告]
发表于 2007-10-01 14:01 |只看该作者
测试Apache Server
浏览器打开http://youipaddress
显示:
It works!
OK,现在Aapche Server工作正常。什么?为什么只有一行It works!?因为FreeBSD开发的达人们只追求速度、简单,呵呵。

论坛徽章:
0
8 [报告]
发表于 2007-10-01 14:03 |只看该作者

Step 4 安装 ZendOptimizer.


Installation of the ZendOptimizer:

安装ZendOptimizer.


Shell:

root@ohaha[/root]#cd /usr/ports/devel/ZendOptimizer/

root@ohaha[/usr/ports/devel/ZendOptimizer/]#make install clean

安装完成提示如下

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


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"


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

编辑/usr/local/etc/php.ini

增加内容如下

Editor:

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"



[ 本帖最后由 freemongolia 于 2007-10-1 14:04 编辑 ]

论坛徽章:
0
9 [报告]
发表于 2007-10-01 14:05 |只看该作者


重新启动你的 web server.
Execute the following command to start / restart the Apache webserver.
Shell:


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



测试Aapche Server PHPZendOptimizer支持
浏览器打开http://youipaddress


显示:




PHP Version 5.1.6




System


FreeBSD ohaha.3322.org 6.2-RELEASE FreeBSD 6.2-RELEASE #0: Fri Jan 12 10:40:27 UTC 2007 root@dessler.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386


Build Date


Oct 1 2007 08:43:04


Configure Command


'./configure' '--enable-versioning' '--enable-memory-limit' '--with-layout=GNU' '--with-config-file-scan-dir=/usr/local/etc/php' '--disable-all' '--enable-libxml' '--with-libxml-dir=/usr/local' '--enable-reflection' '--enable-spl' '--program-prefix=' '--enable-fastcgi' '--with-apxs2=/usr/local/sbin/apxs' '--with-regex=php' '--with-zend-vm=CALL' '--disable-ipv6' '--prefix=/usr/local' 'i386-portbld-freebsd6.2'


OK,现在Aapche Server支持PHP工作正常。


[ 本帖最后由 freemongolia 于 2007-10-2 09:38 编辑 ]

论坛徽章:
0
10 [报告]
发表于 2007-10-01 14:07 |只看该作者
Step 5 安装 Discuz!6.0.
Installation of the PHP Extensions:
安装Discuz!6.0论坛BBS程序
登陆[url=http://www.discuz.com/download/]http://www.discuz.com/download/官方网站下载简体 UTF-8版本Discuz!6.0
Shell:
cd /tmp
fetch " http://download.discuz.net/6.0.0/Discuz!_6.0.0_SC_UTF8.zip"
tar zxvf Discuz\!_6.0.0_SC_UTF8.zip
cd ftp
chown www config.php
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP