天天看點

discuz一鍵安裝

最近心裡想自建一個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-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_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日志檢視到,當指令執行完畢以後,在最後出現如下類似,

其中

Zt6tVsiplJ-w

就是mysql的預設密碼。

在得到預設密碼以後必須要修改密碼,否則不能使用mysql資料庫,通過

登入mysql資料庫,接着執行修改密碼語句,如下,

其中

[email protected]

是新密碼,mysql要求密碼需要有一定的安全政策。

接着在浏覽器輸入

http://127.0.0.1

就可以看到discuz的安裝初始化界面了。

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

繼續閱讀