Linux运维 --- 使用LNMP架构部署动态网站环境

在搭建LNMP架构之前先把yum软件仓库和gcc编译工具安装上,如果不知道怎么安装本地Yum源可以参考: 配置本地yum源

将下面的软件包都安装上:

[root@localhost ~]# yum install -y apr* autoconf automake bison bzip2 bzip2* compat* cpp curl curl-devel fontconfig fontconfig-devel freetype freetype* freetype-devel gcc gcc-c++ gd gettext gettext-devel glibc kernel kernel-headers keyutils keyutils-libs-devel krb5-devel libcom_err-devel libpng libpng-devel libjpeg* libsepol-devel libselinux-devel libstdc++-devel libtool* libgomp libxml2 libxml2-devel libXpm* libtiff libtiff* make mpfr ncurses* ntp openssl openssl-devel patch pcre-devel perl php-common php-gd policycoreutils telnet t1lib t1lib* nasm nasm* wget zlib-devel

................省略部分安装过程.....................

Running transaction
  正在安装    : zlib-devel-1.2.7-15.el7.x86_64                             1/77 
  正在安装    : compat-poppler022-0.22.5-4.el7.x86_64                      2/77 
  正在安装    : libibumad-1.3.10.2-1.el7.x86_64                            3/77 
  正在安装    : opensm-libs-3.3.19-1.el7.x86_64                            4/77 
  正在安装    : xorg-x11-proto-devel-7.7-12.el7.noarch                     5/77 
  正在安装    : expat-devel-2.1.0-8.el7.x86_64                             6/77 
  正在安装    : libXau-devel-1.0.8-2.1.el7.x86_64                          7/77 
  正在安装    : libxcb-devel-1.11-4.el7.x86_64                             8/77 
  正在安装    : libX11-devel-1.6.3-2.el7.x86_64                            9/77 
  正在安装    : freetype-devel-2.4.11-11.el7.x86_64                       10/77 
  正在安装    : 1:compat-glibc-2.12-4.el7.x86_64                          11/77 
  正在安装    : 1:compat-glibc-headers-2.12-4.el7.x86_64                  12/77 
  正在安装    : libcom_err-devel-1.42.9-7.el7.x86_64                      13/77 
  正在安装    : libmng-1.0.10-14.el7.x86_64                               14/77 
  正在安装    : libesmtp-1.0.6-7.el7.x86_64                               15/77 
  正在安装    : libverto-devel-0.2.5-4.el7.x86_64                         16/77 
  正在安装    : qt-settings-19-23.5.el7.noarch                            17/77 
  正在安装    : 1:qt-4.8.5-11.el7.x86_64                                  18/77 
  正在安装    : 1:qt-x11-4.8.5-11.el7.x86_64                              19/77 
  正在安装    : xz-devel-5.1.2-12alpha.el7.x86_64                         20/77 
  正在安装    : t1lib-5.1.2-14.el7.x86_64                                 21/77 
  正在安装    : cyrus-sasl-devel-2.1.26-19.2.el7.x86_64                   22/77 
  正在安装    : openldap-devel-2.4.40-8.el7.x86_64                        23/77 
  正在安装    : infinipath-psm-3.3-0.g6f42cdb1bb8.2.el7.x86_64            24/77 
  正在安装    : hwloc-libs-1.7-5.el7.x86_64                               25/77 
  正在安装    : libzip-0.10.1-8.el7.x86_64                                26/77 
  正在安装    : php-common-5.4.16-36.el7_1.x86_64                         27/77 
  正在安装    : libdb-devel-5.3.21-19.el7.x86_64                          28/77 
  正在安装    : compat-libcogl12-1.14.0-3.el7.x86_64                      29/77 
  正在安装    : compat-db-headers-4.7.25-28.el7.noarch                    30/77 
  正在安装    : 1:tcl-8.5.13-8.el7.x86_64                                 31/77 
  正在安装    : environment-modules-3.2.10-10.el7.x86_64                  32/77 
  正在安装    : pcre-devel-8.32-15.el7.x86_64                             33/77 
  正在安装    : apr-devel-1.4.8-3.el7.x86_64                              34/77 
  正在安装    : libsepol-devel-2.1.9-3.el7.x86_64                         35/77 
  正在安装    : libselinux-devel-2.2.2-6.el7.x86_64                       36/77 
  正在安装    : keyutils-libs-devel-1.5.8-3.el7.x86_64                    37/77 
  正在安装    : krb5-devel-1.13.2-10.el7.x86_64                           38/77 
  正在安装    : 1:openssl-devel-1.0.1e-42.el7_1.9.x86_64                  39/77 
  正在安装    : apr-util-devel-1.5.2-6.el7.x86_64                         40/77 
  正在安装    : compat-openmpi16-1.6.4-10.el7.x86_64                      41/77 
  正在安装    : compat-db47-4.7.25-28.el7.x86_64                          42/77 
  正在安装    : compat-libcogl-pango12-1.14.0-3.el7.x86_64                43/77 
  正在安装    : php-gd-5.4.16-36.el7_1.x86_64                             44/77 
  正在安装    : libxml2-devel-2.9.1-5.el7_1.2.x86_64                      45/77 
  正在安装    : compat-poppler022-qt-0.22.5-4.el7.x86_64                  46/77 
  正在安装    : fontconfig-devel-2.10.95-7.el7.x86_64                     47/77 
  正在安装    : libXpm-devel-3.5.11-3.el7.x86_64                          48/77 
  正在安装    : compat-opensm-libs-3.3.15-2.el7.x86_64                    49/77 
  正在安装    : compat-poppler022-glib-0.22.5-4.el7.x86_64                50/77 
  正在安装    : 2:libpng-devel-1.5.13-5.el7.x86_64                        51/77 
  正在安装    : nasm-2.10.07-7.el7.x86_64                                 52/77 
  正在安装    : 1:compat-openldap-2.3.43-5.el7.x86_64                     53/77 
  正在安装    : 1:compat-libgnome-bluetooth11-3.8.2.1-2.el7.x86_64        54/77 
  正在安装    : 1:compat-dapl-1.2.19-4.el7.x86_64                         55/77 
  正在安装    : libtiff-devel-4.0.3-14.el7.x86_64                         56/77 
  正在安装    : compat-libcap1-1.10-7.el7.x86_64                          57/77 
  正在安装    : libcurl-devel-7.29.0-25.el7.x86_64                        58/77 
  正在安装    : ntp-4.2.6p5-22.el7.x86_64                                 59/77 
  正在安装    : compat-libtiff3-3.9.4-11.el7.x86_64                       60/77 
  正在安装    : compat-libgweather3-3.8.2-1.el7.x86_64                    61/77 
  正在安装    : compat-libupower-glib1-0.9.20-1.el7.x86_64                62/77 
  正在安装    : ncurses-devel-5.9-13.20130511.el7.x86_64                  63/77 
  正在安装    : compat-libxcb-1.9-1.el7.x86_64                            64/77 
  正在安装    : libtool-ltdl-devel-2.4.2-20.el7.x86_64                    65/77 
  正在安装    : compat-libf2c-34-3.4.6-32.el7.x86_64                      66/77 
  正在安装    : compat-libpackagekit-glib2-16-0.8.9-1.el7.x86_64          67/77 
  正在安装    : compat-libgfortran-41-4.1.2-44.el7.x86_64                 68/77 
  正在安装    : bzip2-devel-1.0.6-13.el7.x86_64                           69/77 
  正在安装    : compat-libgnome-desktop3-7-3.8.4-2.el7.x86_64             70/77 
  正在安装    : ncurses-term-5.9-13.20130511.el7.noarch                   71/77 
  正在安装    : 1:telnet-0.17-59.el7.x86_64                               72/77 
  正在安装    : compat-libcolord1-1.0.4-1.el7.x86_64                      73/77 
  正在安装    : libjpeg-turbo-devel-1.2.90-5.el7.x86_64                   74/77 
  正在安装    : compat-libgdata13-0.13.3-1.el7.x86_64                     75/77 
  正在安装    : compat-gcc-44-4.4.7-8.el7.x86_64                          76/77 
  正在安装    : compat-gcc-44-c++-4.4.7-8.el7.x86_64                      77/77 
