discuz一键安装

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/minicto/article/details/78155005

最近心里想自建一个bbs系统,网上找来了开源的discuz系统,这里记录下安装过程。

在centos7上执行下面命令,一键搞定,如果要使用nginx就执行下面这命令(注意,这是一条命令),

yum -y install vim net-tools unzip wget openssl php php-fpm php-mysql \
&& wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm \
&& rpm -ivh mysql57-community-release-el7-11.noarch.rpm \
&& yum -y install mysql-community-server \
&& wget http://nginx.org/packages/rhel/7/x86_64/RPMS/nginx-1.12.1-1.el7.ngx.x86_64.rpm \
&& rpm -ivh nginx-1.12.1-1.el7.ngx.x86_64.rpm \
&& wget http://download.comsenz.com/DiscuzX/3.4/Discuz_X3.4_SC_UTF8.zip \
&& unzip Discuz_X3.4_SC_UTF8.zip \
&& cp -r upload/* /usr/share/nginx/html \
&& chmod -R 777 /usr/share/nginx/html \
&& echo 'bind-address=127.0.0.1' >> /etc/my.cnf \
&& rm -rf /etc/nginx/conf.d/* \
&& wget -P /etc/nginx/conf.d http://static.xiaoqiangge.com/image/a0584d4d-51ad-4c22-8209-7328aedb7d8c.conf \
&& systemctl start mysqld \
&& systemctl start php-fpm \
&& chkconfig mysqld on && chkconfig php-fpm on \
&& grep 'temporary password' /var/log/mysqld.log \
&& nginx

如果要使用apache就使用下面命令,如下(注意,这是一条命令),

yum -y install vim net-tools unzip wget php php-fpm php-mysql httpd \
&& wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm \
&& rpm -ivh mysql57-community-release-el7-11.noarch.rpm \
&& yum -y install mysql-community-server \
&& wget http://download.comsenz.com/DiscuzX/3.4/Discuz_X3.4_SC_UTF8.zip \
&& unzip Discuz_X3.4_SC_UTF8.zip \
&& cp -r upload/* /var/www/html/ \
&& chmod -R 777 /var/www/html \
&& echo 'bind-address=127.0.0.1' >> /etc/my.cnf \
&& systemctl start mysqld \
&& systemctl start php-fpm \
&& systemctl start httpd \
&& chkconfig mysqld on && chkconfig php-fpm on && chkconfig httpd on \
&& grep 'temporary password' /var/log/mysqld.log

安装过程中使用的mysql是5.7版本,安装的时候默认带有密码,可以通过grep日志查看到,当命令执行完毕以后,在最后出现如下类似,

2017-10-03T07:16:53.950667Z 1 [Note] A temporary password is generated for root@localhost: Zt6tVsiplJ-w

其中Zt6tVsiplJ-w就是mysql的默认密码。

在得到默认密码以后必须要修改密码,否则不能使用mysql数据库,通过

mysql -u root -p Zt6tVsiplJ-w

登录mysql数据库,接着执行修改密码语句,如下,

ALTER USER 'root'@'localhost' IDENTIFIED BY 'Root@123';

其中Root@123是新密码,mysql要求密码需要有一定的安全策略

接着在浏览器输入http://127.0.0.1就可以看到discuz的安装初始化界面了。

原文地址:http://xiaoqiangge.com/aritcle/1507016536267.html

猜你喜欢

转载自blog.csdn.net/minicto/article/details/78155005