在Debian中架设PHP论坛

[ 2005-11-01 10:18:01 | Author: songzi ]
Font Size: Large | Medium | Small
在linux中架设论坛,当然要选择黄金组合Lamp(Linux/Apache/MySQL/PHP)了,
由于是初学,没有选编译安装,直接apt,感觉比windows下方便多了。
#apt-get install apache php4 php4-gd php4-mysql mysql-server mysql-client

敲一下回车,就安装完成了,如果在windows下在还得去各个官方网站下载安装包,真是麻烦。

好了,软件包是安装完成了,接下来就是调试了
先是配置apache,打开/etc/apache/httpd.conf ,找到DirectoryIndex 修改成:
<IfModule mod_dir.c>
DirectoryIndex index.html index.htm index.shtml index.cgi index.php default.php index.php3
</IfModule>
其实是增加对默认主页的支持。
把默认字符改为:AddDefaultCharset gb2312,保存后重启apache。
#/etc/init.d/apache restart

接下来是配置mysql,由于默认的root 帐户,没有设密码,为了安全先给root加上密码:
#mysqladmin -u root password 'xxx'
再编辑/etc/init.d/mysql,找到这一行:

/usr/bin/safe_mysqld > /dev/null 2>&1 &
  改成:/usr/bin/safe_mysqld > --default-character-set=gb2312 /dev/null 2>&1 &
重启mysql: # /etc/init.d/mysql restart

同理,修改/etc/php4/apache/php.ini ,将default_charset改为 "gb2312", 就行了。

和在windows下一样,先做个小测试,建立一个phpinfo.php 文件,里面 输入<?php phpinfo();?>放在/var/www下面,再在浏览器里输入http://ip/phpinf.php 如果出现下php的一些信息,就说明php和apache已经成功配置了。

紧接着我们开始架设论坛,去www.phpbb.cn下载新版的phpbb中文版,回来后解压,接着在放在./var/www目录下,然后运行,就会出现安装论坛向导,在这里会要求你指定一个数据库名称,所以得先在mysql里新建一个数据库。
#mysql -u root -p password
mysql>create database bbs;
然后在安装页面,数据库一栏里输入bbs就行了。
运行:
attachments/200511/01_102233_php.jpg


很喜欢phpbb,到不是因为其它什么原因,只是因为它很漂亮,而且可以轻松的更换各种样式。
[Last Modified By songzi, at 2007-03-30 11:11:18]


Comments Feed Comments Feed: http://www.songzi.org/blog/feed.asp?q=comment&id=182
UTF-8 Encoding Trackback URL: http://www.songzi.org/blog/trackback.asp?id=182

View Mode: Show All | Comments: 4 | Trackbacks: 41 | Toggle Order | Views: 7614
Quote puz981*
[ 2008-03-18 20:28:38 ]
你太帅了

Post Comment
Smilies
[smile] [confused] [cool] [cry]
[eek] [angry] [wink] [sweat]
[lol] [stun] [razz] [redface]
[rolleyes] [sad] [yes] [no]
[heart] [star] [music] [idea]
Enable UBB Codes
Auto Convert URL
Show Smilies
Hidden Comment
Username:   Password:   Register Now?
Security Code * Please Enter the Security Code