First, add IPv6 module for Nginx
Executing in the SSH window
/www/wdlinux/nginx/sbin/nginx-v
Return contains the following characters
Configure arguments:--user=www--group=www--prefix=/www/wdlinux/nginx-1.0.12--with-http_stub_status_module-- With-http_ssl_module
Note The default does not compile the Nginx IPv6 module, so we need to recompile the nginx to add the IPv6 module
Do not exclude later versions will be IPv6 compiled by default, if with "--with-ipv6" to indicate that the IPv6 module has been added, please view the second step directly
Enter Nginx installation directory
cd/root/lanmp/nginx-1.0.12
Perform
./configure--user=www--group=www--prefix=/www/wdlinux/nginx-1.0.12--with-http_stub_status_module--with-http_ Ssl_module--with-ipv6
Return the correct information, and then enter
Make
Compile will be in the OBJS directory to generate a Nginx execution file, first back up the original old Nginx file, execution: mv/www/wdlinux/nginx-1.0.12/sbin/nginx/www/wdlinux/nginx-1.0.12/ Sbin/nginx.old, and then under the new OBJS under the Nginx CP to Sbin, execute: CP Objs/nginx/www/wdlinux/nginx-1.0.12/sbin/nginx
can perform
/www/wdlinux/nginx/sbin/nginx-t
Return
Nginx:the configuration file/www/wdlinux/nginx-1.0.14/conf/nginx.conf syntax is OK
Nginx:configuration file/www/wdlinux/nginx-1.0.14/conf/nginx.conf Test is successful
Description Nginx has been successfully compiled
Perform execution
/www/wdlinux/nginx/sbin/nginx-v
Return contains the following characters
Configure arguments:--user=www--group=www--prefix=/www/wdlinux/nginx-1.0.14--with-http_stub_status_module-- With-http_ssl_module--with-ipv6
Description IPv6 module has been added successfully
Perform
Make upgrade
Upgrade Programs
Ii. Configure Nginx to enable monitoring of access requests via IPv6
In all *.conf files in the/www/wdlinux/nginx-1.0.12/conf/vhost
Listen 80;
To
Listen [::]:80;
To monitor all IPv4, IPv6 addresses of the machine
Perform here
/www/wdlinux/nginx/sbin/nginx-t
If you return
Nginx:the configuration file/www/wdlinux/nginx-1.0.12/conf/nginx.conf syntax is OK
Nginx:configuration file/www/wdlinux/nginx-1.0.12/conf/nginx.conf Test is successful
Description Nginx configured correctly
Reboot Nginx, execute first
Killall Nginx
Re-execution
/www/wdlinux/nginx-1.0.12/sbin/nginx
Third, for the domain name to add AAAA records, after the entry into force, you can visit the website through IPv6, if the domain Name Service provider does not support AAAA resolution, recommend dnspod, free, easy to use
or directly using http://[ipv6]/to access the default Web site on the host
Note: 1, please make sure the host with Ipv6,ifconfig view
2, other host environment, please amend according to the situation appropriate
3, two step if you do not want to monitor all IP, please modify
Listen [::]:80;
For
Listen ipv4:80;
Listen [ipv6]:80;
If you feel the complexity of adding the IPv6 module to the above, we can also use a slightly more official Nginx upgrade script to achieve the goal of a key support IPv6.
Download a key upgrade script to perform
wget http://down.wdlinux.cn/in/nginx_up.sh
and then open
nginx_up.sh
Find
./configure--user=www--group=www--prefix=/www/wdlinux/nginx-$ver--with-http_stub_status_module--with-http_ssl_ Module
About 15 lines, and then add
--with-ipv6
Become
./configure--user=www--group=www--prefix=/www/wdlinux/nginx-$ver--with-http_stub_status_module--with-http_ssl_ Module--with-ipv6
Save, exit
Perform
SH nginx_up.sh
The default upgrade is 1.0.14, and if you want to specify a version, execute the script background with the version number,
Add the IPv6 module only if the version number is currently in use
For example: Execute
SH nginx_up.sh 1.0.12
The effect is exactly the same as step one above.