標籤:ip地址 discuz 伺服器 網路 centos 7
一、安裝tengine+php+mariadb環境
1、配置網路
nmcli c del ‘System eth0‘ # 刪除網路
nmcli c add con-name myeth0 ifname eth0 typeethernet ip4 172.16.10.133/24 gw4 172.16.10.254 #配置IP地址以及網關
nmcli c mod myeth0 ipv4.dns"223.5.5.5,223.6.6.6" #設定DNS伺服器
systemctl disable nfs.target #關閉不需要的服務
systemctl disable iscsid.socket #關閉不需要的服務
systemctl disable iscsiuio.socket#關閉不需要的服務
systemctl disable firewalld #關閉不需要的服務
sed -i ‘s/^SELINUX=.*/SELINUX=disabled/‘ /etc/selinux/config
查詢selinux是否關閉:sestatus
檢查網路連通性ping www.sohu.com
重啟系統reboot
2、安裝PHP環境
yum install -y php.x86_64 php-bcmath.x86_64php-cli.x86_64 php-common.x86_64 php-dba.x86_64 php-embedded.x86_64 php-fpm.x86_64php-gd.x86_64 php-intl.x86_64 php-mbstring.x86_64 php-mysql.x86_64php-pdo.x86_64 php-pear.noarch php-pspell.x86_64 php-recode.x86_64php-soap.x86_64 php-xml.x86_64 php-pecl-memcache.x86_64
sed -i ‘s/apache/nginx/g‘ /etc/php-fpm.d/www.conf
systemctl enable php-fpm #開啟系統自啟動
systemctl start php-fpm #開啟服務
3、安裝Mariadb資料庫(Mysql的分支)
yum install -y mariadb-server mariadb-libsmariadb
systemctl enable mariadb
systemctl start mariadb
systemctl status mariadb #查看服務啟動狀態
4、安裝Tengine環境
cd
wget (安裝wget yum -y installwget) http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/7/x86_64/e/epel-release-7-2.noarch.rpm
rpm -ivh epel-release-7-2.noarch.rpm
yum -y install GeoIP gd gperftools-libs
rpm -ivhtengine-1.5.2-1.el7.centos.x86_64.rpm
chgrp nginx /var/lib/php/session/
systemctl enable nginx
systemctl start nginx
5、檢查連接埠 yum -yinstall net-tools #安裝netstat,ifconfig
netstat -lnp|egrep ‘(80|9000|3306)‘
應該看到下面3連接埠在監聽網路
[[email protected] ~]# netstat -lnp|egrep‘(80|9000|3306)‘
tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 1425/php-fpm: maste
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 1098/mysqld
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1392/nginx: master
nginx -t 檢測程式是否正常
設定網站許可權 chown -R nginx:nginx /srv/www/
如果有問題請加QQ:116116130 備忘:centos 7 -51cto
本文出自 “掌握核心技術” 部落格,請務必保留此出處http://smallxjd.blog.51cto.com/3203597/1587248
CentOS 7搭建tengine+php+mariadb環境並安裝discuz論壇