yum/productid                                            | 1.6 kB     00:00     
  验证中      : 1:openssl-devel-1.0.1e-42.el7_1.9.x86_64                   1/77 
  验证中      : 1:compat-glibc-headers-2.12-4.el7.x86_64                   2/77 
  验证中      : compat-gcc-44-c++-4.4.7-8.el7.x86_64                       3/77 
  验证中      : keyutils-libs-devel-1.5.8-3.el7.x86_64                     4/77 
  验证中      : libxcb-devel-1.11-4.el7.x86_64                             5/77 
  验证中      : libsepol-devel-2.1.9-3.el7.x86_64                          6/77 
  验证中      : compat-libgdata13-0.13.3-1.el7.x86_64                      7/77 
  验证中      : apr-devel-1.4.8-3.el7.x86_64                               8/77 
  验证中      : libjpeg-turbo-devel-1.2.90-5.el7.x86_64                    9/77 
  验证中      : compat-gcc-44-4.4.7-8.el7.x86_64                          10/77 
  验证中      : compat-libcolord1-1.0.4-1.el7.x86_64                      11/77 
  验证中      : 1:telnet-0.17-59.el7.x86_64                               12/77 
  验证中      : pcre-devel-8.32-15.el7.x86_64                             13/77 
  验证中      : expat-devel-2.1.0-8.el7.x86_64                            14/77 
  验证中      : xorg-x11-proto-devel-7.7-12.el7.noarch                    15/77 
  验证中      : 1:tcl-8.5.13-8.el7.x86_64                                 16/77 
  验证中      : ncurses-term-5.9-13.20130511.el7.noarch                   17/77 
  验证中      : compat-libgnome-desktop3-7-3.8.4-2.el7.x86_64             18/77 
  验证中      : bzip2-devel-1.0.6-13.el7.x86_64                           19/77 
  验证中      : compat-libgfortran-41-4.1.2-44.el7.x86_64                 20/77 
  验证中      : compat-db-headers-4.7.25-28.el7.noarch                    21/77 
  验证中      : compat-libpackagekit-glib2-16-0.8.9-1.el7.x86_64          22/77 
  验证中      : libxml2-devel-2.9.1-5.el7_1.2.x86_64                      23/77 
  验证中      : compat-libcogl-pango12-1.14.0-3.el7.x86_64                24/77 
  验证中      : 1:compat-glibc-2.12-4.el7.x86_64                          25/77 
  验证中      : compat-libcogl12-1.14.0-3.el7.x86_64                      26/77 
  验证中      : compat-libf2c-34-3.4.6-32.el7.x86_64                      27/77 
  验证中      : libtool-ltdl-devel-2.4.2-20.el7.x86_64                    28/77 
  验证中      : libibumad-1.3.10.2-1.el7.x86_64                           29/77 
  验证中      : 1:qt-4.8.5-11.el7.x86_64                                  30/77 
  验证中      : libdb-devel-5.3.21-19.el7.x86_64                          31/77 
  验证中      : libzip-0.10.1-8.el7.x86_64                                32/77 
  验证中      : libXau-devel-1.0.8-2.1.el7.x86_64                         33/77 
  验证中      : hwloc-libs-1.7-5.el7.x86_64                               34/77 
  验证中      : infinipath-psm-3.3-0.g6f42cdb1bb8.2.el7.x86_64            35/77 
  验证中      : cyrus-sasl-devel-2.1.26-19.2.el7.x86_64                   36/77 
  验证中      : compat-opensm-libs-3.3.15-2.el7.x86_64                    37/77 
  验证中      : zlib-devel-1.2.7-15.el7.x86_64                            38/77 
  验证中      : libselinux-devel-2.2.2-6.el7.x86_64                       39/77 
  验证中      : compat-poppler022-glib-0.22.5-4.el7.x86_64                40/77 
  验证中      : t1lib-5.1.2-14.el7.x86_64                                 41/77 
  验证中      : compat-libxcb-1.9-1.el7.x86_64                            42/77 
  验证中      : ncurses-devel-5.9-13.20130511.el7.x86_64                  43/77 
  验证中      : 1:qt-x11-4.8.5-11.el7.x86_64                              44/77 
  验证中      : libXpm-devel-3.5.11-3.el7.x86_64                          45/77 
  验证中      : compat-libupower-glib1-0.9.20-1.el7.x86_64                46/77 
  验证中      : compat-db47-4.7.25-28.el7.x86_64                          47/77 
  验证中      : xz-devel-5.1.2-12alpha.el7.x86_64                         48/77 
  验证中      : compat-libgweather3-3.8.2-1.el7.x86_64                    49/77 
  验证中      : opensm-libs-3.3.19-1.el7.x86_64                           50/77 
  验证中      : compat-poppler022-0.22.5-4.el7.x86_64                     51/77 
  验证中      : freetype-devel-2.4.11-11.el7.x86_64                       52/77 
  验证中      : qt-settings-19-23.5.el7.noarch                            53/77 
  验证中      : php-gd-5.4.16-36.el7_1.x86_64                             54/77 
  验证中      : environment-modules-3.2.10-10.el7.x86_64                  55/77 
  验证中      : php-common-5.4.16-36.el7_1.x86_64                         56/77 
  验证中      : compat-libtiff3-3.9.4-11.el7.x86_64                       57/77 
  验证中      : ntp-4.2.6p5-22.el7.x86_64                                 58/77 
  验证中      : libverto-devel-0.2.5-4.el7.x86_64                         59/77 
  验证中      : apr-util-devel-1.5.2-6.el7.x86_64                         60/77 
  验证中      : libcurl-devel-7.29.0-25.el7.x86_64                        61/77 
  验证中      : compat-libcap1-1.10-7.el7.x86_64                          62/77 
  验证中      : libtiff-devel-4.0.3-14.el7.x86_64                         63/77 
  验证中      : openldap-devel-2.4.40-8.el7.x86_64                        64/77 
  验证中      : 1:compat-dapl-1.2.19-4.el7.x86_64                         65/77 
  验证中      : libesmtp-1.0.6-7.el7.x86_64                               66/77 
  验证中      : krb5-devel-1.13.2-10.el7.x86_64                           67/77 
  验证中      : 1:compat-libgnome-bluetooth11-3.8.2.1-2.el7.x86_64        68/77 
  验证中      : 1:compat-openldap-2.3.43-5.el7.x86_64                     69/77 
  验证中      : compat-poppler022-qt-0.22.5-4.el7.x86_64                  70/77 
  验证中      : fontconfig-devel-2.10.95-7.el7.x86_64                     71/77 
  验证中      : libmng-1.0.10-14.el7.x86_64                               72/77 
  验证中      : nasm-2.10.07-7.el7.x86_64                                 73/77 
  验证中      : libcom_err-devel-1.42.9-7.el7.x86_64                      74/77 
  验证中      : 2:libpng-devel-1.5.13-5.el7.x86_64                        75/77 
  验证中      : compat-openmpi16-1.6.4-10.el7.x86_64                      76/77 
  验证中      : libX11-devel-1.6.3-2.el7.x86_64                           77/77 

