Apache IPv6 Enabled For Windows

本文介绍在Windows环境下如何搭建支持IPv6的Apache服务器。提供了两种解决方案:自行编译或使用第三方已编译版本。推荐使用ApacheHaus提供的预编译版本,包括安装步骤及命令说明。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

引子:最近需要搭建支持IPv6的Windows Server,故有此篇文章。

很多人都遇到了在Windows下安装Apache不支持IPv6访问的问题,通过两种办法可以解决这一问题:一是自己编译,二是从网上寻找现成的版本。自己编译我嫌麻烦,也没有研究过,有兴趣的可以去Demon的博客看看,那里有说如何编译使Windows下的Apache支持IPv6。而在网上寻找现成版本,最早找到的是XAMPP,它的新版本支持IPv6,但是XAMPP所带的PHP版本与我锁需要的版本不一样,有些PHP扩展无法支持,并且XAMPP的PHP和Apache都是它自己编译的,修改了很多东西,通用性较差。最终在Apache Haus上找到了Windows下支持IPv6第三方编译版本。

下载地址:http://www.apachehaus.com/cgi-bin/download.plx

目前支持IPv6的最新版本是Apache 2.2.15,32位和64位的版本都有,下载的时候注意“IPv6 Enabled”字样,别下错了。

另外还需要下载安装Microsoft Visual C++ 2008 Redistributable Package,这个网站编译版本需要安装这个东东。

下载地址:

Microsoft Visual C++ 2008 Redistributable Package (x86)

Microsoft Visual C++ 2008 Redistributable Package (x64)

安装方法:

1.安装Visual C++ 2008 Redistributable Package

2.将目录Apache2解压至C盘根目录下(因为配置文件中默认目录为c:/Apache2,如需要放在其他目录,请修改配置文件)。

3.打开命令行模式,并且进入Apache所在目录(如C:\Apache2),输入httpd.exe(回车)即可启动Apache

如果需要将Apache安装为服务,运行输入httpd.exe -k install(回车)

启动服务httpd.exe -k start(回车)

停止服务httpd.exe -k stop(回车)

重启服务httpd.exe -k restart(回车)

卸载服务httpd.exe -k uninstall(回车)

其实和官方编译的Apache使用完全一样。

原文出处:http://rayyn.net/apache-2-2-x-ipv6-enabled-for-win.html

root@jiang:/etc/apache2# apache2ctl -M | grep mpm AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message mpm_prefork_module (shared) root@jiang:/etc/apache2# root@jiang:/etc/apache2# systemctl restart apache2 root@jiang:/etc/apache2# systemctl status apache2 ● apache2.service - The Apache HTTP Server Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled) Active: active (running) since Fri 2025-03-14 10:52:41 CST; 1s ago Docs: https://httpd.apache.org/docs/2.4/ Process: 75126 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS) Main PID: 75130 (apache2) Tasks: 6 (limit: 9373) Memory: 13.3M CGroup: /system.slice/apache2.service ├─75130 /usr/sbin/apache2 -k start ├─75132 /usr/sbin/apache2 -k start ├─75133 /usr/sbin/apache2 -k start ├─75134 /usr/sbin/apache2 -k start ├─75135 /usr/sbin/apache2 -k start └─75136 /usr/sbin/apache2 -k start Mar 14 10:52:41 jiang systemd[1]: Starting The Apache HTTP Server... Mar 14 10:52:41 jiang apachectl[75129]: AH00558: apache2: Could not reliably determine the server's fully qualified domain nam> Mar 14 10:52:41 jiang systemd[1]: Started The Apache HTTP Server. root@jiang:/etc/apache2# ss -tulpn | grep ':8080' tcp LISTEN 0 511 *:8080 *:* users:(("apache2",pid=75136,fd=5),("apache2",pid=75135,fd=5),("apache2",pid=75134,fd=5),("apache2",pid=75133,fd=5),("apache2",pid=75132,fd=5),("apache2",pid=75130,fd=5)) root@jiang:/etc/apache2# ^C root@jiang:/etc/apache2# cat /proc/sys/net/ipv6/conf/all/disable_ipv6 0 root@jiang:/etc/apache2# apache2 -V | grep -i ipv6 [Fri Mar 14 10:53:26.989867 2025] [core:warn] [pid 81207] AH00111: Config variable ${APACHE_RUN_DIR} is not defined apache2: Syntax error on line 80 of /etc/apache2/apache2.conf: DefaultRuntimeDir must be a valid directory, absolute or relative to ServerRoot -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled) root@jiang:/etc/apache2#
03-15
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值