Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ CentOS7 compile and install Tengine + PHP + MariaDB notes     - Oracle 12C with multi-column index (Database)

- Linux /var/spool/ insufficient clientmqueue space solutions (Linux)

- Linux Network Programming - raw socket instance: MAC Address Scanner (Programming)

- SUSE Linux network configuration and firewall configuration (Linux)

- The Java way to stop a thread of execution (Programming)

- MySQL 5.5 on master-slave copy filter (Database)

- Mac OS X systems create Ubuntu USB boot disk for the Mac (Linux)

- MySQL configuration file my.cnf increase the log file parameter error (Database)

- Java polymorphic methods inside constructors complete analysis (Programming)

- GRUB and Linux system repair (Linux)

- Internal class broadcasting needs public and static (Programming)

- CentOS 6.5 dual card configuration, one of the external network, a local area network connection (Linux)

- Linux productivity tools and tips (Linux)

- To compile and install Redis Linux and master-slave replication configuration (Database)

- Linux in order to make NMAP hide and seek with the firewall (Linux)

- Using monitoring tool dsniff (Linux)

- How VMware extend disk without rebooting the system (Linux)

- Some practical tips Linux (Linux)

- Teach you how to protect the Linux operating system security tips (Linux)

- Linux server data backup (Server)

 
         
  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:      
 
- Django1.8 return json json string and the string contents of the received post (Programming)
- How to install the client sqlplus under linux (Database)
- How to extend / remove swap partitions (Linux)
- Use OpenSSL for RSA encryption and decryption (Linux)
- Ubuntu UFW firewall settings Introduction (Linux)
- PPA on Ubuntu Linux installation Plank 0.8.0 (Linux)
- How to override the plain text files and directories soft connection in linux (Linux)
- Varnish achieve page jump (Server)
- Java garbage collection and heap memory layout (Programming)
- Computer security protection remove local and remote system log files (Linux)
- Oracle JDK installation under Ubuntu Linux (Linux)
- Try to use Lets Encrypt (Linux)
- Talk about Java EE Learning (Programming)
- Android imitation UC browser scroll up and down functions (Programming)
- Installation of Theano + CUDA under Ubuntu (Linux)
- Android Dynamic efficiency articles: a brilliant Loading Analysis and Implementation (Programming)
- Linux tar compressed exclude a folder (Linux)
- Linux Tutorial ---- fundamentals of data traffic redirection (Linux)
- Household use Linux Security (Linux)
- Rails project prepared some tips small experience (Linux)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.