已安装:
  apr-devel.x86_64 0:1.4.8-3.el7                                                
  apr-util-devel.x86_64 0:1.5.2-6.el7                                           
  bzip2-devel.x86_64 0:1.0.6-13.el7                                             
  compat-dapl.x86_64 1:1.2.19-4.el7                                             
  compat-db-headers.noarch 0:4.7.25-28.el7                                      
  compat-db47.x86_64 0:4.7.25-28.el7                                            
  compat-gcc-44.x86_64 0:4.4.7-8.el7                                            
  compat-gcc-44-c++.x86_64 0:4.4.7-8.el7                                        
  compat-glibc.x86_64 1:2.12-4.el7                                              
  compat-glibc-headers.x86_64 1:2.12-4.el7                                      
  compat-libcap1.x86_64 0:1.10-7.el7                                            
  compat-libcogl-pango12.x86_64 0:1.14.0-3.el7                                  
  compat-libcogl12.x86_64 0:1.14.0-3.el7                                        
  compat-libcolord1.x86_64 0:1.0.4-1.el7                                        
  compat-libf2c-34.x86_64 0:3.4.6-32.el7                                        
  compat-libgdata13.x86_64 0:0.13.3-1.el7                                       
  compat-libgfortran-41.x86_64 0:4.1.2-44.el7                                   
  compat-libgnome-bluetooth11.x86_64 1:3.8.2.1-2.el7                            
  compat-libgnome-desktop3-7.x86_64 0:3.8.4-2.el7                               
  compat-libgweather3.x86_64 0:3.8.2-1.el7                                      
  compat-libpackagekit-glib2-16.x86_64 0:0.8.9-1.el7                            
  compat-libtiff3.x86_64 0:3.9.4-11.el7                                         
  compat-libupower-glib1.x86_64 0:0.9.20-1.el7                                  
  compat-libxcb.x86_64 0:1.9-1.el7                                              
  compat-openldap.x86_64 1:2.3.43-5.el7                                         
  compat-openmpi16.x86_64 0:1.6.4-10.el7                                        
  compat-opensm-libs.x86_64 0:3.3.15-2.el7                                      
  compat-poppler022.x86_64 0:0.22.5-4.el7                                       
  compat-poppler022-glib.x86_64 0:0.22.5-4.el7                                  
  compat-poppler022-qt.x86_64 0:0.22.5-4.el7                                    
  fontconfig-devel.x86_64 0:2.10.95-7.el7                                       
  freetype-devel.x86_64 0:2.4.11-11.el7                                         
  keyutils-libs-devel.x86_64 0:1.5.8-3.el7                                      
  krb5-devel.x86_64 0:1.13.2-10.el7                                             
  libXpm-devel.x86_64 0:3.5.11-3.el7                                            
  libcom_err-devel.x86_64 0:1.42.9-7.el7                                        
  libcurl-devel.x86_64 0:7.29.0-25.el7                                          
  libjpeg-turbo-devel.x86_64 0:1.2.90-5.el7                                     
  libpng-devel.x86_64 2:1.5.13-5.el7                                            
  libselinux-devel.x86_64 0:2.2.2-6.el7                                         
  libsepol-devel.x86_64 0:2.1.9-3.el7                                           
  libtiff-devel.x86_64 0:4.0.3-14.el7                                           
  libtool-ltdl-devel.x86_64 0:2.4.2-20.el7                                      
  libxml2-devel.x86_64 0:2.9.1-5.el7_1.2                                        
  nasm.x86_64 0:2.10.07-7.el7                                                   
  ncurses-devel.x86_64 0:5.9-13.20130511.el7                                    
  ncurses-term.noarch 0:5.9-13.20130511.el7                                     
  ntp.x86_64 0:4.2.6p5-22.el7                                                   
  openssl-devel.x86_64 1:1.0.1e-42.el7_1.9                                      
  pcre-devel.x86_64 0:8.32-15.el7                                               
  php-common.x86_64 0:5.4.16-36.el7_1                                           
  php-gd.x86_64 0:5.4.16-36.el7_1                                               
  t1lib.x86_64 0:5.1.2-14.el7                                                   
  telnet.x86_64 1:0.17-59.el7                                                   
  zlib-devel.x86_64 0:1.2.7-15.el7                                              

