安装Discuz

回复 收藏
1、官网下载Discuz

mkdir  /data/www

cd  /data/www

wget http://download.comsenz.com/DiscuzX/3.2/Discuz_X3.2_SC_GBK.zip

unzip Discuz_X3.2_SC_GBK.zip

mv  upload/*  ./    把 upload目录里的文件都复制到 /data/www

[root@cindy www]# rm -rf readme/ utility/ upload/ Discuz_X3.2_SC_GBK.zip   (需要把多余的目录和包删掉)

2、配置虚拟主机

[root@cindy www]# vim /usr/local/apache2/conf/httpd.conf  (配置apache配置文件)

Include conf/extra/httpd-vhosts.conf   打开这个配置

[root@cindy www]# vim /usr/local/apache2/conf/extra/httpd-vhosts.conf (编辑虚拟主机配置文件)



删掉框选部分



    ServerAdmin webmaster@dummy-host.example.com (管理员邮箱,把这行去掉)
    DocumentRoot "/usr/local/apache2/docs/dummy-host.example.com" (引号里改为/data/www   DocumentRoot 是主目录,或者说网站根目录)  
    ServerName dummy-host.example.com  ( servername 自己随意改一个,例如www.test.com)
    ServerAlias www.dummy-host.example.com (ServerName 的别名,同样随意取,www.aaa.com)
    ErrorLog "logs/dummy-host.example.com-error_log"(错误日志)
    CustomLog "logs/dummy-host.example.com-access_log" common(访问日志)   错误日志和访问日志暂时先不配置,先注释掉  

配置好如下


    DocumentRoot "/data/www"
    ServerName www.test.com
    ServerAlias www.aaa.com
   # ErrorLog "logs/dummy-host.example.com-error_log"
   # CustomLog "logs/dummy-host.example.com-access_log" common
(虚拟主机)

[root@cindy www]# /usr/local/apache2/bin/apachectl -t (查看语法是否正确)
Syntax OK
如果出现提示没有确定,ServerName的提示,就去主配置文件/usr/local/apache2/conf/httpd.conf 中 把ServerName 这行启动,不启动也没什么影响

3、配置hosts  (/编辑etc/hosts,加入一行 ip  域名,则ping域名的时候就解析到相对应的ip,如 192.168.1.104  www.hao123.com  当我ping  hao123的时候其实是解析到我的虚拟机192.168.1.104)

(1)打开windows的c盘/windows/System32/driver/etc/hosts,用记事本打开,加入

192.168.1.104   www.test.com    www.aaa.com   在windows尝试能否ping通

然后编辑主配置文件,vim /usr/local/apache2/conf/httpd.conf


    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all  (将    Deny改为Allow)

这样就可以用浏览器访问 虚拟机了,www.aaa.com,如果还不行就清除防火墙规则,iptables -F

(2)浏览器点击安装需要把红叉部分修改

[root@cindy www]# ps aux |grep http
root      2054  0.0  1.1  42640 12020 ?        Ss   May14   0:00 /usr/local/apache2/bin/httpd -k start
daemon    2186  0.0  1.0  43548 11192 ?        S    00:45   0:00 /usr/local/apache2/bin/httpd -k start
daemon    2187  0.0  0.9  42640 10288 ?        S    00:45   0:00 /usr/local/apache2/bin/httpd -k start

可以看到apache的进程是用daemon用户的身份在跑,那就将相应的目录属主改为daemon就行了

[root@cindy www]# chown -R daemon config/ data/ uc_server/data/ uc_client/data/

然后刷新浏览器发现好了


下一步默认全新安装





此处要先配置mysql

4、配置mysql

yum remove mysql   (卸载系统自带的mysql )

vim /etc/profile.d/path.sh (变量加入/usr/local/mysql/bin)

export PATH=$PATH:/usr/local/mysql/bin/  

source /etc/profile.d/path.sh

这样我们安装的mysql就可以直接使用了,不用绝对路径也不会和系统自带的mysql冲突

  配置

[root@cindy www]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.5.47-log MySQL Community Server (GPL)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create database   discuz;  (创建数据库)
Query OK, 1 row affected (0.01 sec)

mysql> grant all on discuz.* to 'cindy'@'localhost' identified by 'cindylinux';   授予cindy所有权限,密码是cindylinux
Query OK, 0 rows affected (0.04 sec)  




除了红色除外都保持默认,数据库名 改为discuz
数据用户名设置了cindy 数据密码用了cindylinux 管理密码设置了123456
2016-05-15 01:26 举报
已邀请:
0

hammel

赞同来自:

e额。怎么没有图片
0

q524827699

赞同来自:

感谢分享 已收藏
0

xiaoshuidi

赞同来自:

总结的很详细,我配置成功了

回复帖子,请先登录注册

退出全屏模式 全屏模式 回复
评分
可选评分理由: