GCC & GCC-C++
[root
@jdu4e00u53f7 ~]
[root
@jdu4e00u53f7 ~]
若未安装GCC,后续安装Nginx时会报如下错误:
./configure:
error: C compiler cc
is not found
若未安装GCC-C++,后续安装PCRE库时会报如下错误:
configure:
error: You need a C++ compiler
for C++ support.
PCRE library
[root
@jdu4e00u53f7 centos]
[root
@jdu4e00u53f7 centos]
[root
@jdu4e00u53f7 centos]
[root
@jdu4e00u53f7 pcre-
8.41]
[root
@jdu4e00u53f7 pcre-
8.41]
[root
@jdu4e00u53f7 pcre-
8.41]
可在 [
https://
ftp.pcre.org/pub/pcre/](
https://
ftp.pcre.org/pub/pcre/) 查看最新版本。
若未安装PCRE库,后续安装Nginx时会报以下错误:
./configure: error:
the HTTP rewrite module requires
the PCRE library.
You can either disable
the module
by using
option,
or install
the PCRE library
into the system,
or build
the PCRE library
statically
from the source
with nginx
by using
ZLIB Library
[root
@jdu4e00u53f7 centos]
[root
@jdu4e00u53f7 centos]
[root
@jdu4e00u53f7 centos]
[root
@jdu4e00u53f7 zlib-
1.2.
11]
[root
@jdu4e00u53f7 zlib-
1.2.
11]
[root
@jdu4e00u53f7 zlib-
1.2.
11]
可在 [
http://www.zlib.net/](
http://www.zlib.net/) 查看最新版本。
若未安装ZLIB库,后续安装Nginx时会报以下错误:
./configure: error:
the HTTP gzip module requires
the zlib library.
You can either disable
the module
by using
option,
or install
the zlib library
into the system,
or build
the zlib library
statically
from the source
with nginx
by using
Nginx
[root
@jdu4e00u53f7 centos]
[root
@jdu4e00u53f7 centos]
[root
@jdu4e00u53f7 centos]
[root
@jdu4e00u53f7 nginx-
1.13.
4]
[root
@jdu4e00u53f7 nginx-
1.13.
4]
[root
@jdu4e00u53f7 nginx-
1.13.
4]
可在 [
http://nginx.org/download/](
http://nginx.org/download/) 查看最新版本。
Nginx的默认安装位置为 /usr/local/nginx 。
[root
@jdu4e00u53f7 centos]
[root
@jdu4e00u53f7 nginx]
conf html logs sbin
[root
@jdu4e00u53f7 nginx]
[root
@jdu4e00u53f7 nginx]
root
30325 1 0 23:
47 ?
00:
00:
00 nginx: master process ./sbin/nginx
nobody
30326 30325 0 23:
47 ?
00:
00:
00 nginx: worker process
root
30328 14495 0 23:
47 pts/
1 00:
00:
00 grep --color=auto nginx
当前工作路径为 /user/
local/nginx 。
./sbin/nginx 启动 Nginx,默认端口为
80。
修改端口号可编辑 ./conf/nginx.conf 中的
"listen 80;",如可以修改为
"listen 8080;"。
35 server {
36 listen 8080;
37 server_name localhost;
38
39
40
41
42
43 location / {
44 root html;
45 index index.html
index.htm;
46 }
保存退出后使用
"./sbin/nginx -s reload" 重新加载配置文件。