wordpress 多语言站点,html5网站模板 免费,网站建设一般需要多久,黄山做网站目录 搭建并测试1. 下载 NG 安装包2. 安装编译工具及库文件3. 上传并解压安装包4. 编译5. 安装6. 修改配置7. 启动 NG8. 查看 IP 地址9. 测试 IP 地址9.1. 测试 IPV4 地址9.2. 测试 IPV6 地址 IPV6 测试失败原因1. curl: [globbing] error: bad range specification after pos … 目录 搭建并测试1. 下载 NG 安装包2. 安装编译工具及库文件3. 上传并解压安装包4. 编译5. 安装6. 修改配置7. 启动 NG8. 查看 IP 地址9. 测试 IP 地址9.1. 测试 IPV4 地址9.2. 测试 IPV6 地址 IPV6 测试失败原因1. curl: [globbing] error: bad range specification after pos 92. curl: Failed to connect to 0.0.0.10: Invalid argument 搭建并测试
1. 下载 NG 安装包
点击进入 Nginx 网址下载安装包
2. 安装编译工具及库文件
yum -y install make zlib zlib-devel gcc-c libtool openssl openssl-devel pcre-devel3. 上传并解压安装包
// 进入指定目录ftp 上传压缩包tar -zxvf nginx-1.26.2.tar.gz4. 编译
./configure --prefix/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-ipv65. 安装
make make install6. 修改配置
# 进入 NG 配置文件夹
cd /usr/local/nginx/conf# 修改 NG 配置文件
vim nginx.confhttp {......server {......listen 80; # IPV4listen [::]:80; # IPV6......}......
}7. 启动 NG
# 启动 NG
./nginx # 停止 NG
./nginx -s stop# 重启 NG
./nginx -s reload8. 查看 IP 地址
[rootiZf8z6w83m8z8cj3m3lmubZ conf]# ip a
1: lo: LOOPBACK,UP,LOWER_UP mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet 127.0.0.1/8 scope host lovalid_lft forever preferred_lft foreverinet6 ::1/128 scope host valid_lft forever preferred_lft forever
2: eth0: BROADCAST,MULTICAST,UP,LOWER_UP mtu 1500 qdisc pfifo_fast state UP group default qlen 1000link/ether 00:16:3e:0a:74:78 brd ff:ff:ff:ff:ff:ffinet 172.18.133.39/20 brd 172.18.143.255 scope global dynamic eth0valid_lft 315340442sec preferred_lft 315340442secinet6 2408:4008:1105:4901:b3f7:6c00:f1d7:e412/64 scope global valid_lft forever preferred_lft forever9. 测试 IP 地址
9.1. 测试 IPV4 地址
[rootiZf8z6w83m8z8cj3m3lmubZ conf]# curl 172.18.133.39:80
!DOCTYPE html
html
head
titleWelcome to nginx!/title
style
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif; }
/style
/head
body
h1Welcome to nginx!/h1
pIf you see this page, the nginx web server is successfully installed and
working. Further configuration is required./ppFor online documentation and support please refer to
a hrefhttp://nginx.org/nginx.org/a.br/
Commercial support is available at
a hrefhttp://nginx.com/nginx.com/a./ppemThank you for using nginx./em/p
/body
/html9.2. 测试 IPV6 地址
[rootiZf8z6w83m8z8cj3m3lmubZ conf]# curl -6 -g http://[2408:4008:1105:4901:b3f7:6c00:f1d7:e412]:80
[rootiZf8z6w83m8z8cj3m3lmubZ conf]# curl http://2408:4008:1105:4901:b3f7:6c00:f1d7:e412:80
!DOCTYPE html
html
head
titleWelcome to nginx!/title
style
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif; }
/style
/head
body
h1Welcome to nginx!/h1
pIf you see this page, the nginx web server is successfully installed and
working. Further configuration is required./ppFor online documentation and support please refer to
a hrefhttp://nginx.org/nginx.org/a.br/
Commercial support is available at
a hrefhttp://nginx.com/nginx.com/a./ppemThank you for using nginx./em/p
/body
/htmlIPV6 测试失败原因
1. curl: [globbing] error: bad range specification after pos 9
IPV6 地址中含有 : 等符号可能在解析时报错需要使用 [] 将 IPV6 地址包起来避免解析报错。
# 错误写法
curl http://[2408:4008:1105:4901:b3f7:6c00:f1d7:e412]
或
curl http://[2408:4008:1105:4901:b3f7:6c00:f1d7:e412:80]2. curl: Failed to connect to 0.0.0.10: Invalid argument
原因存在多种我遇到是一个比较奇葩的原因。在阿里云和腾讯云中curl 指定的 IPV6 地址必须与控制台分配的 IPV6 地址一致,自己手动配置的不行。