Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ CentOS7 compile and install Tengine + PHP + MariaDB notes     - Elixir: the future of programming languages (Programming)

- Safe learning through self-extracting package to achieve invasion (Linux)

- Hadoop configuration ssh automation of automation (Server)

- Grep, Ack, Ag searches Efficiency Comparison (Linux)

- How to view information about the installed version of CentOS (Linux)

- Lua study notes under ubuntu (Linux)

- BackTrack (BT3, BT4) Linux installation tutorial (Linux)

- Linux file permissions bit forced bits and adventure Comments (Linux)

- Linux security settings (Linux)

- Install Xshell on Mac OS X (Linux)

- 14.04.3 Ubuntu configuration and successfully compiled source code Android 6.0 r1 (Programming)

- Why did not Oracle privileges can also log in with sysdba (Database)

- Android Studio simple setup (Linux)

- Linux group account deletion, and other related operations (Linux)

- Hadoop 2.2.0 installation development environment (standalone pseudo-distributed mode) (Server)

- CentOS cross compiler core Raspberry Pi 2 (Linux)

- C ++ Fundamentals study notes (Programming)

- VNC configuration detailed analysis under Linux (Linux)

- How to upgrade to Oracle 11g Oracle 12c (Database)

- Make Windows boot disk to install USB in Ubuntu Linux (Linux)

 
         
  CentOS7 compile and install Tengine + PHP + MariaDB notes
     
  Add Date : 2017-08-31      
         
       
         
  Environment is CentOS 7 64bit, Updated 9 July 2014.512M virtual machine memory.
To update the system:

[Root @ abctest ~] # yum update -y
Install the necessary software:

[Root @ abctest ~] # yum install gcc automake autoconf libtool make gcc-c ++ zlib-devel openssl-devel vim which bzip2 -y
Compile and install pcre:

[Root @ abctest ~] # cd / usr / local / src /
[Root @ abctest src] # wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.35.tar.gz
[Root @ abctest src] # tar zvxf pcre-8.35.tar.gz
[Root @ abctest src] # cd pcre-8.35
[Root @ abctest pcre-8.35] #. / Configure
[Root @ abctest pcre-8.35] # make && make install
Compile and install openssl:

[Root @ abctest pcre-8.35] # cd / usr / local / src /
[Root @ abctest src] # wget http://www.openssl.org/source/openssl-1.0.1h.tar.gz
[Root @ abctest src] # tar zvxf openssl-1.0.1h.tar.gz
[Root @ abctest src] # cd openssl-1.0.1h
[Root @ abctest openssl-1.0.1h] #. / Config
[Root @ abctest openssl-1.0.1h] # make && make install
Compile and install zlib

[Root @ abctest openssl-1.0.1h] # cd / usr / local / src /
[Root @ abctest src] # wget http://zlib.net/zlib-1.2.8.tar.gz
[Root @ abctest src] # tar zvxf zlib-1.2.8.tar.gz
[Root @ abctest src] # cd zlib-1.2.8
[Root @ abctest zlib-1.2.8] #. / Configure
[Root @ abctest zlib-1.2.8] # make && make install
Compile and install jemalloc:

[Root @ abctest zlib-1.2.8] # cd / usr / local / src /
[Root @ abctest src] # wget http://www.canonware.com/download/jemalloc/jemalloc-3.6.0.tar.bz2
[Root @ abctest src] # tar jxvf jemalloc-3.6.0.tar.bz2
[Root @ abctest src] # cd jemalloc-3.6.0
[Root @ abctest jemalloc-3.6.0] #. / Configure
[Root @ abctest jemalloc-3.6.0] # make && make install
[Root @ abctest jemalloc-3.6.0] # echo '/usr/local/lib'>/etc/ld.so.conf.d/local.conf
[Root @ abctest jemalloc-3.6.0] # ldconfig
Www establish user groups and users, prohibit www login shell:
[Root @ abctest jemalloc-3.6.0] # groupadd www
[Root @ abctest jemalloc-3.6.0] # useradd -g www www
[Root @ abctest jemalloc-3.6.0] # usermod -s / sbin / nologin www
Create a virtual host directory, and given the appropriate permissions:

