现在的位置: 首页 > 综合 > 正文

如何用cetos-5.5搭建论坛

2017年04月05日 ⁄ 综合 ⁄ 共 3980字 ⁄ 字号 评论关闭

实验环境 centos-5.5

实验软件包

yum install -y zlibc  gd*  pcre*   freetype*  libpcap*  libxml2* libpng* perl-DBI* gcc*

gcc-c++*  libtool*  fontconfig*  libmcrypt libmcrypt-devel mcrypt mhash

ncurses-devel-5.5-24.20060715.i386.rpm    

mysql-5.0.56.tar.gz

httpd-2.2.11.tar.gz

jpegsrc.v8b.tar.gz        

php-5.3.6.tar.gz

phpMyAdmin-3.2.5-all-languages.tar.gz

UCenter_1.5.0_SC_GBK.zip

Discuz_7.2_FULL_SC_GBK.zip

软件安装

tar zxvf mysql-5.0.56.tar.gz

useradd  mysql

cd mysql-5.0.56

./configure --prefix=/usr/local/mysql

--with-charset=gb2312    --with-extra-charsets=all

make

make install

cp support-files/my-medium.cnf /etc/my.cnf

cd /usr/local/mysql

chown mysql:mysql .

/usr/local/mysql/bin/mysql_install_db --user=mysql

/usr/local/mysql/bin/mysqld_safe &

/usr/local/mysql/bin/mysqladmin -uroot password 数据库密码

/usr/local/mysql/bin/mysql -uroot -p

Enter password:

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 2

Server version: 5.0.56-log Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

ps -e | grep mysqld

23721 pts/1    00:00:00 mysqld_safe

23744 pts/1    00:00:00 mysqld

netstat -tuplna | grep mysql

tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      23744/mysqld

tar zxvf httpd-2.2.11.tar.gz

cd httpd-2.2.11

./configure --prefix=/usr/local/apache--enable-so --enable-rewrite

make

make install

/usr/local/apache/bin/apache restart

ps -e | grep httpd

31471 ?        00:00:00 httpd

31480 ?        00:00:00 httpd

31481 ?        00:00:00 httpd

31482 ?        00:00:00 httpd

31483 ?        00:00:00 httpd

31484 ?        00:00:00 httpd

netstat -tuplna | grep httpd

tcp        0      0 :::80                       :::*                        LISTEN      31471/httpd

tar zxvf jpegsrc.v8b.tar.gz

cd jpeg-8b

./configure

make

make install

tar zxvf php-5.3.6.tar.gz

cd php-5.3.6

./configure --prefix=/usr/local/php

--with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache/bin/apxs

--with-mcrype --enable-mbstring

make

make install

cp php.ini-development /usr/local/php/lib/php.ini

vim /usr/local/apache/conf/httpd.conf


找到

#AddType application/x-gzip .tgz

改为

AddType application/x-gzip .tgz

AddType application/x-httpd-php .php


/usr/local/apache/bin/apachect restart

touch /usr/local/apache/htdocs/index.php

vim /usr/local/apache/htdocs/index.php

<?php

phpinfo();

?>

http://服务器ip/index.php

163317345.png

tar zxvf phpMyAdmin-3.2.5-all-languages.tar.gz

mv phpMyAdmin-3.2.5-all-languages /usr/local/apache/htdocs/phpmyadmin

cd /usr/local/apache/htdocs/phpmyadmin

cp phpmyadmin/config.sample.inc.php config.inc.php

vim config.inc.php


找到

$cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

改为

$cfg['blowfish_secret'] = 'haha'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */


/usr/local/apache/bin/apachectl restart

http://服务器ip/phpmyadmin

203721333.png

输入数据库用户 密码 root  密码为自己设置

204002741.png

vim /usr/local/apache/conf/httpd.conf


找到

AddType application/x-gzip .tgz

AddType application/x-httpd-php .php

改为

AddType application/x-gzip .tgz

AddType application/x-httpd-php .php

AddType application/x-compress .Z

AddType application/x-httpd-php-source  .phps


找到

<IfModule dir_module>

DirectoryIndex index.html

</IfModule>

改为

<IfModule dir_module>

DirectoryIndex index.html index.php

</IfModule>


找到

#ServerName
www.example.com:80

改为

ServerName www.example.com:80


找到

AllowOverride None    117行

改为

AllowOverride All


找到

AllowOverride None   152行

改为

AllowOverride All


找到

AllowOverride None  269行

改为

AllowOverride All


cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/httpd  

vim /etc/rc.d/init.d/httpd


找到

#!/bin/sh

#

更改为

#!/bin/sh

#chkconfig:35 70 30

#description:Apache


安装Discuz

mv upload /usr/local/apache/htdocs/uc

cd /usr/local/apache/htdocs/

http://服务器ip/uc/install

204835503.png


修改

vim /usr/local/php/lib/php.ini

找到

; http://php.net/short-open-tag

short_open_tag = Off

改为

; http://php.net/short-open-tag

short_open_tag = On

/usr/local/apache/bin/apachectl restart


222207665.png

223314386.png

cd /usr/local/apache/htdocs/uc/

chown -R 777 data / .

225839459.png

无需重启apachect,只要刷新就行了

230015351.png

这里只要输入,数据库密码和创始人的密码就可以了

230145596.png

230236838.png

输入创始人的密码

230401670.png

upload文件复制到/usr/local/apache/htdocs下,并改名为bbs

mv upload /usr/local/apache/htdocs/bbs

cd /usr/local/apache/htdocs/

ls

bbs  index.html  index.php  phpmyadmin  uc

/usr/local/apache/htdocs/bbs

chmod 777 config.inc.php

chmod 777 attachments

chmod 777 forumdata/

chmod 777 forumdata/cache/

chmod 777 forumdata/templates/

chmod 777 forumdata/threadcaches/

chmod 777 forumdata/logs/

chmod 777 uc_client/data/cache/


http://服务器ip/uc

231403136.png

应用管理-添加新应用

231644958.png

点击-安装

231745504.png

231843809.png

点击下一步

232031906.png

232134492.png

232235323.png

http://服务器ip/bbs,来访问论坛

抱歉!评论已关闭.