作为依赖被安装:
  cyrus-sasl-devel.x86_64 0:2.1.26-19.2.el7                                     
  environment-modules.x86_64 0:3.2.10-10.el7                                    
  expat-devel.x86_64 0:2.1.0-8.el7                                              
  hwloc-libs.x86_64 0:1.7-5.el7                                                 
  infinipath-psm.x86_64 0:3.3-0.g6f42cdb1bb8.2.el7                              
  libX11-devel.x86_64 0:1.6.3-2.el7                                             
  libXau-devel.x86_64 0:1.0.8-2.1.el7                                           
  libdb-devel.x86_64 0:5.3.21-19.el7                                            
  libesmtp.x86_64 0:1.0.6-7.el7                                                 
  libibumad.x86_64 0:1.3.10.2-1.el7                                             
  libmng.x86_64 0:1.0.10-14.el7                                                 
  libverto-devel.x86_64 0:0.2.5-4.el7                                           
  libxcb-devel.x86_64 0:1.11-4.el7                                              
  libzip.x86_64 0:0.10.1-8.el7                                                  
  openldap-devel.x86_64 0:2.4.40-8.el7                                          
  opensm-libs.x86_64 0:3.3.19-1.el7                                             
  qt.x86_64 1:4.8.5-11.el7                                                      
  qt-settings.noarch 0:19-23.5.el7                                              
  qt-x11.x86_64 1:4.8.5-11.el7                                                  
  tcl.x86_64 1:8.5.13-8.el7                                                     
  xorg-x11-proto-devel.noarch 0:7.7-12.el7                                      
  xz-devel.x86_64 0:5.1.2-12alpha.el7                                           

完毕!
[root@localhost ~]#

 切换到 /usr/local/src目录下,使用wget命令在线下载下面的软件包:

为了方便我已经将下面的软件包共享出来,请大家自行下载:LNMP相关软件包    提取码:xlnf

[root@localhost ~]# cd /usr/local/src
[root@localhost src]# wget http://www.cmake.org/files/v2.8/cmake-2.8.11.2.tar.gz
Discuz_X3.2_SC_GBK.zip
freetype-2.5.3.tar.gz
jpegsrc.v9a.tar.gz
libgd-2.1.0.tar.gz
libmcrypt-2.5.8.tar.gz
libpng-1.6.12.tar.gz
libvpx-v1.3.0.tar.bz2
mysql-5.6.19.tar.gz
nginx-1.6.0.tar.gz
openssl-1.0.1h.tar.gz
php-5.5.14.tar.gz
pcre-8.35.tar.gz
t1lib-5.1.2.tar.gz
tiff-4.0.3.tar.gz
yasm-1.2.0.tar.gz
zlib-1.2.8.tar.gz

................下载过程省略...................

[root@localhost src]# ls
cmake-2.8.11.2.tar.gz   libpng-1.6.12.tar.gz   php-5.5.14.tar.gz
Discuz_X3.2_SC_GBK.zip  libvpx-v1.3.0.tar.bz2  t1lib-5.1.2.tar.gz
freetype-2.5.3.tar.gz   mysql-5.6.19.tar.gz    tiff-4.0.3.tar.gz
jpegsrc.v9a.tar.gz      nginx-1.6.0.tar.gz     yasm-1.2.0.tar.gz
libgd-2.1.0.tar.gz      openssl-1.0.1h.tar.gz  zlib-1.2.8.tar.gz
libmcrypt-2.5.8.tar.gz  pcre-8.35.tar.gz
[root@localhost src]#

 安装 cmake 编译工具:

[root@localhost src]# tar xf cmake-2.8.11.2.tar.gz
[root@localhost src]# cd cmake-2.8.11.2/
[root@localhost cmake-2.8.11.2]# ./configure
[root@localhost cmake-2.8.11.2]# make && make install

配置MySQL服务

创建MySQL用户

[root@localhost cmake-2.8.11.2]# cd ..
[root@localhost src]# useradd mysql -s /sbin/nologin

创建用于保存MySQL数据库和数据文件的目录,并把该目录的所有者和所属组身份修改为MySQL

[root@localhost src]# mkdir -p /usr/local/mysql/var
[root@localhost src]# chown -Rf mysql:mysql /usr/local/mysql

解压、编译、安装MySQL数据库服务程序

[root@localhost src]# tar -xf mysql-5.6.19.tar.gz 
[root@localhost src]# cd mysql-5.6.19/
[root@localhost mysql-5.6.19]# cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/var -DSYSCONFDIR=/etc
[root@localhost mysql-5.6.19]# make && make install

删除/etc目录下的默认配置文件,在MySQL数据库的保存目录scripts内找到一个名为mysql_install_db的脚本程序,执行这个脚本程序并使用--user参数指定MySQL服务的对应账号名称,使用--basedir参数指定MySQL服务程序的保存目录,使用--datadir参数指定MySQL真实数据库的文件保存目录,这样可以生产系统数据库文件和MySQL服务配置文件

