问题描述
奥莱特这我发疯!我花了几个小时,试图找到如何从访问我的Word preSS网站我的网络,当没有简单的解决办法,发现我只能够到我的网络中的其他设备访问该行之外的解决方案。它原来是一个棘手的一部分。我只是不知道如何配置这一点。
Allright this driving me nuts! I have spent couple of hours trying to find a solution of how to access my Wordpress site from outside my network, when no easy solution was found I'm OK with just being able to accessing it from another device within my network. It turned out to be a tricky part as well. I just don't know how to configure this.
我运行使用WAMP likeso虚拟主机:
I run virtual hosts using WAMP likeso:
在的httpd-vhosts.conf:
In httpd-vhosts.conf:
<VirtualHost *:80>
DocumentRoot "I:\web_dev\wordpress"
ServerAlias wordpress.local
ServerName wordpress.local
<Directory "I:\web_dev\wordpress">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
Require local
</Directory>
</VirtualHost>
我的httpd.conf文件设置为端口80:
My httpd.conf file is set to port 80:
服务器名本地主机:80
hosts文件:
127.0.0.1字press.local
如果我现在想从另一台计算机或我的手机是我的网络中访问此,我该如何实现这一目标?
If I now want to access this from another computer or my mobile that are in my network, how do I achieve this?
推荐答案
允许本地流量在httpd.conf,然后用你的实际IP作为WP URL。
在WAMP的httpd.conf文件,我添加了从192.168允许
行。
In WAMP's httpd.conf file, I added the Allow from 192.168
line.
# onlineoffline tag - don't remove
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from 192.168
然后在WP常规设置,我改变了字preSS地址
和网站地址
来的现场的实际IP。您可以在命令控制台通过 IPCONFIG
得到这个网站的IP4地址。
Then in the WP General settings, I changed the Wordpress Address
and Site Address
to the site's actual IP. You can get this site's IP4 address via ipconfig
in the command console.
然后就大功告成了。
如果你不希望别人你的本地网络在你的WAMP安装其余Snooping功能,请在服务器根(一个新的的.htaccess
文件中的 WWW
文件夹中)与此:
If you don't want people on your local network snooping around the rest of your WAMP setup, create a new .htaccess
file in the servers root (the www
folder) with this:
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
然后添加这上面无论是在WP的默认的.htaccess
Then add this above whatever is in WP's default .htaccess
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from 192.168
这篇关于访问使用WAMP网络中的局部字preSS的网站?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!