サーバーとして機能する 1 台のコンピューターでファイルをホストしていますが、LAN 上の別のコンピューターからルート (www) ディレクトリ ファイルと phpmyadmin にアクセスしたいと考えています。データベースとコードに.どのように可能ですか?
1 に答える
デフォルトでは、WAMPServer は、ワークステーションで実行するためのスタンドアロン開発システムになるように構成されています。
ある PC で Wamp を実行し、別の PC からアクセスする場合は、Apache セキュリティ構成を変更する必要があります。
実行している WampServer のバージョンのような有用なものについて言及していないので、両方のオプションを文書化する必要があると思います
httpd.conf を編集します (wampmanager メニューを使用)。
Apache 2.2.x の場合
このセクションを見つけてください。簡潔にするためにすべてのコメントを削除しました。
<Directory "c:/wamp/www/">
Options Indexes FollowSymLinks
AllowOverride all
# onlineoffline tag - don't remove
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Directory>
への変更 :
<Directory "c:/wamp/www/">
Options Indexes FollowSymLinks
AllowOverride all
# onlineoffline tag - don't remove
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 ::1 localhost
## Add an ip range that matches your routers first 3 quartiles
## So if your router subnet is 192.168.0 ( use ipconfig to find out what your router is set to )
## This will allow any PC on your internal network to access the www folder and subfolders
Allow from 192.168.0
## Or you can specify a specific ip or set of ip's like this
## Allow from 192.168.0.10 192.168.0.11 192.168.0.12 ....
</Directory>
Apache 2.4.x の場合 このセクションを見つけます
<Directory "c:/wamp/www">
Options Indexes FollowSymLinks
AllowOverride all
#
# Controls who can get stuff from this server.
#
# onlineoffline tag - do not remove
Require local
</Directory>
への変更 :
<Directory "c:/wamp/www">
Options Indexes FollowSymLinks
AllowOverride all
#
# Controls who can get stuff from this server.
#
# onlineoffline tag - do not remove
Require local
Require ip 192.168.0
## Apply the same logic as above for specific ip's or a set of ip's
## i.e. Require ip 192.168.0.10 192.168.0.11 .....
</Directory>
phpMyAdmin にアクセスするには、この設定ファイルを編集する必要があります
C:\wamp\alias\phpmyadmin.conf を編集します。
上で行ったのと同じ種類の変更をここで行う必要があります
Apache 2.2.x これを変更
<Directory "c:/wamp/apps/phpmyadmin3.5.1/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 ::1
</Directory>
に
<Directory "c:/wamp/apps/phpmyadmin3.5.1/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 ::1
Allow from 192.168.0
</Directory>
アパッチ 2.4.x
これを変える
<Directory "c:/wamp/apps/phpmyadmin4.0.4/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Require local
</Directory>
に
<Directory "c:/wamp/apps/phpmyadmin4.0.4/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Require local
Require ip 192.168.0
</Directory>
すべて従うことができれば、内部 LAN からサイトと phpmyadmin にアクセスできるはずです。
サイトのソースの編集に関しては、サーバーで c:\wamp\www フォルダーを共有し、作業中の PC でその共有をマップする必要があります。