Aix5.3操作系统上部署phpBB论坛

 

Aix5.3操作系统上部署phpBB论坛

背景目的

iPlat4j原有的windows服务器的由于磁盘坏掉,导致三年来积累的用户反馈数据丢失,因此需要再重新部署一个phpbb论坛。 这次是打算把它部署在IBM 的aix5.3操作系统上,IBM机器以稳定性、高性能闻名于业界。 同时准备进行IBM p6机器上的磁带机定期备份,确保数据的安全。 phpbb是一个很优秀的开源论坛,相对jForum来说功能更为丰富,并且可以设多层级板块,使用更范围广泛。

 

安装gcc编译器

可以参考帖子:

编译安装apache服务器

Image:Wangyuqiu_image_httpd_logo.gif

下载资源

apache2.2服务器下载地址:http://httpd.apache.org/

 

下载好apache web服务器的unix源代码文件httpd-2.2.14.tar.gz之后,解压缩该文件

gunzip httpd-2.2.14.tar.gz
tar xvf httpd-2.2.14.tar

 

用configure脚本准备编译

./configure -C --enable-so --prefix /usr/local/apache2 --with-included-apr

 

执行如下编译命令

make

 

执行如下命令,安装apache2.2

make install

 

安装成功之后,需要配置apache的配置文件:/usr/local/apache2/conf/httpd.conf

执行命令:more /usr/local/apache2/conf/httpd.conf | grep "htdocs"

结果为:DocumentRoot "/usr/local/apache2/htdocs"

该目录/usr/local/apache2/htdocs为apache的工程文件顶级目录,类似于tomcat的webapps,IIS的虚拟目录

执行命令:/usr/local/apache2/bin/apachectl -k start 以便启动apache web服务器

但是却提示错误信息:httpd: bad group name daemon

解决次问题有两种方法:

  • 1.添加一个名为daemon的aix操作系统用户和群组
  • 2.vi /usr/local/apache2/conf/httpd.conf 修改"User daemon"行数据为"User nobody","Group daemon" 行数据为 "Group nobody"

执行命令:/usr/local/apache2/bin/apachectl -k start 以便启动apache web服务器

httpd: Could not reliably determine the server's fully qualified domain name, using 10.25.5.20 for ServerName

解决方法,vi /usr/local/apache2/conf/httpd.conf 把ServerName之前的"#"注释去掉

# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
#
ServerName 10.25.5.20:80

再执行/usr/local/apache2/bin/apachectl -k start 以便启动apache web服务器

则提示:httpd (pid 893320) already running

在浏览器中输入http://10.25.5.20

Image:Wangyuqiu_apache_success.jpg

编译安装php运行环境

Image:Wangyuqiu_image_php.jpg.gif

先去 http://www.oss4aix.org/download/latest/aix53/ 下载编译php源码包所依赖的libary包

libpng-1.2.40-1.aix5.1.ppc.rpm
libpng-devel-1.2.40-1.aix5.1.ppc.rpm
libjpeg-devel-7-1.aix5.1.ppc.rpm
libjpeg-7-1.aix5.1.ppc.rpm
libxml2-devel-2.7.3-1.aix5.1.ppc.rpm
libxml2-2.7.3-1.aix5.1.ppc.rpm
freetype2-devel-2.3.9-1.aix5.1.ppc.rpm
freetype2-demos-2.3.9-1.aix5.1.ppc.rpm
freetype2-2.3.9-1.aix5.1.ppc.rpm
expat-devel-2.0.1-2.aix5.1.ppc.rpm
expat-2.0.1-2.aix5.1.ppc.rpm
zlib-devel-1.2.3-5.aix5.1.ppc.rpm
zlib-1.2.3-5.aix5.1.ppc.rpm
flex-2.5.35-1.aix5.1.ppc.rpm
bzip2-devel-1.0.5-1.aix5.1.ppc.rpm
bzip2-1.0.5-1.aix5.1.ppc.rpm
libXpm-devel-3.5.7-2.aix5.1.ppc.rpm
libXpm-3.5.7-2.aix5.1.ppc.rpm
pkg-config-0.23-1.aix5.1.ppc.rpm
info-4.12-1.aix5.1.ppc.rpm
gettext-devel-0.17-1.aix5.1.ppc.rpm
gettext-0.17-1.aix5.1.ppc.rpm
glib2-2.20.5-1.aix5.1.ppc.rpm
glib2-devel-2.20.5-1.aix5.1.ppc.rpm

 

