In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Deployment environment: host ip address operating system nginx172.16.1.100CentOS 7.3php+memcache172.16.1.110CentOS 7.3Mysql172.16.1.120CentOS 7.3memcached172.16.1.130CentOS 7.3i, environment preparation: build LNMP environment (dynamic resolution)
1, install nginx
1) install the dependency toolkit: [root@nginx-server ~] # yum-y install gcc* pcre-devel openssl-devel zlib-devel make vim 2) create nginx user groups and users: [root@nginx-server ~] # groupadd-r nginx & & useradd-r-g nginx-s / bin/false-M nginx3) decompress the source package Configure & & compile and install: [root@nginx-server ~] # tar zxf nginx-1.8.0.tar.gz [root@nginx-server ~] # cd nginx-1.8.0 [root@nginx-server nginx-1.8.0] #. / configure-- help # # you can view the module you need-- with Or cancelled modules-without# adds different modules according to their own needs [root@nginx-server nginx-1.8.0] #. / configure-- prefix=/usr/local/nginx-- user=nginx-- group=nginx\ >-- with-http_stub_status_module-- with-http_ssl_module-- with-http_dav_module-- with-http_flv_module\ >-- with-http_mp4_module-- with-http_gzip_ Static_module-- with-http_gzip_static_module\ >-- with-http_addition_module-- with-http_sub_module-- with-pcre [root@nginx-server nginx-1.8.0] # make & & make install# optimize the path and check: [root@nginx-server nginx-1.8.0] # ln-s / usr/local/nginx/sbin/nginx / usr/local/sbin/ [root@nginx-server nginx-1.8.0] # nginx- tnginx: the configuration file / usr/local/nginx/conf/nginx.conf syntax is oknginx: configuration file / usr/local/nginx/conf/nginx.conf test is successful# launch service: [root@nginx-server nginx-1.8.0] # nginx [root@nginx-server nginx-1.8.0] # netstat-anput | grep nginxtcp 0 0 0.0. 0. 0. 0. LISTEN 21416/nginx: master # Open firewall port 80: [root@nginx-server nginx-1.8.0] # firewall-cmd-- add-port=80/tcp-- permanentsuccess [root@nginx-server nginx-1.8.0] # firewall-cmd-- reloadsuccess
2, install php
1) install dependency toolkit: [root@php-server ~] # yum-y install gcc* pcre-devel openssl-devel zlib-devel libxml2-devel libcurl-devel bzip2-devel make vim 2) install php's encryption extension module libmcrypt [root@php-server ~] # tar zxf libmcrypt-2.5.7.tar.gz [root@php-server ~] # cd libmcrypt-2.5.7 [root@php-server libmcrypt-2.5.7] #. / configure-- prefix= / usr/local/libmcrypt & & make & & make install3) install php: [root @ php-server ~] # tar zxf php-5.6.27.tar.gz [root@php-server ~] # cd php-5.6.27 [root@php-server php-5.6.27] #. / configure-- prefix=/usr/local/php5.6-- with-mysql=mysqlnd\ >-- with-pdo-mysql=mysqlnd-- with-mysqli=mysqlnd-- with-openssl-- enable-fpm -- enable-sockets\ >-- enable-sysvshm-- enable-mbstring-- with-freetype-dir-- with-jpeg-dir-- with-png-dir\ >-- with-zlib-- with-libxml-dir=/usr-- enable-xml-- with-mhash-- with-mcrypt=/usr/local/libmcrypt\ >-- with-config-file-path=/etc-- with-config-file-scan-dir=/etc/php.d-- with-bz2-- enable-maintainer-zts
Configuration parameters explain:
-- prefix=/usr/local/php7.2 # specifies the installation path of php mysqlnd (mysql native driver) # mysql driver connection code provided by php source code-- with-mysql=mysqlnd # supports mysql--with-pdo-mysql=mysqlnd # supports pdo module, php executes commands to connect to the back-end database through pdo syntax-- with-mysqli=mysqlnd # executes libmysql module Enhancement module also known as mysql-- with-openssl # supports ssl-- enable-fpm # enables php process manager-- enable-sockets # enables socket support, socket programming interface (API)-- enable-sysvshm # enables system shared memory support-- enable-mbstring # supports multi-byte strings, such as multi-byte strings in Chinese One Chinese character represents 2 bytes-with-freetype-dir # supports freetype (font engine), with the help of freetype-devel, font parsing tool-with-jpeg-dir # supports jepg and png images Php will generate some images during parsing-- with-png-dir-- with-zlib # function library for data compression-- with-libxml-dir=/usr # Open xml files supported by libxml2 library-- enable-xml # enable xml file transfer-- with-mhash # support mhash,mhash can be used to create check values, message summaries, message authentication codes And no need for the original text to wait for key information to be saved (such as passwords), etc.-with-mcrypt=/usr/local/libmcrypt # php encryption supports extended libraries-with-config-file-path=/etc # configuration file path-with-config-file-scan-dir=/etc/php.d # configuration file scan path-with-bz2 # supports bzip2 compression-enable-maintainer-zts # supports php multithreading extension
Note: in the php7 version, some parameter options that are no longer supported, such as the-with-mcrypt and-- with-mysql parameters above, have been abolished in version 7. If you are using version 7, you need to delete the above two compilation options during configuration.
# compile and install [root@php-server php-5.6.27] # make & & make install# provides php configuration file: [root@php-server php-5.6.27] # cp php.ini-production / etc/php.ini# create php-fpm service startup script: [root@php-server php-5.6.27] # cp sapi/fpm/init.d.php-fpm / etc/init.d/php-fpm [root@php-server php-5 .6.27] # chmod + x / etc/init.d/php-fpm # add self-boot [root@php-server php-5.6.27] # chkconfig-- add php-fpm [root@php-server php-5.6.27] # chkconfig php-fpm on# provides php-fpm configuration file and makes simple optimization: [root@php-server php-5.6.27] # cp / usr/local/php5.6/etc/php-fpm.conf.default / usr/local/php5.6/etc/php-fpm.conf [root@php-server ~] # vim / usr/local/php5.6/etc/php-fpm.conf is modified as follows: pid = run/php-fpm.pid # location of the pid file listen = 172.16.1.1109000 # Native ip address: Port pm.max_children = 300 # the largest child process created by php pm.start_servers = 10 # child at startup Number of processes pm.min_spare_servers = 10 # minimum idle child process pm.max_spare_servers = 50 # maximum idle child process # start php service: [root@php-server ~] # / etc/init.d/php-fpm startStarting php-fpm done [root@php-server ~] # netstat-anput | grep 9000tcp 00 172.16.1.110 root@php-server 9000 0.0.0.0 root@php-server * LISTEN 3220/php-fpm: maste # Open firewall port 9000: [root@php-server ~] # firewall-cmd-- add-port=9000/tcp-- permanentsuccess [root@php-server ~] # firewall-cmd-- reloadsuccess
3. Configure nginx and php dynamic parsing
# configure nginx configuration file:
[root@nginx-server ~] # vim / usr/local/nginx/conf/nginx.conf
43 location / {44 root html; 45 index index.html index.htm index.php # add .php page parsing; 46} 65 location ~\ .php$ {# means fastcgi operation 66 root / usr/local/nginx/html if matching to php file # the root directory of the web page requested by the user is 67 fastcgi_pass 172.16.1.110 fastcgi_pass 9000; # specify the ip address + port 68 fastcgi_index index.php; # default proxy .php dynamic page 69 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # php root directory 70 include fastcgi_params; 71}
Finally, restart the nginx service to make it effective.
# create a php test file on the php server: [root@php-server ~] # mkdir-p / usr/local/nginx/html [root@php-server ~] # cat / usr/local/nginx/html/test.php
# Test access:
4, install mysql
Because the source code installation mysql process is too long, so use binary to install.
# write an one-click installation script for mysql (and change the root password):
[root@mysql-server ~] # cat mysql5.7.sh #! / bin/bashrpm-qa | grep mariadb & > / dev/nullif [$?-eq 0] then rpm-e mariadb-libs-- nodepsfitar zxf mysql-5.7.28-linux-glibc2.12-x86_64.tar.gz mv mysql-5.7.28-linux-glibc2.12-x86_64 / usr/local/mysqlln-s / usr/local/mysql/bin/* / usr/local/bingroupadd-r mysql & & useradd-r-g mysql-s / bin/false-M mysqlmkdir / usr/local/mysql/datachown-R mysql:mysql / usr/local/mysqlcat > / etc/my.cnf
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 211
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.