Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ CentOS7 compile and install Tengine + PHP + MariaDB notes     - Ubuntu 14.10 PPA installed Android Studio (Linux)

- Mistakenly deleted redo log file group being given the lead to start the database ORA-03113 (Database)

- Varnish achieve page jump (Server)

- MongoDB relations, references, index query coverage (Database)

- Install the Red Hat Container Development Kit on OSX (Server)

- Linux kernel netpoll framework netconsole (Linux)

- Recovery from MySQL master data consistency summary (Database)

- Linux uses shared memory communication process synchronization Withdrawal (Programming)

- GRUB2 boot Ubuntu Manual (Linux)

- Improve WordPress performance (Server)

- Android Send HTTP POST requests (Programming)

- CentOS boot image to achieve semi-automatic installation (Linux)

- How to use secure FTP file transfer (Server)

- The new features of MySQL 5.7 Generated Column (index function) (Database)

- Configuration OpenOCD + FT2232 under Ubuntu (Linux)

- Oracle database on the hit rate of query summary (Database)

- Sysdig: system troubleshooting tool (Linux)

- Linux Mint 17.2 64 bit installation Docker and management software seagull (Linux)

- Ubuntu users Steam controller does not work solutions (Linux)

- Ubuntu and derived versions of the user how to install G Mic 1.5.8.5 (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 Bash script write CVS version control (Server)
- Verify the character set on MyCAT (Database)
- MySQL Tutorial: Some optimized for I / O memory areas (Database)
- SQL MySQL query table duplicate data (Database)
- Linux Change ssh port and disable remote root login at (Linux)
- Keepalived achieve high availability Nginx Reverse Proxy (Server)
- Oracle archive log deletion (Database)
- CentOS install Redis (Database)
- Linux System Getting Started Learning: complete installation on Debian or Ubuntu kernel source (Linux)
- Android Custom View step (Programming)
- Linux usage in echo (Linux)
- Docker study notes (Server)
- Automatic batch resolve dependencies problem locally installed rpm package (Linux)
- Java Foundation - Variables and data types (Programming)
- Ubuntu Apache2 setting, problem solving css, pictures, etc. can not be displayed (Server)
- Oracle 12c users create (Database)
- Android shutdown (reboot) process (Programming)
- LAN Deployment Docker-- from scratch to create your own private warehouse Docker (Linux)
- How to Install Redis server on CentOS 7 (Server)
- After installation of Debian 6.0 do a few things first (Linux)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.