澳门新萄京官方网站-www.8455.com-澳门新萄京赌场网址

0编译安装

2019-12-01 作者:澳门新萄京官方网站   |   浏览(54)

参考:

nginx安装

nginx及tengine配置

也不知道自个儿的系统是或不是有这一个信任包,试试啊?贫乏什么小编就装什么吧,多踏点坑总是能学到点东西的.

nginx能够应用各平台的暗许包来设置,本文是介绍使用源码编写翻译安装,满含实际的编写翻译参数音讯。

 

 

正规最早前,编写翻译遇到gcc g 开荒库之类的急需超前装好,这里默许你已经装好。

方今干活亟待,供给安插天猫开辟的tengine,查了有的资料。差不离步骤如下:

获取nginx包

centos平台编写翻译情形使用如下指令

  www.2cto.com  

安装make:

1.第风流浪漫安装tengine信赖的library pcre.jar

configure --sbin-path=/user/local/nginx/nginx --conf-path=/usr/local/nginx/nginx.conf --pid-path=/usr/local/nginx/nginx.pid

 

 

 

yum -y install gcc automake autoconf libtool make

1.cd /usr/local/src #到钦命的目录下

报错

 

 

./configure: error: the HTTP rewrite module requires the PCRE library.

安装g :

2.tar zxvf pcre-8.12.tar.gz

You can either disable the module by using --without-http_rewrite_module

 

 

option, or install the PCRE library into the system, or build the PCRE library

yum install gcc gcc-c

3.mkdir /usr/local/pcre   #始建筑和安装装目录hotspot-cd74fab0a5e3

statically from the source with nginx by using --with-pcre=<path> option

 

 

 

上面正式启幕:

4.cd pcre-8.12

 

诚如大家都亟待先装pcre, zlib,后者为了重写rewrite,后面一个为了gzip压缩。

 

获取pcre包

 

  1. ./configure --prefix=/usr/local/pcre   #配置

ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/

注:上面所利用的有所版本均为停止二〇一七年九月14号,最新版本
1.选定源码目录
能够是其他目录,本文选定的是/usr/local/src

 

安装pcre

 

6.make

cd /usr/local/src

cd /usr/local/src

 

wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.37.tar.gz

 

7.make install

tar -zxvf pcre-8.37.tar.gz

2.安装PCRE库
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ 下载最新的 PCRE 源码包,使用下边施命发号下载编写翻译和设置 PCRE 包:

2.安装tengine依赖的library openssl.jar

cd pcre-8.34

 

 

./configure --prefix=/usr/local/pcre

cd /usr/local/src

1.cd /usr/local/src #到内定的目录下

make

wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.41.tar.gz

 

make install

tar -zxvf pcre-8.41.tar.gz

2.tar zxvf openssl-1.0.1c.tar.gz

 

cd pcre-8.41

 

报错

./configure

3.cd openssl-1.0.1c

configure: error: You need a C compiler for C support.

make

 

 

make install

  1. ./config --prefix=/usr/local/openssl

 

 

 

安装gcc

 

5.make

yum install gcc gcc-c

3.安装zlib库
 下载最新的 zlib 源码包,使用上边发号布令下载编译和设置 zlib包:

 

重新安装pcre,成功安装pcre

 

6.make install

 

 

cd /usr/local/src

wget http://zlib.net/zlib-1.2.11.tar.gz

tar -zxvf zlib-1.2.11.tar.gz

cd zlib-1.2.11

./configure

make

make install

 

2.3 安装zlib包

重新安装nginx

