在linux下自己动手安装一个phpbb论坛
呵呵,一直想在linux 下动手安装一个论坛,今天终于有空了.先在网上下了个phpbb2cnMOD-UTF8.zip 包,这是一个已经汉化了的phpbb版本.在安装前请确认你的linux 下安装了以下三个东西:apache,php,mysql. 呵呵,如果没有的话,就只好自己手动安装了.我用的是Linux Enterprise 3,它已经为我们安装好了上面三个东东.如下:
[root@SunLife ~]# whereis httpd
httpd: /usr/sbin/httpd.worker /usr/sbin/httpd /etc/httpd /usr/lib/httpd /usr/include/httpd /usr/share/man/man8/httpd.8.gz
[root@SunLife ~]# whereis php
php: /usr/bin/php /etc/php.ini /etc/php.d /usr/lib/php /usr/include/php
[root@SunLife ~]# whereis mysql
mysql: /usr/bin/mysql /usr/lib/mysql /usr/include/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz
[root@SunLife ~]#
在mysql下新建一个database,如下:
[root@SunLife ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 68 to server version: 4.1.20
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>create database phpbb;
Query OK, 1 row affected (0.03 sec)
为新建的database 指定用户名和密码,如下:
mysql>grant all privileges on phpbb.* to mengzhiyi@localhost by identified '654321' ;
.....................
mysql>quit;
bye
[root@SunLife ~]#
测试一下刚才建立的database,如下:
[root@SunLife ~]# mysql -u mengzhiyi -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 69 to server version: 4.1.20
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> connect phpbb
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Connection id: 70
Current database: phpbb
mysql> quit;
Bye
[root@SunLife ~]#
至此,数据库已经准备好了.下面开始安装phpbb论坛。
首先解压phpbb2cnMOD-UTF8.zip包,如下;
[root@SunLife phpbb]#unzip phpbb2cnMOD-UTF8.zip
在/var/www/html/目录下新建一个phpbb的目录,然后将上面解压的文件全部拷贝到/var/www/html/phpbb/目录下.这样该目录下应有如下内容:
[root@SunLife ~]# cd /var/www/html/phpbb/
[root@SunLife phpbb]# ls
admin cash.php displaying.php files language modcp.php search.php viewtopic.php
attach_mod commend.php docs groupcp.php link_register.php phpbb2cnMOD-UTF8.zip templates
attach_rules.php common.php download.php groupmsg.php links.js.php posting.php -?+?.txt
birthday_popup.php config.php extension.inc images links.php privmsg.php uacp.php
cache db faq.php includes login.php profile.php viewforum.php
card.php delete_users.php favorites.php index.php memberlist.php rss.php viewonline.php
[root@SunLife phpbb]#
改变config.php文件的属性:
[root@SunLife phpbb]#chmod 777 config.php
接下来可以进行网络安装了,phpBB2 的安裝非常简单,打开Linux的浏览器在地址栏直接输入:http://127.0.0.1/phpbb2 后会出现对话框让你填写一些系统信息见图1.
填完上述信息后,点击安装即可完成phpBB2 的安裝.出于安全方面的考虑请在安装完毕后删除下面两个文件:
[root@SunLife phpbb] # rm –rf install
[root@SunLife phpbb] # rm –rf contrib
接下来你就可以进入论坛管理你的论坛了。