Nginx安装配置过程
以Linux系统为例
1、到Nginx官网下载tar.gz,地址:http://nginx.org/en/download.html
或者在Linux上通过命令wget http://nginx.org/download/nginx-1.13.10.tar.gz下载
2、解压包:tar -zxvf nginx-1.13.10.tar.gz
3、设置一下配置信息 ./configure –prefix=/usr/local/nginx
第三捕可能出现如下错误:
解决方式: 执行yum -y install pcre-devel(安装pcre-devel)
也许还会有如下错误:
./configure: error: the HTTP gzip module requires the zlib library.
You can either disable the module by using –without-http_gzip_module
option, or install the zlib library into the system, or build the zlib library
statically from the source with nginx by using –with-zlib= option.
解决方式:yum install -y zlib-devel(安装gzip)
再次执行./configure –prefix=/usr/local/nginx
出现以上表示成功
接着执行
make
make install
出现如下:
到此Nginx安装配置完成
启动nginx:cd /usr/local/nginx/sbin
./nginx
查看进程:ps -aux | grep nginx
退出Nginx: ./nginx -s quit
重启Nginx: ./nginx -s reload
测试:
访问对应安装Nginx的linux的ip,出现如下界面即安装成功。