linux安装nginx
Posted xs
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了linux安装nginx相关的知识,希望对你有一定的参考价值。
pcre是用C语言编写的正则表达式函数库,nginx的rewrite需要正则表达式的支持,所以需要先安装pcre
一、安装pcre
最新地址在:ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre
执行:
[[email protected] package]# wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.tar.gz [[email protected] package]# tar -zxf pcre-8.38.tar.gz [[email protected] package]# cd pcre-8.38 [[email protected] pcre-8.38]# ./configure --prefix=/usr/local/pcre [[email protected] pcre-8.38]# make && make install
二、安装nginx
最新地址在:http://nginx.org/en/download.html
执行:
[[email protected] package]# wget http://nginx.org/download/nginx-1.12.1.tar.gz [[email protected] package]# tar -zxf nginx-1.12.1.tar.gz [[email protected] package]# cd nginx-1.12.1 [[email protected] nginx-1.12.1]# .configure --prefix=/usr/local/pcre [[email protected] nginx-1.12.1]# make && make install
三、nginx命令
启动
cd /usr/local/nginx/sbin ./nginx
重启
./nginx -s reload
关闭
kill -9 xxx
以上是关于linux安装nginx的主要内容,如果未能解决你的问题,请参考以下文章
Nginx——Nginx启动报错Job for nginx.service failed because the control process exited with error code(代码片段