安装Discuz论坛
1、下载并解压Discuz
Discuz下载地址:http://download.comsenz.com/DiscuzX/3.2/
[root@daixuan ~]# mkdir /data/www
[root@daixuan ~]# cd /data/www
[root@daixuan www]# wget http://download.comsenz.com/DiscuzX/3.2/Discuz_X3.2_SC_GBK.zip
[root@daixuan www]# ls
Discuz_X3.2_SC_GBK.zip
[root@daixuan www]# unzip Discuz_X3.2_SC_GBK.zip
[root@daixuan www]# ls
Discuz_X3.2_SC_GBK.zip readme upload utility 程序文件都在upload文件下
[root@daixuan www]# mv upload/* . 把upload目录下的所有文件移动到www目录下,删除其他所有文件
[root@daixuan www]# ls
admin.php crossdomain.xml index.php robots.txt upload
api data install search.php userapp.php
api.php Discuz_X3.2_SC_GBK.zip member.php source utility
archiver favicon.ico misc.php static
config forum.php plugin.php template
connect.php group.php portal.php uc_client
cp.php home.php readme uc_server
[root@daixuan www]# rm -rf readme/ utility/ upload/ Discuz_X3.2_SC_GBK.zip
2、修改Apache的配置文件和虚拟主机配置文件
[root@daixuan www]# vim /usr/local/apache2/conf/httpd.conf
#Include conf/extra/httpd-vhosts.conf #删除,生效虚拟主机配置文件
[root@daixuan www]# vim /usr/local/apache2/conf/extra/httpd-vhosts.conf
<VirtualHost *:80>
DocumentRoot "/data/www"
ServerName www.test.com
ServerAlias www.daixuan.com
# ErrorLog "logs/dummy-host.example.com-error_log"
# CustomLog "logs/dummy-host.example.com-access_log" common
</VirtualHost>
注:此处把另一行备用删除<VirtualHost *:80> 。。。。。</VirtualHost>
否则会有警告:
Warning: DocumentRoot [/usr/local/apache2/docs/dummy-host2.example.com] does not exist
[root@daixuan www]# /usr/local/apache2/bin/apachectl -t 查看apache配置有没有错误
Syntax OK
[root@daixuan www]# vim /etc/hosts
192.168.101.230 www.test.com www.daixuan.com www.daixuanlinux.com
Windows主机下修改host文件
C:\Windows\System32\drivers\etc\hosts
192.168.101.230 www.test.com www.daixuan.com www.daixuanlinux.com
Forbidden 403
You don't have permission to access / on this server.
[root@daixuan www]# vim /usr/local/apache2/conf/httpd.conf
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all 修改Deny-》Allow
</Directory>
重启apache服务
[root@daixuan www]# /usr/local/apache2/bin/apachectl restart
3、安装Discuz
打开浏览器,重新输入:www.test.com
默认跳转到install页面下
首先选择我同意,到下一步;
但是很多目录不可写,需要修改为可写,查原因并解决;
[root@daixuan www]# ps aux | grep http apache是以demon用户运行的
daemon 4026 0.0 0.5 31028 11576 ? S 20:44 0:00 /usr/local/apache2/bin/httpd -k graceful
daemon 4027 0.0 0.5 30204 10680 ? S 20:44 0:00 /usr/local/apache2/bin/httpd -k graceful
daemon 4028 0.0 0.5 30204 10684 ? S 20:44 0:00 /usr/local/apache2/bin/httpd -k graceful
daemon 4029 0.0 0.5 30068 10312 ? S 20:44 0:00 /usr/local/apache2/bin/httpd -k graceful
daemon 4030 0.0 0.5 30716 11236 ? S 20:44 0:00 /usr/local/apache2/bin/httpd -k graceful
daemon 4033 0.0 0.5 30204 10680 ? S 20:45 0:00 /usr/local/apache2/bin/httpd -k graceful
daemon 4034 0.0 0.5 30068 10140 ? S 20:45 0:00 /usr/local/apache2/bin/httpd -k graceful
daemon 4035 0.0 0.5 30068 10140 ? S 20:45 0:00 /usr/local/apache2/bin/httpd -k graceful
root 4050 0.0 0.0 6048 784 pts/0 S+ 20:48 0:00 grep http
root 26371 0.0 0.6 30068 12512 ? Ss Nov25 0:12 /usr/local/apache2/bin/httpd -k graceful
[root@daixuan www]# ls -l daemon用户对以下几个目录没有写权限,必须加上w权限,或者将属主改为daemon
总用量 116
drwxr-xr-x 2 root root 4096 6月 9 10:21 config
drwxr-xr-x 13 root root 4096 6月 9 10:21 data
drwxr-xr-x 6 root root 4096 6月 9 10:21 uc_client
drwxr-xr-x 13 root root 4096 6月 9 10:21 uc_server
[root@daixuan www]# chown -R daemon config/ data/ uc_client/ uc_server/ 将属主改为daemon
刷新网页,已经具有写权限
下一步;默认选择全新安装Discuz!X(含UCcenter Server),下一步;
这里需要先配置mysql数据库,需要先配置好mysql;
首先卸载centsos系统安装时自动安装的mysql
[root@daixuan www]# which mysql
/usr/bin/mysql
[root@daixuan www]# rpm -qf /usr/bin/mysql
mysql-5.1.73-5.el6_6.i686
[root@daixuan www]# yum remove mysql y确定卸载
[root@daixuan www]# mysql
-bash: mysql: command not found
设置手动安装的5.1的mysql为系统默认mysql
[root@daixuan www]# vim /etc/profile.d/path.sh
#!/bin/bash
export PATH=$PATH:/usr/local/mysql/bin
[root@daixuan www]# source !$
source /etc/profile.d/path.sh
[root@daixuan www]# which mysql
/usr/local/mysql/bin/mysql
[root@daixuan www]# mysql 创建数据库和数据库用户
mysql> create database discuz;
Query OK, 1 row affected (0.04 sec)
mysql> grant all on discuz.* to 'daixuan'@'localhost' identified by 'daixuanlinux'; 赋予discuz数据库所有表的权限给用户daixuan,密码:daixuanlinux
Query OK, 0 rows affected (0.12 sec)
输入Discuz论坛安装数据库和用户信息
填写数据库信息
数据库服务器:localhost
数据库名:discuz
数据库用户名:daiuxan
数据库密码:daixuanlinux
数据表前缀:pre_
系统信箱 Email:[email protected]
填写管理员信息
管理员账号:admin
管理员密码:daixuanlinux 自己随便设置
重复密码:daixuanlinux
管理员 Email:[email protected]
完成安装,Discuz论坛就建立好了!http://www.test.com/forum.php