Home Backend Development PHP Tutorial nginx compilation and configuration

nginx compilation and configuration

Aug 08, 2016 am 09:32 AM
data module nbsp nginx with

1 Preparations before installing nginx

Yum install –y gcc gcc-c++

Yum install zlib zlib-devel

Yum install openssl

2. Compile and install pcre
is executed as follows Command:

#cd/data/software/pcre-8.32

#./configure –prefix

#make

#make install

2. Compile and install nginx
Execute the following command:
# cd /data/software/nginx-1.7.0
# ./configure --prefix=/data/nginx/ --with-http_ssl_module --with-http_spdy_module
--with-http_stub_status_module --with -pcre

#Make

#Make install


–with-http_stub_status_module: supports nginx status query
–with-http_ssl_module: supports https
–with-http_spdy_module: Support If you want to know more about Google's spdy, please use Baidu spdy. This must have ssl support
–with-pcre: In order to support the rewrite rewriting function, pcre must be configured

After the installation is complete, start nginx.

[root@localhost conf]#/data/nginx/sbin/nginx (The following error is displayed when starting nginx)

/data/nginx/sbin/nginx: error while loading shared libraries: libpcre. so.1: cannot open shared object file: No such file or directory

Establish a soft connection

[hadoop@SCLABHADOOP01 ~]$ ln -s/usr/local/lib/libpcre.so.1 /lib64 /

The command to determine whether the Nginx configuration is correct is as follows:

/usr/nginx/sbin/nginx –t

/data/nginx/sbin/nginx( Start service)

/data/nginx/sbin/nginx-s stop(Stop service)

/data/nginx/sbin/nginx-s reload( Restart the service)

Configurationnginx


80
Port Listen 80; # Define the use of

www.xx.com
Access                                                                 use
-- access_log logs/www.xx .com.access.log main;

#Default request
Location / {
root /root; index index.phpindex.html index.htm; #

Define the name of the home page index file example

server {
listen 80;
server_name bo.artronekp.net;

location/ {

root /data/software/beian/;

index index.html help.html;

}

}

The above has introduced nginx compilation and configuration, including aspects of it. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to allow external network access to tomcat server How to allow external network access to tomcat server Apr 21, 2024 am 07:22 AM

How to allow external network access to tomcat server

What are the nginx start and stop commands? What are the nginx start and stop commands? Apr 02, 2024 pm 08:45 PM

What are the nginx start and stop commands?

How to run thinkphp How to run thinkphp Apr 09, 2024 pm 05:39 PM

How to run thinkphp

Welcome to nginx!How to solve it? Welcome to nginx!How to solve it? Apr 17, 2024 am 05:12 AM

Welcome to nginx!How to solve it?

How to register phpmyadmin How to register phpmyadmin Apr 07, 2024 pm 02:45 PM

How to register phpmyadmin

How to deploy nodejs project to server How to deploy nodejs project to server Apr 21, 2024 am 04:40 AM

How to deploy nodejs project to server

How to solve the problem of nginx when accessing the website How to solve the problem of nginx when accessing the website Apr 02, 2024 pm 08:39 PM

How to solve the problem of nginx when accessing the website

How to communicate between docker containers How to communicate between docker containers Apr 07, 2024 pm 06:24 PM

How to communicate between docker containers

See all articles