[Root @ abctest jemalloc-3.6.0] # mkdir -p /usr/www/example.com/{public_html,logs}
[Root @ abctest jemalloc-3.6.0] # chmod -R + w / usr / www /
[Root @ abctest jemalloc-3.6.0] # chown -R www: www / usr / www /
Compile and install Tengine:

[Root @ abctest jemalloc-3.6.0] # cd / usr / local / src /
[Root @ abctest src] # wget http://tengine.taobao.org/download/tengine-2.0.3.tar.gz
[Root @ abctest src] # tar zvxf tengine-2.0.3.tar.gz
[Root @ abctest src] # cd tengine-2.0.3
[Root @ abctest tengine-2.0.3] #. / Configure --prefix = / usr / local / nginx
--user = www --group = www
--with http_stub_status_module
--with-http_ssl_module
--with-http_gzip_static_module
--with-openssl = / usr / local / src / openssl-1.0.1h
--with-zlib = / usr / local / src / zlib-1.2.8
--with-pcre = / usr / local / src / pcre-8.35
--with-jemalloc
[Root @ abctest tengine-2.0.3] # make && make install
Modify nginx.conf file:

[Root @ abctest tengine-2.0.3] # mkdir / usr / local / nginx / conf / domains
[Root @ abctest tengine-2.0.3] # vim /usr/local/nginx/conf/nginx.conf
modify

#user nobody;
worker_processes 1;
#error_log logs / error.log;
#error_log logs / error.log notice;
#error_log logs / error.log info;
#pid logs / nginx.pid;
events {
worker_connections 1024;
}
for

user www www;
worker_processes 4;
error_log logs / error.log crit;
#error_log logs / error.log notice;
#error_log logs / error.log info;
pid logs / nginx.pid;
events {
use epoll;
worker_connections 65535;
}
modify