[root@localhost mysql-5.6.19]# rm -rf /etc/my.cnf
[root@localhost mysql-5.6.19]# cd /usr/local/mysql
[root@localhost mysql]# ./scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/var

把MySQL数据库配置文件链接到/etc目录中,然后把程序目录中的开机程序文件复制到/etc/rc.d/init.d目录中,方便通过service命令来管理MySQL数据库服务程序,然后再添加数据库脚本文件的可执行权限

[root@localhost mysql]# ln -s my.cnf /etc/my.cnf
[root@localhost mysql]# cp ./support-files/mysql.server /etc/rc.d/init.d/mysqld
[root@localhost mysql]# chmod +x /etc/rc.d/init.d/mysqld

编辑刚才复制的MySQL数据库脚本文件,将basedir和datadir参数修改为数据库程序的保存目录和真实数据库的文件内容

[root@localhost mysql]# vim /etc/rc.d/init.d/mysqld

执行service命令启动MySQL数据库服务,使用chkconfig命令将mysqld服务程序加入到开机启动项中

[root@localhost mysql]# service mysqld start
Starting MySQL.. SUCCESS! 
[root@localhost mysql]# chkconfig mysqld on

编辑/etc/profile文件并写入追加的命令目录,把命令所保存的目录定义到PATH变量中。使用source命令加载一下/etc/profile文件,使PATH变量立即生效

[root@localhost mysql]# vim /etc/profile
[root@localhost mysql]# source /etc/profile

因为使用源码包方式安装的MySQL数据库,需要添加MySQL数据库程序调用的一些程序文件和函数库文件的链接

[root@localhost mysql]# mkdir /var/lib/mysql
[root@localhost mysql]# ln -s /usr/local/mysql/lib/mysql /usr/lib/mysql
[root@localhost mysql]# ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock
[root@localhost mysql]# ln -s /usr/local/mysql/include/mysql /usr/include/mysql
[root@localhost mysql]# 

初始化MySQL数据库

[root@localhost mysql]# mysql_secure_installation 

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MySQL to secure it, we'll need the current
password for the root user.  If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):  #按下回车即可#
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.

Set root password? [Y/n] y    #为root管理员设置数据库的密码#
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
 ... Success!

By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y     #删除匿名账户#
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y    #禁止root管理员从远程登录#
 ... Success!

By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y    #删除test数据库并取消对其的访问权限#
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y    #刷新授权表,让初始化后的设定立即生效#
 ... Success!

All done!  If you've completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!

Cleaning up...
[root@localhost mysql]#

安装配置Nginx服务

Nginx是一款相当优秀的用于部署动态网站的轻量级服务程序,它最初是为俄罗斯门户站点而开发的,因其稳定性、功能丰富、占用内存少且并发能力强而备受用户的信赖。

在安装Nginx服务程序之前,我们还需要为其解决相关的软件依赖关系

pcre软件包用于提供Perl语言兼容的正则表达式库

[root@localhost mysql]# cd /usr/local/src
[root@localhost src]# tar -xf pcre-8.35.tar.gz 
[root@localhost src]# cd pcre-8.35/
[root@localhost pcre-8.35]# ./configure --prefix=/usr/local/pcre
[root@localhost pcre-8.35]# make && make install

openssl软件包是用于提供网站加密证书服务的程序文件

[root@localhost pcre-8.35]# cd ..
[root@localhost src]# tar -xf openssl-1.0.1h.tar.gz 
[root@localhost src]# cd openssl-1.0.1h/
[root@localhost openssl-1.0.1h]# ./config --prefix=/usr/local/openssl
[root@localhost openssl-1.0.1h]# make && make install

openssl软件包安装后默认会在/usr/local/openssl/bin目录中提供很多的可用命令,将这个目录添加到PATH环境变量中,并写入到配置文件中,执行source命令让新的PATH环境变量内容立即生效

[root@localhost openssl-1.0.1h]# vim /etc/profile
[root@localhost openssl-1.0.1h]# source /etc/profile

zlib软件包是用于提供压缩功能的函数库文件

[root@localhost openssl-1.0.1h]# cd ..
[root@localhost src]# tar -xf zlib-1.2.8.tar.gz 
[root@localhost src]# cd zlib-1.2.8/
[root@localhost zlib-1.2.8]# ./configure --prefix=/usr/local/zlib
[root@localhost zlib-1.2.8]# make && make install

在安装部署好具有依赖关系的软件包之后,创建一个用于执行Nginx服务程序的账户。(账户名称可以自定义)

[root@localhost zlib-1.2.8]# cd ..
[root@localhost src]# useradd www -s /sbin/nologin

在使用命令编译Nginx服务程序时,需要设置特别多的参数,

--prefix参数用于定义服务程序稍后安装到的位置,

--user与--group参数用于指定执行Nginx服务程序的用户名和用户组。

在使用参数调用pcre、openssl、zlib软件包时,请写出软件源码包的解压路径,而不是程序的安装路径。

[root@localhost src]# tar -xf nginx-1.6.0.tar.gz 
[root@localhost src]# cd nginx-1.6.0/
[root@localhost nginx-1.6.0]# ./configure --prefix=/usr/local/nginx --without-http_memcached_module --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
[root@localhost nginx-1.6.0]# make && make install

想要启动Nginx服务程序以及将其加入到开机启动项中,也需要有脚本文件。需在/etc/rc.d/init.d目录中创建脚本文件并直接复制下面的脚本内容即可

