1

ウェブサイトをオンラインにしたい。WampServer 2.2 を使用しています。今、私は次のようにワンプを設定しました:

<Directory />
  AllowOverride All
  Options All
  Require all granted
  Order allow,deny
</Directory>

Listen 81
<VirtualHost *:81>
  ServerName rti.etf.rs
  DocumentRoot "C:/wamp/www"
  DirectoryIndex index.php
</VirtualHost>

Windows ファイアウォールでポート 81 を開放しました。ここで、localhost:81 を開こうとすると、Web ページが正常に開きます。しかし、外部 IP アドレス 176.xxx.xxx.xxx:81 でアクセスしようとすると、403 Forbidden エラーが発生します。これらのリクエストは Apache のアクセス ログに表示されているので、その部分はうまく設定されていると思いますが、Apache の構成に何か抜けているに違いありません。

編集:オンラインにするオプションが有効になっています。

役立つアイデアはありますか?

4

1 に答える 1

1

使用している Apache のバージョンを指定していませんでした。また、Apache 2.2 の構文と Apache 2.4 の構文が混同されているようですので、両方のバージョンを示します。

このセクションを元の状態に戻します。これにより、アクセスが制御され、C:\完全なアクセスが許可されました。良くありません。

から

<Directory />
  AllowOverride All
  Options All
  Require all granted
  Order allow,deny
</Directory>

Apache 2.2.x 構文に

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order Deny,Allow
    Deny from all
</Directory>

Apache2.4.x 構文

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Require all denied
</Directory>




次に、仮想ホストに移動します。これには、ブロック内で独自のセキュリティを指定する必要もあります

Listen 81
<VirtualHost *:81>
  ServerName rti.etf.rs
  DocumentRoot "C:/wamp/www"
  DirectoryIndex index.php
#### Apache 2.2 syntax
  <Directory "C:/wamp/www/">
     AllowOverride All
     Order Allow,Deny
     Allow from all
  </Directory>
#### Apache 2.4 syntax
  <Directory "C:/wamp/www/">
     AllowOverride All
     Require all granted
  </Directory>
</VirtualHost>

PS。ポート 81 を使用する利点は見当たらず、外部ユーザーの作業が複雑になるだけです。

于 2013-09-24T08:59:11.190 に答える