Centos下安装Discuz!
admin
2023-05-04 16:41:42
0

[root@ajing ~]# mkdir /data/www

[root@ajing ~]# cd /data/www

[root@ajing www]# wget http://download.comsenz.com/DiscuzX/3.2/Discuz_X3.2_SC_GBK.zip  

 

[root@ajing www]# unzip Discuz_X3.2_SC_GBK.zip   //解压

[root@ajing www]# ls

Discuz_X3.2_SC_GBK.zip  readme  upload  utility    //程序存放在upload目录下


[root@ajing www]# mv upload/* ./   (把upload目录的文件全部移出来)

Centos下安装Discuz!

[root@ajing www]# rm -rf readme/ utility/ upload/ Discuz_X3.2_SC_GBK.zip  //把多余的目录删掉

Centos下安装Discuz!

//检查apache是否启动 ,下图表示未启动

Centos下安装Discuz!

//下面开始配置虚拟主机:

Centos下安装Discuz!

按esc键,按/键,输入vhosts,  //搜索到此文件。

Centos下安装Discuz!

//虚拟主机的配置文件在conf目录下的extra目录下去掉#号

Include conf/extra/httpd-vhosts.conf

//按esc,:wq 保存退出

//此文件已生效加载。

Centos下安装Discuz!

//编辑虚拟主机配置文件

Centos下安装Discuz!

编辑成如下图:

Centos下安装Discuz!

检查文件是否有错

[root@ajing www]# /usr/local/apache2/bin/apachectl -t

Syntax OK

 vim /usr/local/apache2/conf/httpd.conf

/ServerName   //搜索此文件

Centos下安装Discuz!

ServerName www.example.com:80   //去掉#号,保存退出ok.

//配置hosts文件 (解析ip,dns服务的意思)

Centos下安装Discuz!

[root@ajing www]# vim /etc/hosts

Centos下安装Discuz!

//ping 百度,在本地生效。

在windows下找到hosts文件,编辑192.168.1.105 www.test.com www.aaa.com  保存退出


[root@ajing www]# vim /usr/local/apache2/conf/httpd.conf

Centos下安装Discuz!

//改成如下图:

Centos下安装Discuz!

[root@ajing www]# /usr/local/apache2/bin/apachectl -t

Syntax OK

[root@ajing www]# /usr/local/apache2/bin/apachectl restart

[root@ajing www]#

 

//在ie里运行 www.test.com  图1

Centos下安装Discuz!

图2:

Centos下安装Discuz!

图3:

Centos下安装Discuz!


Centos下安装Discuz!//表示apache以daemon用户身份运行

Centos下安装Discuz!

[root@ajing www]# chown -R daemon config data uc_client/data uc_server/data   //此目录文件权限改为可写状态

[root@ajing www]#


//刷新ie就可以了。

Centos下安装Discuz!

//下一步

Centos下安装Discuz!

//第一次安装,直接下一步即可。


//配置数据库:

Centos下安装Discuz!

[root@ajing /]# whereis mysql    // 查找以前配置的mysql路径

mysql: /usr/lib64/mysql /usr/local/mysql /usr/share/mysql

[root@ajing /]# rpm -qa |grep mysql*   //查看mysql包名

mysql-libs-5.1.73-5.el6_6.x86_64

[root@ajing /]# yum remove mysql   //卸载以前配置的mysql,因为discuz自带数据库

//如果想直接使用mysql,需要编辑环境变量。

[root@ajing www]# mysql

-bash: mysql: command not found

[root@ajing www]# vim /etc/profile.d/path.sh

//编辑内容如下:

Centos下安装Discuz!


[root@ajing www]# source !$

source /etc/profile.d/path.sh

[root@ajing www]# mysql

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

Your MySQL connection id is 6

Server version: 5.1.73 MySQL Community Server (GPL)

Copyright (c) 2000, 2013, 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> quit

Bye

[root@ajing www]# which mysql

/usr/local/mysql/bin/mysql

[root@ajing www]# mysql

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

Your MySQL connection id is 7

Server version: 5.1.73 MySQL Community Server (GPL)

Copyright (c) 2000, 2013, 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.04 sec)

mysql> grant all on discuz.* to 'ajing'@'localhost' identified by 'ajing';  //为该库创建用户和密码

Query OK, 0 rows affected (0.06 sec)

mysql>

//以上参数配置ok后,编辑数据库信息。如下图:(此处管理员密码为123456)


Centos下安装Discuz!

//下一步,处理完后如下图所示:

Centos下安装Discuz!

点击 您的论坛已完成安装,点此访问


Centos下安装Discuz!

相关内容

热门资讯

时隔九年再度来京,特朗普有何诉... ◆5月12日,特朗普登上“空军一号”前对着镜头挥手告别。(图源:美联社)文/何平编辑/漆菲5月13日...
硬科技管控,中美关系的新压舱石 特朗普此次访华,英伟达CEO黄仁勋随行的消息提振美股市场,凸显芯片与人工智能已成为中美关系的核心议题...
报告:今年一季度AI原生APP... 中国青年网北京5月12日电(记者 高蕾)近日,第三方智能数据服务商QuestMobile发布了《中国...
七大新品发布!国轩高科第15届... 央广网合肥5月13日消息(记者徐鹏)5月16日至17日,电池龙头企业国轩高科将在合肥举办第15届全球...
百度伐谋2.0发布,李彦宏:能... 5月13日举办的Create2026百度AI开发者大会开幕式上,自我演化决策智能体百度伐谋升级至2....
泰顶级豪门曝性侵丑闻!哥哥侵犯... 泰国最有影响力的巨头之一Singha集团(胜狮集团),这两天爆出性侵丑闻。集团第四代成员,环保活动家...
什么信号?多地要求干部带头缴纳... 多地要求干部带头缴纳物业费。最近一段时间,物业费成了社会关注的焦点。原因竟然是多地密集出台文件,号召...
“这不是威胁而是绝佳机遇”,默... 【文/观察者网 张菁娟】“当下挑战之所以如此巨大,是因为我们长期以来为自己制造了太多问题,而这些问题...
老杜盟友半路杀出,“闪电夺权”... 最近两天,马尼拉的政治温度直接爆表。5月11日上午,菲律宾众议院以255票赞成、26票反对、9票弃权...
“六张网”项目密集启动 进一步... 新华社北京5月13日电 题:“六张网”项目密集启动 进一步释放内需潜力经济参考报记者汪子旭近期,一批...