http {
include mime.types;
default_type application / octet-stream;
for

http {
include mime.types;
. Include domains / * conf;
default_type application / octet-stream;
: Wq Save
Test Nginx:

[Root @ abctest tengine-2.0.3] # cd / usr / local / nginx
[Root @ abctest nginx] # ldconfig
[Root @ abctest nginx] #. / Sbin / nginx -t
Export

the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
configuration file /usr/local/nginx/conf/nginx.conf test is successful
The test is successful
Add Nginx to start automatically at boot:

[Root @ abctest nginx] # vim /usr/lib/systemd/system/nginx.service
Join
[

Unit]
Description = The nginx HTTP and reverse proxy server
After = syslog.target network.target remote-fs.target nss-lookup.target
[Service]
Type = forking
PIDFile = / usr / local / nginx / logs / nginx.pid
ExecStartPre = / usr / local / nginx / sbin / nginx -t
ExecStart = / usr / local / nginx / sbin / nginx
ExecReload = / bin / kill -s HUP $ MAINPID
ExecStop = / bin / kill -s QUIT $ MAINPID
PrivateTmp = true
[Install]
WantedBy = multi-user.target
: Wq Save

[Root @ abctest nginx] # systemctl enable nginx
Close the default firewall:

[Root @ abctest nginx] # systemctl stop firewalld.service
[Root @ abctest nginx] # systemctl disable firewalld.service
Install iptables and open port 80

[Root @ abctest nginx] # yum install iptables-services -y
[Root @ abctest nginx] # vim / etc / sysconfig / iptables
increase

-A INPUT -p tcp -m state --state NEW -m tcp --dport 80-j ACCEPT
Because this VPS SSH port 60000, modify

-A INPUT -p tcp -m state --state NEW -m tcp --dport 22-j ACCEPT
for

-A INPUT -p tcp -m state --state NEW -m tcp --dport 60000-j ACCEPT
: Wq Save
Restart iptables and set at startup:

[Root @ abctest nginx] # systemctl restart iptables.service
[Root @ abctest nginx] # systemctl enable iptables.service
Install MariaDB:

[Root @ abctest nginx] # cd /etc/yum.repos.d/
[Root @ abctest yum.repos.d] # vim MariaDB.repo
enter

# MariaDB 10.0 CentOS repository list - created 2014-09-30 09:33 UTC
# Http://mariadb.org/mariadb/repositories/
[Mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.0/centos7-amd64
gpgkey = https: //yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck = 1
: Wq Save

[Root @ abctest yum.repos.d] # yum install MariaDB-server MariaDB-client -y
Error, there is a conflict package, deleted

[Root @ abctest yum.repos.d] # rpm -ev net-snmp-1: 5.7.2-18.el7.x86_64
[Root @ abctest yum.repos.d] # rpm -ev mariadb-libs-1: 5.5.37-1.el7_0.x86_64
Install

[Root @ abctest yum.repos.d] # yum install MariaDB-server MariaDB-client -y
success
MariaDB start the service and add at startup:

[Root @ abctest yum.repos.d] # service start mysql
[Root @ abctest yum.repos.d] # chkconfig mysql on
Install the necessary applications to compile PHP:

[Root @ abctest yum.repos.d] # yum install -y gcc gcc-c ++ autoconf libjpeg libjpeg-devel libpng
libpng-devel freetype freetype-devel libpng libpng-devel
libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel
glib2 glib2-devel bzip2 bzip2-devel ncurses curl openssl-devel
gdbm-devel db4-devel libXpm-devel libX11-devel gd-devel
gmp-devel readline-devel libxslt-devel expat-devel xmlrpc-c xmlrpc-c-devel file
Compile and install libmcrypt:

[Root @ abctest yum.repos.d] # cd / usr / local / src /
[Root @ abctest src] # wget https://vps.googlecode.com/files/libmcrypt-2.5.8.tar.gz
[Root @ abctest src] # tar zxvf libmcrypt-2.5.8.tar.gz
[Root @ abctest src] # cd libmcrypt-2.5.8
[Root @ abctest libmcrypt-2.5.8] #. / Configure
[Root @ abctest libmcrypt-2.5.8] # make && make install
Compile and install PHP:

[Root @ abctest libmcrypt-2.5.8] # cd / usr / local / src /
[Root @ abctest src] # wget http://cn2.php.net/distributions/php-5.6.0.tar.gz
[Root @ abctest src] # tar zxvf php-5.6.0.tar.gz
[Root @ abctest src] # cd php-5.6.0
[Root @ abctest php-5.6.0] #. / Configure --prefix = / usr / local / php-5.6.0
--with-mysql --with-mysql-sock
--with-mysqli --enable-fpm --enable-soap
--with-libxml-dir --with-openssl --with-mcrypt
--with-mhash --with-pcre-regex --with-sqlite3
--with-zlib --enable-bcmath
--with-iconv --with-bz2 --enable-calendar
--with-curl --with-cdb --enable-dom --enable-exif --enable-fileinfo --enable-filter
--with-pcre-dir --enable-ftp --with-gd --with-openssl-dir
--with-jpeg-dir --with-png-dir --with-zlib-dir
--with-freetype-dir --enable-gd-native-ttf --enable-gd-jis-conv
--with-gettext --with-gmp --with-mhash --enable-json --enable-mbstring
--disable-mbregex --disable-mbregex-backtrack --with-libmbfl
--with-onig --enable-pdo --with-pdo-mysql --with-zlib-dir
--with-pdo-sqlite --with-readline --enable-session --enable-shmop
--enable-simplexml --enable-sockets --enable-sysvmsg --enable-sysvsem
--enable-sysvshm --enable-wddx --with-libxml-dir --with-xsl --enable-zip
--enable-mysqlnd-compression-support --with-pear --disable-fileinfo
Because only 512M of memory so the addition --disable-fileinfo, otherwise the compilation error

[Root @ abctest php-5.6.0] # make && make install
Copy the configuration file:

[Root @ abctest php-5.6.0] # cp /usr/local/php-5.6.0/etc/php-fpm.conf.default/usr/local/php-5.6.0/etc/php-fpm.conf
[Root @ abctest php-5.6.0] # cp /usr/local/src/php-5.6.0/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
[Root @ abctest php-5.6.0] # cp /usr/local/src/php-5.6.0/php.ini-production /usr/local/php-5.6.0/lib/php.ini
Modify the configuration file:

[Root @ abctest php-5.6.0] # vim /usr/local/php-5.6.0/etc/php-fpm.conf
These values find modifications

pm.max_children = 50
pm.start_servers = 20
pm.min_spare_servers = 5
pm.max_spare_servers = 35
Remove

; Pm.max_requests = 500
Comment and
: Wq Save
Setting php-fpm at startup

[Root @ abctest php-5.6.0] # chmod a + x /etc/init.d/php-fpm
[Root @ abctest php-5.6.0] # chkconfig php-fpm on
The PHP environment variable added to the bin directory:

[Root @ abctest php-5.6.0] # chmod + x / etc / profile
[Root @ abctest php-5.6.0] # vim /etc/profile.d/php.sh
Join

PATH = $ PATH: /usr/local/php5.6.0/bin
export PATH
: Wq Save

[Root @ abctest php-5.6.0] # chmod + x /etc/profile.d/php.sh
[Root @ abctest php-5.6.0] # source / etc / profile
[Root @ abctest php-5.6.0] # ln -s /usr/local/php-5.6.0/sbin/php-fpm / bin / php-fpm
Create a site profile:

[Root @ abctest php-5.6.0] # vim /usr/local/nginx/conf/domains/example.com.conf
enter

server {
server_name example.com;
listen 80;
root /usr/www/example.com/public_html;
access_log /usr/www/example.com/logs/access.log;
error_log /usr/www/example.com/logs/error.log;
index index.php;
location / {
try_files $ uri $ uri // index.php q = $ uri & $ args?;
}
location ~ * \. (jpg | jpeg | gif | css | png | js | ico | html) $ {
access_log off;
expires max;
}
location ~ / \. ht {
deny all;
}
location ~ \ .php $ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $ document_root $ fastcgi_script_name;
include / usr / local / nginx / conf / fastcgi_params;
}
}
: Wq Save
Restart VPS:

[Root @ abctest php-5.6.0] # reboot
     
         
       
         
  More:      
 
- Use SVN to automatically deploy code under Apache (Server)
- MongoDB query timeout exception SocketTimeoutException (Database)
- Linux operating system security can not be ignored (Linux)
- Xshell key authentication mechanism using a remote login Linux (Linux)
- How to choose the correct HTTP status code (Server)
- CentOS 6.6 command-line automatic completion (Linux)
- Linux System Getting Started Learning: The Linux command line burn ISO or NRG image to DVD (Linux)
- Taught you how to build your own VPS server (Server)
- Use Oracle 11g show spparameter command (Database)
- Linux static library generated Guide (Programming)
- To install the Oracle 10.2.0.1.0 process notes on Oracle Linux 4u4 (Database)
- Linux common network tools: hping Advanced Host Scan (Linux)
- Binding unofficial Google Drive and Ubuntu 14.04 LTS (Linux)
- Linux check disk parameters trapping lack amendments (Linux)
- Windows Server 2012 R2 Datacenter install SQL Server 2016 CTP (Database)
- CentOS 7 server environment to quickly build Linux (Server)
- Java Virtual Machine Basics (Programming)
- SUSE Linux network configuration and firewall configuration (Linux)
- Ubuntu 14.04 Install WordPress on Nginx (Server)
- Gentoo: startx problem appears Failed to load module (Linux)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.