[root@localhost nginx-1.6.0]# vim /etc/rc.d/init.d/nginx
#!/bin/bash
#chkconfig: 345 85 15 
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /etc/nginx/nginx.conf
# config: /usr/local/nginx/conf/nginx.conf
# pidfile: /usr/local/nginx/logs/nginx.pid
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ "$NETWORKING" = "no" ] && exit 0
nginx="/usr/local/nginx/sbin/nginx"
prog=$(basename $nginx)
NGINX_CONF_FILE="/usr/local/nginx/conf/nginx.conf"
[ -f /etc/sysconfig/nginx ] && . /etc/sysconfig/nginx
lockfile=/var/lock/subsys/nginx
make_dirs() {
# make required directories
user=`$nginx -V 2>&1 | grep "configure arguments:" | sed 's/[^*]*--user=\([^ ]*\).*/\1/g' -`
        if [ -z "`grep $user /etc/passwd`" ]; then
                useradd -M -s /bin/nologin $user
        fi
options=`$nginx -V 2>&1 | grep 'configure arguments:'`
for opt in $options; do
        if [ `echo $opt | grep '.*-temp-path'` ]; then
                value=`echo $opt | cut -d "=" -f 2`
                if [ ! -d "$value" ]; then
                        # echo "creating" $value
                        mkdir -p $value && chown -R $user $value
                fi
        fi
done
}
start() {
[ -x $nginx ] || exit 5
[ -f $NGINX_CONF_FILE ] || exit 6
make_dirs
echo -n $"Starting $prog: "
daemon $nginx -c $NGINX_CONF_FILE
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
return $retval
}
stop() {
echo -n $"Stopping $prog: "
killproc $prog -QUIT
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile
return $retval
}
restart() {
#configtest || return $?
stop
sleep 1
start
}
reload() {
#configtest || return $?
echo -n $"Reloading $prog: "
killproc $nginx -HUP
RETVAL=$?
echo
}
force_reload() {
restart
}
configtest() {
$nginx -t -c $NGINX_CONF_FILE
}
rh_status() {
status $prog
}
rh_status_q() {
rh_status >/dev/null 2>&1
}
case "$1" in
start)
        rh_status_q && exit 0
        $1
        ;;
stop)
        rh_status_q || exit 0
        $1
        ;;
restart|configtest)
$1
;;
reload)
        rh_status_q || exit 7
        $1
        ;;
force-reload)
        force_reload
        ;;
status)
        rh_status
        ;;
condrestart|try-restart)
        rh_status_q || exit 0
        ;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}"
exit 2
esac

保存脚本文件后赋予可执行权限,然后以绝对路径的方式执行这个脚本,通过restart命令重启Nginx服务程序,再使用chkconfig命令将Nginx服务程序添加至开机启动项中

[root@localhost nginx-1.6.0]# chmod +x /etc/rc.d/init.d/nginx
[root@localhost nginx-1.6.0]# /etc/rc.d/init.d/nginx restart
Reloading systemd:                                         [  确定  ]
Restarting nginx (via systemctl):                          [  确定  ]
[root@localhost nginx-1.6.0]# chkconfig nginx on
[root@localhost nginx-1.6.0]# 

Nginx服务程序启动后,在浏览器中输入服务器的IP地址就可以查看到默认网页了

配置PHP服务

PHP 是一种通用的开源脚本语言,发明于1995年,它吸取了C语言、Java语言及Perl语言的很多优点,具有开源、免费、快捷、跨平台性强、效率高等特性,是目前Web开发领域最常用的语言之一。

在安装PHP语言环境之前,需要解决PHP的程序包和其他软件的依赖关系

yasm源码包是一款常见的开源汇编器

[root@localhost nginx-1.6.0]# cd ..
[root@localhost src]# tar -xf yasm-1.2.0.tar.gz 
[root@localhost src]# cd yasm-1.2.0/
[root@localhost yasm-1.2.0]# ./configure
[root@localhost yasm-1.2.0]# make && make install

libmcrypt源码包是用于加密算法的扩展库程序

[root@localhost yasm-1.2.0]# cd ..
[root@localhost src]# tar -xf libmcrypt-2.5.8.tar.gz 
[root@localhost src]# cd libmcrypt-2.5.8/
[root@localhost libmcrypt-2.5.8]# ./configure
[root@localhost libmcrypt-2.5.8]# make && make install

libvpx源码包是用于提供视频编码器的服务程序

[root@localhost libmcrypt-2.5.8]# cd ..
[root@localhost src]# tar xjf libvpx-v1.3.0.tar.bz2 
[root@localhost src]# cd libvpx-v1.3.0/
[root@localhost libvpx-v1.3.0]# ./configure --prefix=/usr/local/libvpx --enable-shared --enable-vp9
[root@localhost libvpx-v1.3.0]# make && make install

tiff源码包是用于提供标签图像文件格式的服务程序

[root@localhost libvpx-v1.3.0]# cd ..
[root@localhost src]# tar -zxf tiff-4.0.3.tar.gz 
[root@localhost src]# cd tiff-4.0.3/
[root@localhost tiff-4.0.3]# ./configure --prefix=/usr/local/tiff --enable-shared
[root@localhost tiff-4.0.3]# make && make install

libpng源码包是用于提供png图片格式支持函数库的服务程序

[root@localhost tiff-4.0.3]# cd ..
[root@localhost src]# tar -zxf libpng-1.6.12.tar.gz 
[root@localhost src]# cd libpng-1.6.12/
[root@localhost libpng-1.6.12]# ./configure --prefix=/usr/local/libpng --enable-shared
[root@localhost libpng-1.6.12]# make && make install

freetype源码包是用于提供字体支持引擎的服务程序

[root@localhost libpng-1.6.12]# cd ..
[root@localhost src]# tar zxf freetype-2.5.3.tar.gz 
[root@localhost src]# cd freetype-2.5.3/
[root@localhost freetype-2.5.3]# ./configure --prefix=/usr/local/freetype --enable-shared
[root@localhost freetype-2.5.3]# make && make install

jpeg源码包是用于提供jpeg图片格式支持函数库的服务程序

[root@localhost freetype-2.5.3]# cd ..
[root@localhost src]# tar zxf jpegsrc.v9a.tar.gz 
[root@localhost src]# cd jpeg-9a/
[root@localhost jpeg-9a]# ./configure --prefix=/usr/local/jpeg --enable-shared
[root@localhost jpeg-9a]# make && make install

libgd源码包是用于提供图形处理的服务程序

在编译libgd源码包时,写入的是jpeg、libpng、freetype、tiff、libvpx等服务程序在系统中的安装路径

