CentOS 6.4 x64 Install TENGINE + Maraiadb + PHP-FPM + Discuz

System Environment: CentOS6.4×64

Installation: YUM Installation

TENGINE is a web server project initiated by Taobao. On the basis of TenGine, it adds a lot of advanced features and features for large visual websites. TENGINE performance and stability have been well inspected in large websites such as Taobao, Tmall Mall, etc. Its ultimate goal is to create an efficient, stable, safe, easy-to-use web platform.

TENGINE does not support direct calls or parses of external programs, all external programs (including PHP) must be called via the FastCGI interface. Fastcgi interface is Socket under Linux, (this socket can be a file socket, or IP socket). In order to call the CGI program, a FastCGi’s Wrapper (Wrapper can be understood as a program for starting another program), this Wrapper is bound to a fixed socket, such as ports or files SOCKET. When TENGINE sends the CGI request to this socket, Wrapper accepts the request, and then derives a new thread, this thread calls the interpreter or the external program to handle scripts and read the return data; then, wrapper will again The returned data passed through the FastCGI interface, passed along the fixed socket to TENGINE; finally, TENGINE sends the returned data to the client, which is the entire operation process of TENGINE + FASTCGI.

1. Install MariaDB

Because Oracle is further intense to Mysql closed source, many Internet companies have begun to seek alternatives to MySQL. MariaDB is a backward compatible database server. It contains all major open source storage engines. So it is recommended to use MariaDB

1. First uninstall the mysql database

[root @ tEngine ~] #Yum remove mysql mysql – *

2. Configure MariaDB installation source

Established mariadb.repo under /etc/yum.repos.d/, the content is as follows:

[root @ TENGINE ~] # vi /etc/yum.repos.d/mariadb.repo

[mariadb]

Name = Mariadb

BaseURL = HTTP : //yum.mariadb.org/10.0.4/centos6-AMD64/

gpgkey = http: //yum.mariadb.org/rpm-gpg-key-mariadb

gpgcheck = 1

3. Use YUM to install Mariadb

[Root @ TENGINE ~] #Yum -y Install Mariadb-Client Mariadb-Server Mariadb-Devel

4. Start database

[root @ TENGINE ~] #service mysql start

5. Modify the root password

[root @ TENGINE ~] # mysqladmin -UROOT Password ‘Password’

2. Close Selinux and Setting IPTable Firewall

1. Close Selinux

[root @ TENGINE ~ ] # vi / etc / selinux / config

Change SELINUX = EnForcing to SELINUX = Disable

[root @ TENGINE ~] #setenforce 0

Setting IPTable

[root @ TENGINE ~] # vi / etc / sysconfig / iptables

Increase

-AINPUT -M STATE –STATE NEW -M TCP -P TCP – Dport 80 -J Accept

-A Input -m State –State NEW -M TCP -P TCP – Dport 443 -J Accept

3. Add a nginx user

[root @ TENGINE ~] #GroupAdd Nginx

[root @ TENGINE ~] #useradd -s / sbin / nologin -g nginx nginx

4. Install PCRE

1. Download PCRE

[root @ TENGINE ~] #wget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.33/pcre-8.33.tar.gz

2. Install PCRE to support TenGine pseudo static

[root @ TENGINE ~] #TAR -ZXVF PCRE-8.33.TAR.GZ

[root @ TENGINE ~] #MKDIR / USR / Local / PCRE

[root @ TENGINE ~] #CD PCRE-8.33

[root @ TENGINE PCRE-8.33] #. / confiGure –prefix = / usr / local / pcre

[root @ TENGINE PCRE-8.33] #make

[root @ TENGINE PCRE-8.33] #make install

5. Download TENGINE1.51

[root@tenginepcre-8.33] #CD ~

[root @ TENGINE ~] #yum install openssl openssl-wevel

[root @ TENGINE ~] #Wget http://tengine.taobao.org/download/tengine-1.5.1.tar.gz

2. Install TENGINE

[root @ TENGINE ~] #mkdir / usr / local / nginx

[root @ TENGINE ~] #tar -zxvf tengine-1.5.1.tar.gz

[root @ TENGINE ~] #CD TENGINE-1.5.1

[root @ TENGINE TENGINE-1.5.1] # ./configure-prefix=/usr/local/nginx –with- HTTP_STUB_STATUS_MODULE –WITH-PCRE = / Root / PCRE-8.33