执行命令:rpm -U *.rpm

去 http://cn.php.net/distributions/php-5.2.11.tar.gz 下载php-5.2.11的源代码文件,依次执行如下命令:

  • gunzip php*tar.gz
  • tar xvf php*.tar

 

export PATH=/opt/freeware/bin:$PATH
./configure --prefix=/usr/local
--with-apxs2=/usr/local/apache2/bin/apxs
--with-config-file-path=/usr/local/apache2/conf
--with-gd
--with-zlib-dir=/opt/freeware/lib
--enable-shared --disable-static
--with-png
--with-zlib
--with-bz2
--with-xml
--with-jpeg-dir=/opt/freeware/lib
--with-png-dir=/opt/freeware/lib
--with-xpm-dir=/opt/freeware/lib
--with-freetype-dir=/opt/freeware/lib
--with-mysql=/usr/local/mysql

 

该命令执行的时间大概是10分钟左右,该命令执行完毕之后,然后执行编译命令:

  • make

然后安装PHP:

  • cp .libs/libphp5.so /usr/local/apache2/modules
  • cp php.ini-recommended /usr/local/apache2/conf/php.ini

在Apache上测试PHP

修改Apache的配置文件httpd.conf之前,先停止Apache服务器,执行/usr/local/apache2/bin/apachectl -k stop

否则到时只能使用kill 命令杀死Apache进程。

在http.conf之后追加:

 

LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php .php
DirectoryIndex index.php

 

然后在Apache的web Server文件目录(默认是/usr/local/apache2/htdocs)创建一个名为test.php的文件

<h1> PHP test ---- Hello World! We will rebuild iPlat4j's phpBB forums for our users on AIX5.3 OS!</h1>
<?PHP phpinfo() ?>

 

  • 确保该文件所有用户可读:chmod 755 test.php
  • 确保该文件不属于任何用户:chown nobody:nobody test.php
  • 现在可以通过http://10.25.5.20/test.php访问了。

编译安装mysql数据库

Image:Wangyuqiu_image_mysql.gif

可以参考帖子:

 

安装phpbb论坛

Image:Wangyuqiu_image_phpbb4iplat.jpg

  • 1.解压从http://www.phpbb.com/ 下载来的最新phpBB-3.0.5.zip、lang_zh_cmn_hans.zip、prosilver_zh_cmn_hans.zip

、subsilver2_zh_cmn_hans.zip

  • 2.执行jar -xvf phpBB-3.0.5.zip 把其解压缩到/usr/local/apache2/htdocs 即apache的web部署目录。
  • 3.把lang_zh_cmn_hans.zip解压后的文件中的zh_cmn_hans目录拷贝到/usr/local/apache2/htdocs/phpBB3/language/里面,执行命令:

cp -r zh_cmn_hans /usr/local/apache2/htdocs/phpBB3/language/

  • 4.把prosilver_zh_cmn_hans.zip解压后的文件中的zh_cmn_hans目录拷贝

到/usr/local/apache2/htdocs/phpBB3/styles/prosilver/imageset里面,命令如同3

  • 5.把subsilver2_zh_cmn_hans.zip解压后的文件中的zh_cmn_hans目录拷贝到/usr/local/apache2/htdocs/phpBB3/styles/subsilver2/imageset里面,命令如同3
  • 6.给phpBB创建一个使用的数据库,如MySql下,mysql -u root ,创建数据库:create database phpbb3;或者使用Oracle数据库

进行安装phpBB。

  • 7.安装成功之后,最后执行rm -r /usr/local/apache2/htdocs/phpBB3/install下面的文件 或者更改文件目录名:

mv -r /usr/local/apache2/phpBB3/install /usr/local/apache2/htdocs/phpBB3/_install

 

[phpBB Debug] PHP Notice: in file /includes/ucp/ucp_register.php on line 147: date() 
[function.date]: It is not safe to rely on the system's timezone settings. 
Please use the date.timezone setting, the TZ environment variable or 
the date_default_timezone_set() function. In case you used any of those 
methods and you are still getting this warning, you most likely misspelled 
the timezone identifier. We had to select 'UTC' because your platform doesn't provide 
functionality for the guessing algorithm

 

这样的错误信息,修改php的时区设置,或者在在该.php文件开头加入ini_set('date.timezone','Asia/Shanghai');

使其使用上海时区

访问地址:http://10.25.5.20/phpBB3/ 或者 http://10.25.10.6/phpBB2/ (保持和原来论坛地址一致)

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值