4.安装ssl(有个别vps暗中同意没装ssl卡塔尔(قطر‎

 

 

 

    1.cd /usr/local/src #到钦赐的目录下

./configure --sbin-path=/user/local/nginx/nginx --conf-path=/usr/local/nginx/nginx.conf --pid-path=/usr/local/nginx/nginx.pid

cd /usr/local/src

 

报错

wget

2.tar zxvf openssl-1.2.5.tar.gz

./configure: error: the HTTP gzip module requires the zlib library.

tar -zxvf openssl-1.0.2l.tar.gz

 

You can either disable the module by using --without-http_gzip_module

 

3.cd openssl-1.2.5

option, or install the zlib library into the system, or build the zlib library

5.安装nginx

 

statically from the source with nginx by using --with-zlib=<path> option.

Nginx 日常常有八个版本,分别是稳固版和开荒版,您能够依附你的目标来抉择那七个版本的里边三个,上边是把 Nginx 安装到 /usr/local/nginx 目录下的事必躬亲步骤:

  1. ./config --prefix=/usr/local/zlib

 

 

 

安装zlib

cd /usr/local/src

5.make

获取zlib包

wget

 

tar -zxvf nginx-1.13.4.tar.gz

6.make install

[root@bogon src]# tar -zxvf zlib-1.2.11.tar.gz

cd nginx-1.13.4

3.安装nginx

cd zlib-1.2.11

 

 

./configure --prefix=/usr/local/zlib

./configure --sbin-path=/usr/local/nginx/nginx

1.cd /usr/local/src #到钦命的目录下

make && make install

--conf-path=/usr/local/nginx/nginx.conf

 

 

--pid-path=/usr/local/nginx/nginx.pid

2.tar zxvf nginx.tar.gz

重新安装nginx

--with-http_ssl_module

 

./configure --sbin-path=/user/local/nginx/nginx --conf-path=/usr/local/nginx/nginx.conf --pid-path=/usr/local/nginx/nginx.pid

--with-pcre=/usr/local/src/pcre-8.41

3.cd nginx-1.3.8

 

--with-zlib=/usr/local/src/zlib-1.2.11

 

make && make install

--with-openssl=/usr/local/src/openssl-1.0.2l

  1. ./configure --prefix=/usr/local/nginx --sbin-path=/usr/local/nginx/sbin/nginx --conf-path=/usr/local/nginx/conf/nginx.conf --error-log-path=/usr/local/nginx/error.log --pid-path=/usr/local/nginx/nginx.pid --lock-path=/usr/local/nginx/nginx.lock  --with-http_stub_status_module --with-http_gzip_static_module --with-pcre=/usr/local/pcre-1.3.8 --with-zlib=/usr/local/zlib-1.2.5--with-openssl=/usr/local/openssl-8.12

 

 

 

启动

make

#--with-pcre=/usr/local/src/pcre --对应pcre解压路径

[root@bogon nginx]# systemctl start nginx

make install

 

Failed to start nginx.service: Unit nginx.service failed to load: No such file or directory.

 

#--sbin-path=/usr/local/nginx/sbin/nginx --nginx运行路线

表达安装退步

--with-pcre=/usr/local/src/pcre-8.41 指的是pcre-8.41 的源码路线。
--with-zlib=/usr/local/src/zlib-1.2.11 指的是zlib-1.2.11 的源码路线。

 

 

 

#--conf-path=/usr/local/nginx/conf/nginx.conf --nginx配置文件的门径

是否还未有设置ssl呢,笔者查到系统是有安装的,不放心本人就再设置三次吧.

设置成功:

 

./config --prefix=/usr/local --openssldir=/usr/local/ssl

设置成功后 /usr/local/nginx 会有此目录

#--error-log-path=/usr/local/nginx/error.log --日志贮存路线

make && make install

 

 

./config shared --prefix=/usr/local --openssldir=/usr/local/ssl

 

5.make

make clean

6.启动
有限帮衬系统的 80 端口没被其它程序占用,运维/usr/local/nginx/nginx 命令来运转 Nginx,

 

make && make install

 

6.make install

 

开辟浏览器访谈此机器的 IP,要是浏览器现身 Welcome to nginx! 则意味着 Nginx 已经安装并运行成功。

nginx安装完后亟需加多

看来照旧照着教程安装才算可信

 

 

删除zlib pcre


proxy.conf -- nginx代理tomcat文件和nginx.conf路线相符

到相应目录运维 make uninstall

到这里nginx就设置到位了,若是只是管理静态html就绝不继续设置了

 

 

只要你须要管理php脚本的话,还索要安装php-fpm。

nginx.conf --供给改过

安装pcre

 

 

cd /usr/local/src

 

启动nginx /usr/local/nginx/sbin/下 nginx为启动nginx

wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.37.tar.gz

科普错误:

 

tar -zxvf pcre-8.37.tar.gz

附:只怕碰着的不当和部分声援音信

停止nginx /usr/local/nginx/sbin/下 nginx为启动nginx -s stop

cd pcre-8.34

1.1编译pcre错误

 

./configure --prefix=/usr/local/pcre

 

3.安装tengine  www.2cto.com  

make

make[1]: Leaving directory `/usr/local/src/pcre-8.34'

 

make install

make: *** [all] Error 2

1.cd /usr/local/src #到钦命的目录下

 

 

 

安装zlib

解决办法:安装g ,别忘了重新configure

2.tar zxvf tengine-1.4.2.tar.gz

获取zlib包

 

 

apt-get install g

3.cd hotpost

[root@bogon src]# tar -zxvf zlib-1.2.11.tar.gz

apt-get install build-essential

 

cd zlib-1.2.11

make clean

4.

./configure --prefix=/usr/local/zlib

./configure

     ./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-openssl=/usr/local/src/openssl-1.0.1c --with-zlib=/usr/local/src/zlib-1.2.5 --with-pcre=/usr/local/src/pcre-8.12

make && make install

make

 

 

 

#--prefix=/usr/local/nginx --对应是tengine的路径

重新安装nginx

 

 

./configure --sbin-path=/usr/local/nginx/nginx

1.2 make出错

#--with-openssl=/usr/local/src/openssl --对应openssl解压的路线 实践tar zxvf pcre-8.13.tar.gz后的门道

--conf-path=/usr/local/nginx/nginx.conf

 

 

--pid-path=/usr/local/nginx/nginx.pid

make: ***澳门新萄京官方网站, No targets specified and no makefile found.  Stop.

#--with-pcre=/usr/local/src/pcre --对应pcre解压路线

--with-http_ssl_module

0编译安装。 

 

--with-pcre=/usr/local/src/pcre-8.40

安份守己下边安装方式

5.make

--with-zlib=/usr/local/src/zlib-1.2.11

yum -y install openssl openssl-devel

 

--with-openssl=/usr/local/src/openssl-1.0.2l

2.nginx编写翻译选项(上面代码必得在少年老成行)

6.make install

 

 

晋升恐怕碰到不平等的话,它会报少zlib包。步骤同上。超级轻松消除。

[root@bogon nginx-1.12.0]# ./configure --sbin-path=/usr/local/nginx/nginx

./configure --sbin-path=/usr/local/nginx/nginx

 

> --conf-path=/usr/local/nginx/nginx.conf

--conf-path=/usr/local/nginx/nginx.conf

近年来干活亟待,须要安插Taobao开采的tengine,查了有些资料。大概步骤如下: www.2cto.com 1.率先安装tengine信赖的library pcre.j...

> --pid-path=/usr/local/nginx/nginx.pid

0编译安装。--pid-path=/usr/local/nginx/nginx.pid

local/src/openssl-1.0.2l> --with-http_ssl_module

--with-http_ssl_module

> --with-pcre=/usr/local/src/pcre-8.40

--with-pcre=/usr/local/src/pcre-8.41

> --with-zlib=/usr/local/src/zlib-1.2.11

--with-zlib=/usr/local/src/zlib-1.2.11

> --with-openssl=/usr/local/src/openssl-1.0.2l

--with-openssl=/usr/local/src/openssl-1.0.2l

 

 

[root@bogon nginx-1.12.0]# make && make install

 

修改/etc/local/nginx/nginx.conf 将lisent商品80改为8080

开发银行服务:/etc/local/nginx/nginx

 

访问:http://192.168.158.128:8080

 

Welcome to nginx!

 

If you see this page, the nginx web server is successfully installed and working. Further configuration is required.

 

For online documentation and support please refer to nginx.org.

Commercial support is available at nginx.com.

 

Thank you for using nginx.

 

 

启动nginx服务

方法一:

/usr/local/nginx/nginx

措施二(-c nginx配置文件地方):

/usr/local/nginx/nginx -c /usr/local/nginx/nginx.conf

 

停止nginx服务

方式风华正茂:从容结束

查看进度

[root@bogon nginx]# ps -ef | grep nginx

root 62024 1 0 07:01 ? 00:00:00 nginx: master process /usr/local/nginx/nginx

nobody 62025 62024 0 07:01 ? 00:00:00 nginx: worker process

root 62308 18453 0 07:14 pts/1 00:00:00 grep --color=auto nginx

杀死进度

[root@bogon nginx]# kill -QUIT 62024

 

格局二:飞快甘休

翻看进程

[root@bogon nginx]# ps -ef | grep nginx

root 62358 1 0 07:17 ? 00:00:00 nginx: master process /usr/local/nginx/nginx -c /usr/local/nginx/nginx.conf

nobody 62359 62358 0 07:17 ? 00:00:00 nginx: worker process

root 62463 18453 0 07:20 pts/1 00:00:00 grep --color=auto nginx

杀掉进程

[root@bogon nginx]# kill -TERM 62358

或者

[root@bogon nginx]# /usr/local/nginx/nginx -c /usr/local/nginx/nginx.conf

[root@bogon nginx]# ps -ef | grep nginx

root 62473 1 0 07:21 ? 00:00:00 nginx: master process /usr/local/nginx/nginx -c /usr/local/nginx/nginx.conf

nobody 62474 62473 0 07:21 ? 00:00:00 nginx: worker process

root 62476 18453 0 07:21 pts/1 00:00:00 grep --color=auto nginx

[root@bogon nginx]# kill -INT 62473

 

艺术三:强制截至

[root@bogon nginx]# pkill -9 nginx

 

深感这些最佳记有未有?

今日轻巧安装就到此处,后天学一下配置. 

本文由澳门新萄京官方网站发布于澳门新萄京官方网站,转载请注明出处:0编译安装

关键词: