apache 如何配置httpd在wamp中的conf,以便其他人可以在线访问我的Web服务器

uplii1fm  于 2023-05-01  发布在  Apache
关注(0)|答案(1)|浏览(161)

我希望在带有wamp的PC上设置一个用于测试目的的网页(我知道不推荐这样做)。
我遵循了这个指南:https://www.youtube.com/watch?v=b50hB7cfsfg
但是如果我改变httpd中的默认设置。配置:
listen 0.0.0.0:80
我的IP:
listen xxx.x.xxx.212

ServerName localhost:80

toServerName xxx.x.xxx.212

<Directory />     
    AllowOverride none     
    Require all denied 
</Directory>

<Directory />
    Order Deny,Allow
    Deny from all
</Directory>

然后重新启动wamp,我得到以下错误:

There is a syntax error in Apache conf files.
AH00526: Syntax error on line 70 of C:/wamp64/bin/apache/apache2.4.54.2/conf/httpd.conf:
Port must be specified

我应该怎么做来纠正这个错误?
我发现很多题目都有类似的问题,但都过时了。
(我安装了wamp 3。3.0)

amrnrhlw

amrnrhlw1#

:80放回listen指令,其中需要指定端口。
你不需要具体的IP地址。listen 0.0.0.0:80可以正常工作,这意味着在端口80上侦听所有IP地址。

相关问题