In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces how to build the LNMP environment in CentOS 7. The content is very detailed. Interested friends can use it for reference. I hope it will be helpful to you.
1. Install the Epel source yum install-y epel-release2, install the required software yum install-y gcc automake autoconf libtool make gcc-c++ glibc libxslt-devel\ libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2\ libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2\ bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel\ krb5-devel libidn libidn-devel openssl openssl-devel pcre pcre-devel libmcrypt\ libmcrypt-devel cmake1, and download the software First find the download address of the software you need to download cat > / usr/local/src/url ALTER USER 'root'@'localhost' IDENTIFIED BY' new psd'
4. Install PHP;, create a php account and enter the directory
Useradd-s / sbin/nologin php-fpmcd / usr/local/src/php-5.6.391 Compile. / configure\-- prefix=/usr/local/php\-- with-config-file-path=/usr/local/php/etc\-- enable-fpm\-- with-fpm-user=php-fpm\-- with-fpm-group=php-fpm\-- with-mysqli=mysqlnd\-- with-pdo-mysql=mysqlnd\-- with-libxml-dir\-- enable-pcntl\-- enable-mysqlnd\-- enable-opcache\-- enable-sockets\-- enable-sysvmsg\-- enable-sysvsem\- -enable-sysvshm\-- enable-shmop\-- enable-zip\-- enable-soap\-- enable-xml\-- enable-mbstring\-- disable-rpath\-- disable-debug\-- disable-fileinfo\-- with-pcre-regex\-- with-iconv\-- with-zlib\-with-mcrypt\-with-gd\-- with-jpeg-dir\-- with-png-dir\-- enable-gd-native-ttf\-- with-freetype-dir\-- -with-openssl\-- with-mhash\-- with-xmlrpc\-- with-curl\-- with-pear\-- enable-ftp\-- enable-exif\-- disable-ipv6\-- with-imap-ssl solves the php compilation error configure: error: mcrypt.h not found. Please reinstall libmcrypt.configure: error: mcrypt.h not found. Please reinstall libmcrypt. Method 1: yum install-y epel-releaseyum install-y libmcrypt-devel cannot be installed together, because the default yum source of CentOs6 does not have the package libmcrypt-devel, so you can only rely on the yum source of epel, so install epel first, and then install libmcrypt. Method 2: error content: configure: error: mcrypt.h not found. Please reinstall libmcrypt searched a lot on the Internet, including its own yum install libmcrypt libmcrypt-devel, which was ineffective. Go to SourceForget to download libmcrypt http://sourceforge.net/projects/mcrypt/files/Libmcrypt/, the latest version is mcrypt 2.6.7.gz. Download the installation and still report an error libmcrypt can not be found! Continue to test, the final installation is successful, feeling that the version is too high. Method (key points in version 2.5.7): # you can download wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/attic/libmcrypt/libmcrypt-2.5.7.tar.gz # extract tar-zxvf libmcrypt-2.5.7.tar.gz # and enter the directory cd libmcrypt-2.5.7 # to compile (default installation to / usr/local/lib/). / configure-- prefix=/ using wget Usr/local/libmcrypt # install make & & make install and then go back to the mcrypt in the ext directory unzipped by PHP-5.5.13 phpize. / configure-- with-php-config=/usr/local/php5/bin/php-config\-- with-libmcrypt=/usr/lib/libmcrypt make make test make install vim / etc/php.ini # add extension=mcrypt.so2 Install make & & make install3 and modify the configuration file cp php.ini-production / usr/local/php-fpm/etc/php.inivi / usr/local/php-fpm/etc/php-fpm.conf4 Write the following content [global] pid = / usr/local/php-fpm/var/run/php-fpm.piderror_log = / usr/local/php-fpm/var/log/php- fpm.log [www] listen = / tmp/php-fcgi.socklisten.mode = 666user = php-fpmgroup = php-fpmpm = dynamicpm.max_children = 50pm.start_servers = 5pm.max_spare_servers = 35pm.max_requests = 500rlimit_files = 10245, and set the startup file Boot cp sapi/fpm/init.d.php-fpm / etc/init.d/php-fpmchmod 755 / etc/init.d/php-fpmchkconfig-- add php-fpmchkconfig php-fpm onservice php-fpm startps aux | grep php-fpm5, install nginx1, go to the directory to compile cd / usr/local/src/nginx-1.14.2./configure-- prefix=/usr/local/nginx2, start installing make & & make install3, and modify the startup file vim / etc/init.d/nginx4 Write the following content #! / bin/bash# chkconfig:-302 hours description: http service.# Source Function Library. / etc/init.d/functions# Nginx SettingsNGINX_SBIN= "/ usr/local/nginx/sbin/nginx" NGINX_CONF= "/ usr/local/nginx/conf/nginx.conf" NGINX_PID= "/ usr/local/nginx/logs/nginx.pid" RETVAL=0prog= "Nginx" start () {echo-n $"Starting $prog:" mkdir-p / dev/shm/nginx_temp daemon $NGINX_SBIN-c $NGINX_CONF RETVAL=$? Echo return $RETVAL} stop () {echo-n $"Stopping $prog:" killproc-p $NGINX_PID $NGINX_SBIN-TERM rm-rf / dev/shm/nginx_temp RETVAL=$? Echo return $RETVAL} reload () {echo-n $"Reloading $prog:" killproc-p $NGINX_PID $NGINX_SBIN-HUP RETVAL=$? Echo return $RETVAL} restart () {stop start} configtest () {$NGINX_SBIN-c $NGINX_CONF-t return 0} case "$1" in start) start;; stop) stop;; reload) reload;; restart) restart;; configtest) configtest *) echo $"Usage: $0 {start | stop | reload | restart | configtest}" RETVAL=1esacexit $RETVAL5, set startup permission, boot chmod 755 / etc/init.d/nginxchkconfig-- add nginxchkconfig nginx on6, modify the configuration file, site directory mv / usr/local/nginx/conf/nginx.conf / usr/local/nginx/conf/nginx.conf.bakvi / usr/local/nginx/conf/nginx.confuser nobody nobody;worker_processes 2 Pid / usr/local/nginx/logs/nginx.pid;worker_rlimit_nofile 51200 control events {use epoll; worker_connections 6000;} http {include mime.types; default_type application/octet-stream; server_names_hash_bucket_size 3526; server_names_hash_max_size 4096 Log_format combined_realip'$remote_addr $http_x_forwarded_for [$time_local]'$host "$request_uri" $status''"$http_referer"$http_user_agent"; sendfile on; tcp_nopush on; keepalive_timeout 30; client_header_timeout 3m; client_body_timeout 3m; send_timeout 3m; connection_pool_size 256; client_header_buffer_size 1k; large_client_header_buffers 8 4k Request_pool_size 4k; output_buffers 4 32k; postpone_output 1460; client_max_body_size 10m; client_body_buffer_size 256k; client_body_temp_path / usr/local/nginx/client_body_temp; proxy_temp_path / usr/local/nginx/proxy_temp; fastcgi_temp_path / usr/local/nginx/fastcgi_temp; fastcgi_intercept_errors on; tcp_nodelay on; gzip on Gzip_min_length 1k; gzip_buffers 48k; gzip_comp_level 5; gzip_http_version 1.1; gzip_types text/plain application/x-javascript text/css text/htm application/xml; server {listen 80; server_name localhost; index index.html index.htm index.php; root / usr/local/nginx/html Location ~\ .php$ {include fastcgi_params; fastcgi_pass unix:/tmp/php-fcgi.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME / usr/local/nginx/html$fastcgi_script_name } 6, check to see if there are any configuration errors, and whether the usr/local/nginx/sbin/nginx listening port starts / usr/local/nginx/sbin/nginx-t/etc/init.d/nginx startnetstat-lntp | grep 80
Test php parsing
Vi / usr/local/nginx/html/1.php / / add the following content curl localhost/1.php
Attached: set default virtual host and multi-site configuration
Add vhost folder to configure multi-site
Vim / usr/local/nginx/conf/nginx.conf
Include vhost/*.conf
Mkdir / usr/local/nginx/conf/vhost
Cd! $; vim default.conf / / add the following
Server
{
Listen 80 default_server; / / the default virtual host marked with this tag
Server_name aaa.com
Index index.html index.htm index.php
Root/ data/wwwroot/default
}
Mkdir-p / data/wwwroot/default/
Echo "This is a default site." > / data/wwwroot/default/index.html
/ usr/local/nginx/sbin/nginx-t
/ usr/local/nginx/sbin/nginx-s reload
Curl localhost
Curl-x127.0.0.1 80 123.com
On how to build the LNMP environment in CentOS 7 to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
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: 0
*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.