Centos下安装Discuz!
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Centos下安装Discuz!相关的知识,希望对你有一定的参考价值。
[[email protected] ~]# mkdir /data/www
[[email protected] ~]# cd /data/www
[[email protected] www]# wget http://download.comsenz.com/DiscuzX/3.2/Discuz_X3.2_SC_GBK.zip
[[email protected] www]# unzip Discuz_X3.2_SC_GBK.zip //解压
[[email protected] www]# ls
Discuz_X3.2_SC_GBK.zip readme upload utility //程序存放在upload目录下
[[email protected] www]# mv upload/* ./ (把upload目录的文件全部出来)
[[email protected] www]# rm -rf readme/ utility/ upload/ Discuz_X3.2_SC_GBK.zip //把多余的目录删掉
//检查apache是否启动 ,下图表示未启动
//下面开始配置虚拟主机:
按esc键,按/键,输入vhosts, //搜索到此文件。
//虚拟主机的配置文件在conf目录下的extra目录下去掉#号
Include conf/extra/httpd-vhosts.conf
//按esc,:wq 保存退出
//此文件已生效加载。
//编辑虚拟主机配置文件
编辑成如下图:
检查文件是否有错
[[email protected] www]# /usr/local/apache2/bin/apachectl -t
Syntax OK
vim /usr/local/apache2/conf/httpd.conf
/ServerName //搜索此文件
ServerName www.example.com:80 //去掉#号,保存退出ok.
//配置hosts文件 (解析ip,dns服务的意思)
[[email protected] www]# vim /etc/hosts
//ping 百度,在本地生效。
在windows下找到hosts文件,编辑192.168.1.105 www.test.com www.aaa.com 保存退出
[[email protected] www]# vim /usr/local/apache2/conf/httpd.conf
//改成如下图:
[[email protected] www]# /usr/local/apache2/bin/apachectl -t
Syntax OK
[[email protected] www]# /usr/local/apache2/bin/apachectl restart
[[email protected] www]#
//在ie里运行 www.test.com 图1
图2:
图3:
[[email protected] www]# chown -R daemon config data uc_client/data uc_server/data //此目录文件权限改为可写状态
[[email protected] www]#
//刷新ie就可以了。
//下一步
//第一次安装,直接下一步即可。
//配置数据库:
[[email protected] /]# whereis mysql // 查找以前配置的mysql路径
mysql: /usr/lib64/mysql /usr/local/mysql /usr/share/mysql
[[email protected] /]# rpm -qa |grep mysql* //查看mysql包名
mysql-libs-5.1.73-5.el6_6.x86_64
[[email protected] /]# yum remove mysql //卸载以前配置的mysql,因为discuz自带数据库
//如果想直接使用mysql,需要编辑环境变量。
[[email protected] www]# mysql
-bash: mysql: command not found
[[email protected] www]# vim /etc/profile.d/path.sh
//编辑内容如下:
[[email protected] www]# source !$
source /etc/profile.d/path.sh
[[email protected] 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
[[email protected] www]# which mysql
/usr/local/mysql/bin/mysql
[[email protected] 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)
//下一步,处理完后如下图所示:
点击 您的论坛已完成安装,点此访问
本文出自 “11068581” 博客,请务必保留此出处http://11078581.blog.51cto.com/11068581/1742581
以上是关于Centos下安装Discuz!的主要内容,如果未能解决你的问题,请参考以下文章
CentOS 6.5下安装discuz时,提示462错误的解决方案