[root@localhost jpeg-9a]# cd ..
[root@localhost src]# tar -zxf libgd-2.1.0.tar.gz 
[root@localhost src]# cd libgd-2.1.0/
[root@localhost libgd-2.1.0]# ./configure --prefix=/usr/local/libgd --enable-shared --with-jpeg=/usr/local/jpeg --with-png=/usr/local/libpng --with-freetype=/usr/local/freetype --with-fontconfig=/usr/local/freetype --with-xpm=/usr/ --with-tiff=/usr/local/tiff --with-vpx=/usr/local/libvpx
[root@localhost libgd-2.1.0]# make && make install

t1lib源码包是用于提供图片生成函数库的服务程序

安装后把/usr/lib64目录中的函数文件链接到/usr/lib目录中,以便系统能够顺利调取到函数文件

[root@localhost libgd-2.1.0]# cd ..
[root@localhost src]# tar -zxf t1lib-5.1.2.tar.gz 
[root@localhost src]# cd t1lib-5.1.2/
[root@localhost t1lib-5.1.2]# ./configure --prefix=/usr/local/t1lib --enable-shared
[root@localhost t1lib-5.1.2]# make && make install
[root@localhost t1lib-5.1.2]# 
[root@localhost t1lib-5.1.2]# ln -s /usr/lib64/libltdl.so /usr/lib/libltdl.so
[root@localhost t1lib-5.1.2]# cp -frp /usr/lib64/libXpm.so* /usr/lib/

终于把编译php服务源码包的相关软件包都安装完了!

安装配置PHP源码包程序

在开始编译php源码包之前,先定义一个名为LD_LIBRARY_PATH的全局环境变量,该环境变量的作用是帮助系统找到指定的动态链接库文件

[root@localhost t1lib-5.1.2]# cd ..
[root@localhost src]# tar -zxf php-5.5.14.tar.gz 
[root@localhost src]# cd php-5.5.14/
[root@localhost php-5.5.14]# export LD_LIBRARY_PATH=/usr/local/libgd/lib
[root@localhost php-5.5.14]# ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-png-dir=/usr/local/libpng --with-jpeg-dir=/usr/local/jpeg --with-freetype-dir=/usr/local/freetype --with-zlib-dir=/usr/local/zlib --with-mcrypt=/usr/local/libmcrypt --with-libxml-dir=/usr/local/libxml2/ --with-iconv-dir=/usr/local/libiconv --enable-libxml --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-opcache --enable-mbregex --enable-fpm --enable-mbstring=all --enable-gd-native-ttf --with-openssl --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --enable-session --with-curl --enable-ctype --enable-shared --with-gd --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd
[root@localhost php-5.5.14]# make && make install

在php源码包程序安装完成后,需要删除当前默认的配置文件,然后将php服务程序目录中相应的配置文件复制过来

[root@localhost php-5.5.14]# rm -rf /etc/php.ini
[root@localhost php-5.5.14]# ln -s /usr/local/php/etc/php.ini /etc/php.ini
[root@localhost php-5.5.14]# cp php.ini-production /usr/local/php/etc/php.ini
[root@localhost php-5.5.14]# cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
[root@localhost php-5.5.14]# ln -s /usr/local/php/etc/php-fpm.conf /etc/php-fpm.conf
[root@localhost php-5.5.14]# 

执行vim命令,编辑php-fpm.conf配置文件,启用该配置文件中第25行的pid参数

[root@localhost php-5.5.14]# vim /usr/local/php/etc/php-fpm.conf

将该配置文件中第148和149行的user用户与group用户组参数分别修改为www

将管理PHP服务的脚本文件复制到/etc/rc.d/init.d中,给脚本文件赋予可执行权限,再把php-fpm服务程序加入到开机启动项中

[root@localhost php-5.5.14]# cp sapi/fpm/init.d.php-fpm /etc/rc.d/init.d/php-fpm
[root@localhost php-5.5.14]# chmod +x /etc/rc.d/init.d/php-fpm
[root@localhost php-5.5.14]# chkconfig php-fpm on

执行vim命令,编辑php.ini文件,添加禁用功能名单 (在305行的disable_functions参数后面追加上要禁止的功能)

[root@localhost php-5.5.14]# vim /usr/local/php/etc/php.ini

将php服务程序配置完成后,执行vim命令,编辑Nginx服务程序的主配置文件

[root@localhost php-5.5.14]# vim /usr/local/nginx/conf/nginx.conf

