[作者] dsj [头衔]
论坛坛主 [经验]
220862 [等级]
大主帅 [发帖]
15642 [回帖]
1366 [登陆]
7956
[发表时间]
2005/11/7 15:19:19 [楼主]
|
|
标题:
在linux下做个论坛 linux+apache+php+mysql+phpbb
|
tian1118 经过n个不眠之夜,小弟终于配置成功apache+phpbb+php+mysql [原创] 到www.mysql.com , www.apache.org , www.php.net下载mysql,apache,php的最新源码包 mysql-standard-5.0.1-alpha-snapshot-pc-linux-i686.tar.gz httpd-2.0.52.tar.gz php-5.0.2.tar.gz 我们先来安装mysql cp mysql-standard-5.0.1-alpha-snapshot-pc-linux-i686.tar.gz /usr/local/ tar -zxvf mysql-standard-5.0.1-alpha-snapshot-pc-linux-i686.tar.gz cd mysql-standard-5.0.1-alpha-pc-linux-i686/ emacs INSTALL-BINARY 获得安装信息 groupadd mysql useradd -g mysql mysql cd /usr/local/ ln -s mysql-standard-5.0.1-alpha-pc-linux-i686/ mysql 建立软链接 ./scripts/mysql_install_db --user=mysql chown -R root . chown -R mysql data chgrp -R mysql . ./bin/mysqld_safe --user=mysql & 从后台启动mysql,这时会看到 [1] 3879 [root--1014--/usr/local/mysql]Starting mysqld daemon with databases from /usr/local/mysql/data 证明已经成功,可以用ps -aux │ grep mysql 可以看到。 安装成功 再来安装apache tar -zxvf httpd-2.0.52.tar.gz cd httpd-2.0.52 emacs INSTALL 获得一些安装信息 ./configure --enable-so --enable-so make ; make install cd /usr/local/apache2/bin ./apachectl start httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName 这时打开浏览器,输入127.0.0.1或你的电脑名,我的为tian1118,然后你就可以看到漂亮的羽毛,证明apache安装成功,而且可以正确显示出简体中文,真爽。 再仔细看看,好像有点问题。 cd /usr/loca/apache2/conf/ cp httpd.conf beifei 备份一下,免得自己改错了。 emacs httpd.conf 找到#ServerName www.example.com:80 把它改为ServerName 127.0.0.1 ../bin/apachectl restart 没有出错提示证明成功 再来安装php tar -zxvf php-5.0.2.tar.gz cd php-5.0.2 emacs INSTALL 获得一些安装信息 ./configure --with-apxs2=/usr/local/httpd/bin/apxs --with-mysql=/usr/local/mysql 如果出现如下证明快成功了。 +--------------------------------------------------------------------+ │ License: │ │ This software is subject to the PHP License, available in this │ │ distribution in the file LICENSE. By continuing this installation │ │ process, you are bound by the terms of this license agreement. │ │ If you do not agree with the terms of this license, you must abort │ │ the installation process at this point. │ +--------------------------------------------------------------------+ Thank you for using PHP. make make install cp php.ini-dist /usr/local/lib/php.ini cp:是否覆盖‘/usr/local/lib/php.ini’? y php与apache整合 emacs /usr/local/apache2/conf/httpd.conf 找到DirectoryIndex改为如下: DirectoryIndex index.html index.php index.htm index.html.var 找到 AddType application/x-compress .Z AddType application/x-gzip .gz .tgz 在它后面添加 AddType application/x-httpd-php .php /usr/local/apache2/bin/apachectl restart 测试php emacs /usr/local/apache2/htdocs/index.php 添加<? phpinfo();?>; 打开浏览器,输入
http://127.0.0.1/index.php 可以看到关于php的信息,证明php安装成功。 结束语:强烈建议大家在安装软件时用源码安装,虽然很麻烦,但是你知道你都做了什么,知道你把软件包安装到了哪,还有出了问题大家不要着急,先看出错提示,查看出错信息,利用自己所学linxu知识判断是哪出错了,就比如我在安装php时,我想先安装apache,然后php,最后mysql,当我在安装php时加了参数--with-mysql=/usr/local/mysql,在安装时就会出错,还有,在安装php时它还提示我的libxm12的版本太低,我的是RD9.0,内核2.4.20-8,我用rpm -qa │ grep libxm12时,版本才1.,然后下载了libxml2- 2.6.10.tar.gz,安装后再安装php就成功了,。 安装完apache+php+mysql之后,我又安装了phpbb,安装后论坛测试成功,但是重新启动后发现出错,提示数据库有问题,经朋友的指点,我改变了mysql的安装路径,过去它的路径为/soft/mysql,现你只要把它安装在/usr/local/mysql下就可以了,安装好后要为phpbb建立一个数据库,比如 mysql>;create database myphpbb ; Query OK, 1 row affected (0.02 sec) 好了.记住你为phpbb起的数据库名,以后要用的.myphpbb 现在我写写phpbb的安装过程. 到www.phpbb.com下载软件包lang_chinese_simplified.tar.gz phpBB-2.0.12.tar.gz subSilver_chinese_simplified.tar.gz phpBB-2.0.12.tar.gz phpbb的源码包 lang_chinese_simplified.tar.gz subSilver_chinese_simplified.tar.gz 这二个是支持中文的包. 现在要解压,但是要思考一下,我的web在/soft/apache/htdocs/index.html,要把phpbb解压到哪,随便找个目录解压,但是把开我的index.html时又怎么指向到phpbb呢,所以我把phpbb解压到index.html所在的目录. cp phpBB-2.0.12.tar.gz /soft/apache/htdocs cd /soft/apache/htdocs tar -zxvf phpBB-2.0.12.tar.gz 这时会出现phpBB2目录 tar -zxvf lang_chinese_simplified.tar.gz tar -zxvf subSilver_chinese_simplified.tar.gz 解压支持中文包的软件. 会出现lang_chinese_simplified和subSilver目录 cp lang_chinese_simplified/ phpBB2/language/ -r cp subSilver/ phpBB2/templates/ -fr chmod 777 phpBB2/config.php cd ../bin/ ./apachectl start 启动apache 在你的浏览器中输入你的IP,比如我的www.hellolinux.net会看到我的主页,这样你再在浏览器中输 http://www.hellolinux.net/phpBB2/install/install.php 进入phpbb的安装界面.这里有许多需要填写的信息. 我写出自己填写的信息以供参考. 预设论坛语言: Chinese 数据库格式: MySQL4.x 请选择安装模式: 完整安装 数据库设定 数据库服务器主机名称: localhost 您的数据库名称: myphpbb 数据库用户帐号: root 数据库密码: 无 数据库的表格字首 (Prefix): phpbb_ 系统管理员设定 论坛管理员电子邮件信箱: ***@*** 域名: www.hellolinux.net 服务端口: 80 脚本路径: /phpBB2/ 系统管理员帐号名称: hellolinux 系统管理员密码: **** 系统管理员密码 [ 确认 ]: **** 这时安装成功,系统会提示你在删除phpBB2目录中的install/ contrib/ 我咨询了一下网中的朋友说是安全吧,要不其他普通会员也会修改论坛中的信息. rm -fr install/ contrib/ 现在你的论坛就算是安装成功,你进入控制面板就修改论坛中的许多信息,要做一个比较好的论坛还需要许多知识html php mysql 共同努力吧,我会慢慢完善我的www.hellolinux.net 希望大家多来访问呀.
分享到:
|
我的QQ群:500人财富群11470502;投资群5920530;资源群6648659;交友群5713862;娱乐群6925950。 我的博客: http://104508155.qzone.qq.com/
|
|
|
|