2013-10-16 69 views

回答

6

默認情況下,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 \別名\ phpmyadmin.conf

你需要做相同的排序chnage在這裏,你上面

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

更改此

<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的。

至於編輯您的網站的來源,您將不得不共享服務器上的c:\ wamp \ www文件夾,然後將該共享映射到您正在使用的PC上。

相關問題