把第2行的井号(#)删除,然后在后面写上负责运行Nginx服务程序的账户名称和用户组名称

在第45行的index参数后面写上网站的首页名称

将第65~71行参数前的井号(#)删除来启用参数

修改第69行的脚本名称路径参数,其中$document_root变量即为网站信息存储的根目录路径,若没有设置该变量,则Nginx服务程序无法找到网站信息,因此会提示“404页面未找到”的报错信息。

在确认参数信息填写正确后便可重启Nginx服务与php-fpm服务

[root@localhost php-5.5.14]# systemctl restart nginx
[root@localhost php-5.5.14]# systemctl restart php-fpm

验证LNMP架构,编写PHP测试网页

[root@localhost php-5.5.14]# cd /usr/local/nginx/html/
[root@localhost html]# vim index.php

使用windows 7客户端验证

LNMP动态网站环境架构的配置完成!

验证配置结果。如果能够在LNMP动态网站环境中成功安装使用Discuz!论坛系统,也就意味着这套架构是可用的!

搭建Discuz论坛

执行unzip命令解压 Discuz_X3.2_SC_GBK.zip 文件

[root@localhost php-5.5.14]# cd /usr/local/src/
[root@localhost src]# unzip Discuz_X3.2_SC_GBK.zip

将Nginx服务程序网站根目录的内容清空,再把这个目录中的文件都复制进去,然后将Nginx服务程序的网站根目录的所有者和所属组修改为本地的www用户,并为其赋予可执行权限,以便于能够读、写、执行该论坛系统内的文件

[root@localhost src]# rm -rf /usr/local/nginx/html/{index.html,50x.html}*
[root@localhost src]# mv upload/* /usr/local/nginx/html/
[root@localhost src]# chown -Rf www:www /usr/local/nginx/html
[root@localhost src]# chmod -Rf +x /usr/local/nginx/html

(1)接受Discuz!安装向导的许可协议

(2)检查Discuz! X3.2论坛系统的安装环境及目录权限

(3)选择全新安装,点击下一步

(4)填写服务器的数据库信息与论坛系统管理员信息

(5)等待Discuz! X3.2论坛系统安装完毕

成功安装Discuz! X3.2论坛系统后的欢迎界面

Discuz! X3.2论坛系统安装完成!

 

知识拓展:

感兴趣的小伙伴还可以做以下案例:

架设Phpmyadmin程序包

phpmyadmin是一个用PHP编写的,可以通过web方式控制和操作MySQL数据库的程序。通过phpMyadmin可以完全对数据库进行操作,例如建立、复制、删除数据等等。

phpmyadmin官网:https://www.phpmyadmin.net   

[root@localhost 下载]# ls
phpMyAdmin-5.0.2-all-languages.zip
[root@localhost 下载]# unzip phpMyAdmin-5.0.2-all-languages.zip 
Archive:  phpMyAdmin-5.0.2-all-languages.zip
   creating: phpMyAdmin-5.0.2-all-languages/
  inflating: phpMyAdmin-5.0.2-all-languages/CODE_OF_CONDUCT.md  
  inflating: phpMyAdmin-5.0.2-all-languages/CONTRIBUTING.md  
  inflating: phpMyAdmin-5.0.2-all-languages/ChangeLog  
  inflating: phpMyAdmin-5.0.2-all-languages/DCO  
  inflating: phpMyAdmin-5.0.2-all-languages/LICENSE  
  inflating: phpMyAdmin-5.0.2-all-languages/README  
 extracting: phpMyAdmin-5.0.2-all-languages/RELEASE-DATE-5.0.2  
  inflating: phpMyAdmin-5.0.2-all-languages/ajax.php  
  inflating: phpMyAdmin-5.0.2-all-languages/browse_foreigners.php  
  inflating: phpMyAdmin-5.0.2-all-languages/changelog.php  
  inflating: phpMyAdmin-5.0.2-all-languages/chk_rel.php  
  inflating: phpMyAdmin-5.0.2-all-languages/composer.json  
  inflating: phpMyAdmin-5.0.2-all-languages/composer.lock  
  inflating: phpMyAdmin-5.0.2-all-languages/config.sample.inc.php  
  inflating: phpMyAdmin-5.0.2-all-languages/db_central_columns.php  
  inflating: phpMyAdmin-5.0.2-all-languages/db_datadict.php  
  inflating: phpMyAdmin-5.0.2-all-languages/db_designer.php  
  inflating: phpMyAdmin-5.0.2-all-languages/db_events.php  

................ 部分解压缩过程省略.............

[root@localhost 下载]# ls
phpMyAdmin-5.0.2-all-languages  phpMyAdmin-5.0.2-all-languages.zip
[root@localhost 下载]# mv phpMyAdmin-5.0.2-all-languages /usr/local/nginx/html
[root@localhost 下载]# cd /usr/local/nginx/html
[root@localhost html]# ls
50x.html  index.html  index.php  phpMyAdmin-5.0.2-all-languages
[root@localhost html]# 
[root@localhost html]# mv phpMyAdmin-5.0.2-all-languages/ phpmyadmin   # 更名为phpmyadmin
[root@localhost html]# ls
50x.html  index.html  index.php  phpmyadmin  

将解压缩的phpMyAdmin-5.0.2-all-languages文移动到 /usr/local/nginx/html目录下并更名为phpmyadmin

[root@localhost html]# cd phpmyadmin/
[root@localhost phpmyadmin]# cp -p config.sample.inc.php config.inc.php
[root@localhost phpmyadmin]# ls config.inc.php
config.inc.php
[root@localhost phpmyadmin]# 

执行vim命令,编辑 config.inc.php配置文件

[root@localhost phpmyadmin]# vim config.inc.php

重启 Nginx 服务

[root@localhost nginx]# systemctl restart nginx

重启完之后就可以使用浏览器进行访问了!

打开浏览器输入:http://192.168.203.218/phpmyadmin/

 

提示:不要下载最新版本的phpmyadmin,除非你安装的PHP版本也是最新版本的,否则会提示PHP版本过低!!!

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
SeimiCrawler(Java 爬虫框架)更新 支持在Request对象中,通过header(map)来自定义本次请求的header,以及支持通过seimiCookies来自定义cookies,自定义cookies会直接进入cookiesStore,对同域下第二次请求依然有效 优化默认启动方式,改造cn.wanghaomiao.seimi.boot.Run支持CommandLineParser,可以使用 -c 和-p来传参,其中-c用来指定crawlernames,多个用','分隔,-p指定一个端口,可以选择性的启动一个内嵌的http服务,并开启使用内嵌http接口 maven-compiler-plugin打包插件升级为1.3.0,完善Linux下的脚本,并增加启动配置文件,可以到maven-compiler-plugin主页详细查看 默认下载器改为Apache Httpclient,备用为下载器OkHttp3实现 优化部分代码 demo日志默认全部输出至控制台 SeimiCrawler(Java 爬虫框架)简介 SeimiCrawler是一个敏捷的,独立部署的,支持分布式的Java爬虫框架,希望能在最大程度上降低新手开发一个可用性高且性能不差的爬虫系统的门槛,以及提升开发爬虫系统的开发效率。在SeimiCrawler的世界里,绝大多数人只需关心去写抓取的业务逻辑就够了,其余的Seimi帮你搞定。设计思想上SeimiCrawler受Python的爬虫框架Scrapy启发,同时融合了Java语言本身特点与Spring的特性,并希望在国内更方便且普遍的使用更有效率的XPath解析HTML,所以SeimiCrawler默认的HTML解析器是JsoupXpath(独立扩展项目,非jsoup自带),默认解析提取HTML数据工作均使用XPath来完成(当然,数据处理亦可以自行选择其他解析器)。并结合SeimiAgent彻底完美解决复杂动态页面渲染抓取问题。 SeimiCrawler(Java 爬虫框架)展示   相关阅读 同类推荐:站长常用源码

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值