In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
1, Introduction
Nginx("engine x") is a high-performance Web and reverse proxy server developed in C by Russian programmer Igor Sysoev, and is also an IMAP/POP3/SMTP proxy server.
Nginx is a good alternative to Apache servers in high connection concurrency situations.
Purpose: Load Balancer, Web Services, Reverse Proxy.
NGINX
nginx news
2. Install compiler tools and library files 1. c++ compile environment install [root@localhost src]# yum install gcc-c++ ////Omit installation content... Install gcc-c++ 2 online. openssl install [root@localhost src]# wget http://www.openssl.org/source/openssl-fips-2.0.10.tar.gz///** Download the openssl installation file, OpenSSL is applied to web servers on the Internet for secure communication */[root@localhost src]# tar zxvf openssl-fips-2.0.10.tar.gz[root@localhost src]# cd openssl-fips-2.0.10[root@localhost openssl-fips-2.0.10] # ./ config && make && make install3. pcre install [root@localhost src]# wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.40.tar.gz///** PCRE(Perl Compatible Regular Expressions) is a regular expression library for Perl */[root@localhost src]# tar zxvf pcre-8.40.tar.gz [root@ localhost src]# cd pcre-8.40[root@localhost pcre-8.40]# ./ configure && make && make install4. zlib install [root@localhost src]# wget www.example.com//http://zlib.net/zlib-1.2.11.tar.gz /** Download zlib installation files... zlib is a library that provides data compression */[root@localhost src]# tar zxvf zlib-1.2.11.tar.gz[root@localhost src]# cd zlib-1.2.11[root@localhost zlib-1.2.11]# ./ configure && make && make install5. Or install all online in one step: [root@localhost src]# yum -y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel3.Nginx install [root@localhost src]# wget http://nginx.org/download/nginx-1.10.2.tar.gz///** Download the nginx installation file */[root@localhost src]# tar zxvf nginx-1.10.2.tar.gz[root@localhost src]# cd nginx-1.10.2[root@localhost nginx-1.10.2]# ./ configure && make && make install or specify installation parameters: prefix is nginx installation directory [root@bogon nginx-1.6.2]# ./ configure --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre=/usr/local/src/pcre-8.35[root@bogon nginx-1.6.2]# make[root@bogon nginx-1.6.2]# make install4. Start nginx
Find out where nginx is installed.
[root@xxx bin]# whereis nginxnginx: /usr/local/nginx
Enter nginx directory and start
[root@xxx bin]# cd /usr/local/nginx[root@xxx nginx]# /usr/local/nginx/sbin/nginx
Error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory
1. Use the whereis libpcre.so.1 command to find where libpcre.so.1 is
2. ln -s /usr/local/lib/libpcre.so.1 /lib64 is a soft link.
3. Start Nginx with sbin/nginx
4. with ps -aux| grep nginx View status
[root@localhost nginx]# whereis libpcre.so.1[root@localhost nginx]# ln -s /usr/local/lib/libpcre.so.1 /lib64[root@localhost nginx]# sbin/nginx[root@localhost nginx]# ps -aux | grep nginx
Open the browser and enter localhost to see the following figure, indicating that nginx started successfully
Basic operation of nginx
[root@localhost ~]# /usr/local/nginx/sbin/nginx #start [root@localhost ~]# /usr/local/nginx/sbin/nginx -s stop (quit、 reload) #Stop/Restart [root@localhost ~]# /usr/local/nginx/sbin/nginx -h #Command Help [root@localhost ~]# /usr/local/nginx/sbin/nginx -t #Verify that the configuration file is correct [root@localhost ~]# vim /usr/local/nginx/conf/nginx.conf #Configuration file/usr/local/webserver/nginx/sbin/nginx -s reload #Reload configuration file/usr/local/webserver/nginx/sbin/nginx -s reopen The requested URL/usr/webserver/nginx/sbin/nginx -s/was not found on this server. #Stop Nginx5. Nginx configuration
The server{} block represents each web site
listen 80; #listening port server_name localhost; #Domain name index index.html index.htm index.php; root /usr/local/webserver/nginx/html; #sitedirectory
Reference:
Nginx installation configuration
Nginx Linux Detailed Installation Deployment Tutorial
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.