2

Apache xampp をインストールしましたが、すべて内部で動作しています。次に、ポート 8080 とルーターの IP アドレスをサーバーの内部 IP アドレスにリダイレクトしました。nat が行われていることを確認でき、サーバー上で httpd.exe が通過していることを確認できますが、外部からは接続できません。

Listen 192.168.0.47:8080
ServerAdmin postmaster@192.168.0.47
ServerName 192.168.0.47:8080
DocumentRoot "/xampp/htdocs"
<Directory />
AllowOverride none
Require all granted
</Directory>
<Directory "/xampp/htdocs">

    Options Indexes FollowSymLinks Includes ExecCGI


    AllowOverride All


    Require all granted

</Directory>
<Files ".ht*">
    Require all denied
</Files>
container, that host's errors will be logged there and not here.
ErrorLog "logs/error.log"
CustomLog "logs/access.log" combined
</IfModule>
<IfModule alias_module>
ScriptAlias /cgi-bin/ "/xampp/cgi-bin/"
</IfModule>
<IfModule cgid_module>

</IfModule>
<Directory "/xampp/cgi-bin">
    AllowOverride None
    Options None
    Require all granted
</Directory>
4

2 に答える 2

3

次の 3 行を変更する必要があります。

Listen 192.168.0.47:8080
ServerAdmin postmaster@192.168.0.47
ServerName 192.168.0.47:8080

これだけに:

Listen 8080

現在、サーバーは での接続のみをリッスンしています192.168.0.47。外部接続は ISP の IP アドレスに到達します。

URLを使用して接続ServerNameしない限り、必要ありません。これは、 Apache が外部 IP へのリクエストを拒否するように、サーバーに HTTP_HOST を探すように指示します。192.168.0.47

于 2013-05-30T11:11:27.993 に答える
3
Listen 192.168.0.47:8080  

する必要があります

Listen 0.0.0.0:8080

ローカル IP からのリクエストのみをリッスンする

于 2013-05-30T11:07:35.167 に答える