2

我已经在我办公室的一台 PC (Windows XP) 上安装了 xampp 和 wordpress。
目前我可以通过指定网络服务器的 pcname 来访问我的网页。例如 http://pcname
,我无法使用网络服务器的 IP 地址访问它。
关于如何使用 IP 地址访问它的任何想法,例如 http://192.xx.xx.xx

更多细节:
1.我可以在网络服务器本地使用http://localhost/xampp/或http://127.0.0.1/xampp/访问xampp主页,但无法通过指定其IP地址访问它(http: //192.xx.xx.xx/xampp/) 本地。从 http://pcname/xampp/ 访问时,我可以看到安全页面。
2.我在C:\xampp\htdocs根目录下安装了wordpress,并在“设置”-“常规”菜单中将“WordPress地址(URL)”和“站点地址(URL)”设置为http://pcname .
3.网络中的其他PC可以访问网络服务器中的共享文件夹(可以通过在Windows资源管理器中指定\pcname或\192.xx.xx.xx来访问PC。4.
网络服务器上的防火墙已禁用
。5.网络服务器具有静态 IP 地址。

4

1 回答 1

2

尝试这个:

停止 apache 服务器。在文本编辑器中打开 xampp\apache\conf\extra\httpd-xampp.conf 并在最后添加/更改以下内容:

#
# New XAMPP security concept
#

# Close XAMPP security section here 
<LocationMatch "^/(?i:(?:security))">
   Order deny,allow
   #Deny from all
   Allow from ::1 127.0.0.0/8 
   ErrorDocument 403 /error/HTTP_XAMPP_FORBIDDEN.html.var
</LocationMatch>

# Close XAMPP sites here
<LocationMatch "^/(?i:(?:xampp|licenses|phpmyadmin|webalizer|server-status|server-info))">
   Order deny,allow
   #Deny from all
   Allow from ::1 127.0.0.0/8 
   ErrorDocument 403 /error/HTTP_XAMPP_FORBIDDEN.html.var
</LocationMatch>

重新启动 apache 服务器。如果这可以解决任何问题,那么您必须修改这些安全设置,因为您的系统现在不安全。如果这对您没有任何帮助,请再次删除它。我无法建议您如何修改安全设置,请暂时询问其他人。

2.我在C:\xampp\htdocs根目录下安装wordpress,并在“设置”-“常规”中将“WordPress地址>(URL)”和“站点地址(URL)”设置为http://pcname菜单。

现在,如果这意味着您要更改 Wordpress 使用的 URL(从 //pcname 到 IP 地址,那么您有两种方法可以让 wordpress 再次工作:
1. 从头开始​​重新安装。2.
手动更改所有对所有文件数据库中的旧 URL 的引用。

无论如何,这是我的经验。

于 2011-10-17T08:33:36.910 回答