淺析centos8中安裝禪道的步驟(附代碼)

之前的文章《關于CentOS YAPI部署(代碼分享)》中,給大家介紹了CentOS安裝配置的問題。下面本篇文章給大家了解centos8中安裝禪道的步驟,有一定的參考價值,有需要的朋友可以參考一下,希望對你們有所助。

淺析centos8中安裝禪道的步驟(附代碼)

環境

CentOS 8 + 禪道15.x + Nginx + Mysql + PHP

PHP配置

centos自帶的有php環境

sudo?dnf?module?list?php?#?查看版本,默認7.2

安裝php7.2以及所需組件

sudo?dnf?install?php?php-pdo?php-gd?php-mbstring?php-mysqlnd?php-ldap?php-json?php-xml?php-zip

重啟服務

systemctl?start?php-fpm.service?#開啟 systemctl?status?php-fpm.service??#查看狀態 systemctl?enable?php-fpm.service??#開機啟動

權限配置,編輯www.conf

vi?/etc/php-fpm.d/www.conf

找到做修改

user?=?(非root?用戶) group?=?(非root?用戶)

這里沒配好 503,500

注意這里使用端口和非端口的區別,和下面nignx配置對應

;listen?=?/run/php-fpm/www.sock listen?=?9000

配置好了重啟

systemctl?restart?php-fpm.service

Mysql安裝配置

安裝mariadb

dnf?-y?install?mariadb?mariadb-server? systemctl?start?mariadb.service?#?開啟服務? systemctl?enable?mariadb.service?#?開機啟動?  systemctl?status?mariadb.service?#?查看服務狀態 systemctl?stop?mariadb.service?#?關閉服務

mariadb 為mysql分支

數據庫安裝設置,重置數據庫root賬號密碼,執行該命令前必須開啟mariadb服務。

mysql_secure_installation?  Enter?current?password?for?root?(enter?for?none):?輸入當前root賬號密碼,剛安裝默認為空,直接回車即可? Set?root?password??[Y/n]?是否輸入root密碼,輸入y?回車? New?password:?輸入密碼? Re-enter?new?password:?重復輸入? Remove?anonymous?users??[Y/n]?刪除其他用戶?y? Disallow?root?login?remotely??[Y/n]?允許root賬號遠程登錄?y? Remove?test?database?and?access?to?it??[Y/n]?刪除測試表?y? Reload?privilege?tables?now??[Y/n]?重新加載配置表?y  登陸測試,執行如下命令并輸入密碼。 mysql?-uroot?-p

mariadb的遠程鏈接配置

select?User,?host?from?mysql.user;

輸出

+------+-----------+ |?User?|?host??????| +------+-----------+ |?root?|?127.0.0.1?| |?root?|?::1???????| |?root?|?localhost?| +------+-----------+

允許外部ip連接

GRANT?ALL?PRIVILEGES?ON?*.*?TO?'root'@'%'?IDENTIFIED?BY?'password'?WITH?GRANT?OPTION;

輸出

+------+-----------+ |?User?|?host??????| +------+-----------+ |?root?|?%?????????| |?root?|?127.0.0.1?| |?root?|?::1???????| |?root?|?localhost?| +------+-----------+

允許單獨的ip鏈接

GRANT?ALL?PRIVILEGES?ON?*.*?TO?'root'@'192.168.100.%'?IDENTIFIED?BY?'my-new-password'?WITH?GRANT?OPTION;

最后一步還需要配置防火墻 / 安全策略組,開放3306 端口

安裝禪道v15.x

下載地址:http://www.zentao.net/download.html

wget?https://www.zentao.net/dl/zentao/15.0.3/ZenTaoPMS.15.0.3.zip  dnf?-y?install?unzip?#?安裝unzip解壓?,有就不裝 unzip?ZenTaoPMS.11.5.stable.zip?#?解壓禪道源碼包

Nginx綁定域名

yum?install?nginx?#?有就跳過 systemctl?start?nginx.service

權限

vi?/etc/nginx/nginx.conf

找到

user?=?root

代理配置

vi?/etc/nginx/conf.d/zentao.conf  server{ ??server_name?xxx.com; ??client_max_body_size?1000M;  ??root?/home/[user]/www/zentaopms/www;  ??location?/?{ ????root?/home/{user}/www/zentaopms/www; ????index?index.php?index.html?index.htm; ??}  ??location?~?.*.php$?{ ????fastcgi_pass???127.0.0.1:9000;?#注意這里和php?配置對應 ????#fastcgi_pass??unix:/run/php-fpm/www.sock? ????fastcgi_index??index.php; ????fastcgi_param?SCRIPT_FILENAME?$document_root$fastcgi_script_name; ????fastcgi_param?PATH_INFO????????????????$fastcgi_script_name;? ????include????????fastcgi_params;???? ????include?fastcgi.conf;???????????? ??}?  ??#?https ??#listen?443?ssl;? ??#ssl_certificate	/etc/nginx/cer/fullchain.crt; ??#ssl_certificate_key?/etc/nginx/cer/private.pem; ??#ssl_protocols?TLSv1.1?TLSv1.2; ??#ssl_ciphers?ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE; ??#ssl_prefer_server_ciphers?on; ??#ssl_session_cache?shared:SSL:10m; ??#ssl_session_timeout?10m; }  #server{ #??if?($host?=?xxx.com)?{ #??????return?301?https://$host$request_uri; #??}? #??server_name?xxx.com; #??listen?80; #??return?404;? #}

重啟服務

nginx?-s?reload

完工!

推薦學習:CentOS教程

? 版權聲明
THE END
喜歡就支持一下吧
點贊7 分享