Note: – with-pcre = / root / pcre-8.33 points to the path of the source package decompressed, not the installed path, otherwise Error.

[Root@tenginetengine-1.5.1] #make

[root @ TENGINETENGINE-1.5.1] #make install

[10] [root @ TENGINE ~] #Chown nginx.nginx -r / usr / local / nginx / html

[root @ TENGINE ~] #CHMOD 700 -R / USR / local / nginx / html

6. Set TENGINE service

[root @ TENGINE ~] # VI / ETC / Rc.d / init.d / nginx

#! / bin / bash

# TENGINE Startup script # processname: Nginx

# PIDFile: /var/run/nginx.pid

# config: /usr/local/nginx/conf/nginx.conf

NGINXD =/usr/local/nginx/sbin/nginx

nginx_config = / usr / local / nginx / conf / nginx.conf

nginx_pid = / usr / local / nginx / logs / nginx.pid

RetVal = 0

“nginx”

# Source function library.

. /Etc/rc.d/init.d/functions

# source networking configuration.

. / Etc / sysconfig / network

# Check That Networking IS Up.

[-x $ nginxd] || EXIT 0

# start nginx daemons functions.

START () {

i

echo “tengine alleady running ….”

exit 1

(123)

echo -n $ “Starting $ PROG:”

Daemon $ nginxd -c $ {nginx_config}

RETVAL = $?

[$ RETVAL = 0] && touch / var / lock / subsys / nginx

returnid $ retral

}

# stop nginx Daemons Functions.

STOP () {

Echo -n $ “Stopping $ PROG:”

KillProc $ nginxd

RetVal = $?

Echo

[$ RETVAL = 0] && rm -f / var / lock / subsys / nginx /usr/local/nginx/logs/nginx.pid

}

Reload () {

Echo -n $ “Reloading $ PROG:”

#kill -hup `Cat $ {nginx_PID} `

KillProc $ nginxd -hup

RETVAL = $?

Echo

# See How We Weme Called

Case “$ 1” in

START

;;

STOP)

STOP

;;

Reload

Reload

;;

restart

STOP

;;

STATUS

STATUS $ PROG

RETVAL = $?

;;

ECHO $ ​​”Usage: $ PROG {Start | Stop | Restart | Reload | Status | Help}

EXIT 1

ESAC

[10] [root @ TENGINE ~] # chmod 775 /etc/rc.d/init.d/nginx

[Root @ TENGINE ~] # chkconfig nginx on

[root @ TENGINE ~] # service nginx start

7. Install PHP and related components

1. Install PHP

[root @ TenGine ~ #yum -y install php

2. Install the PHP component to support the PHP to support FastCGI mode

[root @ TENGINE ~] #YUM -Y Install PHP -mySQL PHP-GD LIBJPEG * PHP-IMAP PHP-LDAP PHP-ODBCPHP-PEAR PHP-XML PHP-XMLRPC PHP-MBSTRING PHP-BCMATH PHP-FPM

8. Integration Nginx PHP

[root @ TENGINE ~] #vi /usr/local/nginx/conf/nginx.conf

Remove the second line of comments and change nobody to Nginx

Worker_Processes is set according to the number of CPU

Remove the annotation of the 71 line to 77 rows, and replace / scripts to / usr / local / nginx / html

Note: The above / usr / local / nginx / html is the path to our PHP website

[root @ TENGINE ~] #vi /etc/php-fpm.d/www.conf

Change 39 rows and 41 lines of Apache to Nginx

9. Download Discuz Test Tengine, PHP and Mariadb

1. Test TENGINE

Enter http: // in the browser 175.102.13.55

2. Test PHP

[10] [root @ TENGINE ~] #vi /usr/local/nginx/html/index.php

?>

In the browser input http://175.102.13.55/index.php

3. Download Discuzx Test Mariadb

[root @ TENGINE ~] #Wget http://download.comsenz.com/discuzx/3.1/discuz_x3.1_sc_utf8.zip

[Root@tengine ~]# unzip discuz_x3. 1_SC_UTF8.ZIP

[root @ TENGINE ~] # mv upload / * / usr / local / nginx / html

[root @ TENGINE ~] # chown nginx.nginx -r / usr / Local / nginx / html

CentOS 6.4 x64 安装Tengine+MaraiaDB+php-fpm+Discuz

© Copyright Notice
THE END
Just support it if you like
like0
share
comment Grab the couch

Please log in to comment