从局域网上的另一台计算机访问 wamp 中的网站文件和 phpmyadmin [英] Accessing website files and phpmyadmin in wamp from another computer on lan

查看:24
本文介绍了从局域网上的另一台计算机访问 wamp 中的网站文件和 phpmyadmin的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将我的文件托管在一台充当服务器的计算机上,但我想从局域网上的另一台计算机访问根 (www) 目录文件和 phpmyadmin.访问我的意思是编辑它们并打开它们以查看并对数据库和代码进行更改.这怎么可能?

I have my files hosted on one computer acting as the server , but I want to access the root (www) directory files and the phpmyadmin from another computer on the lan.By access I mean to edit them and open them to see and make changes to the database and code.How is it possible?

推荐答案

默认情况下,WAMPServer 被配置为在您的工作站上运行的独立开发系统.

By default WAMPServer is configured to be a standalone development system for running on your workstation.

如果您想在一台 PC 上运行 Wamp 并从另一台 PC 访问它,您必须更改 Apache 安全配置.

If you want to run Wamp on one PC and access it from another you have to change the Apache security configuration.

你没有提到任何有用的东西,比如你正在运行的 WampServer 版本,所以我想我必须记录这两个选项

You dont mention anything useful like the version of WampServer you are running so I guess I will have to document both options

编辑 httpd.conf(使用 wampmanager 菜单)

Edit httpd.conf ( using the wampmanager menus )

如果 Apache 2.2.x

找到此部分,为简洁起见,我已删除所有评论.

Locate this section, I have remove all the comments for the sake of brevity.

<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,您必须编辑此配置文件

Now to gain access to phpMyAdmin you have to edit this config file

编辑 C:wampaliasphpmyadmin.conf

Edit C:wampaliasphpmyadmin.conf

您需要在此处进行与上面相同的更改

You need to make the same sort of chnage in here as you did above

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>

Apache 2.4.x

Apache 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>

如果您可以遵循所有这些,您应该能够从您的内部局域网访问您的站点和 phpmyadmin.

If you can follow all that you should be able to access your site and phpmyadmin from your internal lan.

至于编辑站点的源代码,您必须在服务器上共享 c:wampwww 文件夹,然后将该共享映射到您正在使用的 PC 上.

As to editing the source of your site, you will have to share the c:wampwww folder on your server and then map that share on the PC you are working on.

这篇关于从局域网上的另一台计算机访问 wamp 中的网站文件和 phpmyadmin的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