远程访问Apache服务器,细跟本地IP,错误全球 [英] Accessing apache server remotely, fine with local ip, error with global

查看:229
本文介绍了远程访问Apache服务器,细跟本地IP,错误全球的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经建立了一个网络服务器,以及我的网件路由器上添加防火墙例外和33.060.99,当我试图用我的本地IP地址来访问本地计算机上的服务器能正常工作,但是我想测试一下,看看是否所以我尝试使用在本地计算机上我的全球IP地址但它只是我的加载路由器管理页面远程计算机可以访问服务器。我使用了错误的IP?我用谷歌找到我的全球IP。我运行Windows

下面是我的Apache配置:

 
#这是主要的Apache HTTP服务器的配置文件。它包含的
#配置指令,让服务器的指令。
#见<网址:HTTP://httpd.apache.org/docs/2.4/>了解详细信息。
#特别是,看到
#<网址:HTTP://httpd.apache.org/docs/2.4/mod/directives.html>
#每个配置指令的讨论。

#不要只是简单的阅读说明书不求甚解
# 他们做什么。他们在这里只起提示。如果你不确定
#咨询在线文档。你被警告了。

#配置和日志文件名:如果文件名指定为许多
服务器的控制文件#开始/(或驱动器:/为Win32)中,
#服务器将使用绝对路径。如果文件名不*不*开始
#以/,ServerRoot的值是prepended - 如此日志/访问日志
#ServerRoot的带设置为在/ usr /本地/ Apache2的将被PTED间$ P $
#服务器的/ usr /本地/ Apache2的/日志/访问日志,而/日志/访问日志
#将PTED为/日志/访问日志'间$ P $。

#注意:在文件名的,则必须使用正斜杠
#而不是反斜杠(例如,C:/阿帕奇而不是C:\\阿帕奇)。
#如果省略了盘符,该驱动器上httpd.exe位于
#将默认使用。建议您始终提供
#在绝对路径明确的驱动器盘符,以避免混乱。#
#ServerRoot的:目录树的顶部根据该服务器的
#配置,错误和日志文件保存。

#不要在目录路径的末尾添加斜线。如果你点
在非本地磁盘#ServerRoot的,请务必在指定本地磁盘
#互斥指令,如果使用基于文件的互斥。如果你想分享
#多的httpd守护进程相同的ServerRoot,您将需要改变
#至少PIDFILE。

ServerRoot的C:/wamp/bin/apache/apache2.4.4#
#互斥:允许您设置互斥机制和互斥文件目录
#个人互斥体,或更改全局默认值

#取消和更改目录,如果互斥是基于文件和缺省
#互斥文件目录是不是在本地磁盘上或不适合某些
#其他原因。

#互斥默认:日志#
#Listen:允许你将Apache绑定到特定的IP地址和/或
#端口,而不是默认的。另见的<&虚拟主机GT;
#指令。

#更改为侦听特定的IP地址,如下所示
#prevent阿帕奇从glomming到所有绑定的IP地址。

#Listen 127.0.0.1:80
听80#
#动态共享对象(DSO)支持

#为了能够使用其建成一个DSO你模块的功能
#必须把相应的`的LoadModule'线在这个位置使
其中包含的#指令实际可用_before_使用它们。
静态编译模块(在httpd -l列出)不需要
在此装载#。

#示例:
#的LoadModule foo_module模块/ mod_foo.so

的LoadModule access_compat_module模块/ mod_access_compat.so
的LoadModule actions_module模块/ mod_actions.so
的LoadModule alias_module模块/ mod_alias.so
的LoadModule allowmethods_module模块/ mod_allowmethods.so
的LoadModule asis_module模块/ mod_asis.so
的LoadModule auth_basic_module模块/ mod_auth_basic.so
#LoadModule auth_digest_module模块/ mod_auth_digest.so
#LoadModule authn_anon_module模块/ mod_authn_anon.so
的LoadModule authn_core_module模块/ mod_authn_core.so
#LoadModule authn_dbd_module模块/ mod_authn_dbd.so
#LoadModule authn_dbm_module模块/ mod_authn_dbm.so
的LoadModule authn_file_module模块/ mod_authn_file.so
#LoadModule authn_socache_module模块/ mod_authn_socache.so
#LoadModule authnz_ldap_module模块/ mod_authnz_ldap.so
的LoadModule authz_core_module模块/ mod_authz_core.so
#LoadModule authz_dbd_module模块/ mod_authz_dbd.so
#LoadModule authz_dbm_module模块/ mod_authz_dbm.so
的LoadModule authz_groupfile_module模块/ mod_authz_groupfile.so
的LoadModule authz_host_module模块/ mod_authz_host.so
#LoadModule authz_owner_module模块/ mod_authz_owner.so
的LoadModule authz_user_module模块/ mod_authz_user.so
的LoadModule autoindex_module模块/ mod_autoindex.so
#LoadModule buffer_module模块/ mod_buffer.so
#LoadModule cache_module模块/ mod_cache.so
#LoadModule cache_disk_module模块/ mod_cache_disk.so
#LoadModule cern_meta_module模块/ mod_cern_meta.so
的LoadModule cgi_module模块/ mod_cgi.so
#LoadModule charset_lite_module模块/ mod_charset_lite.so
#LoadModule data_module模块/ mod_data.so
#LoadModule dav_module模块/ mod_dav.so
#LoadModule dav_fs_module模块/ mod_dav_fs.so
#LoadModule dav_lock_module模块/ mod_dav_lock.so
#LoadModule dbd_module模块/ mod_dbd.so
#LoadModule deflate_module模块/ mod_deflate.so
的LoadModule dir_module模块/ mod_dir.so
#LoadModule dumpio_module模块/ mod_dumpio.so
的LoadModule env_module模块/ mod_env.so
#LoadModule expires_module模块/ mod_expires.so
#LoadModule ext_filter_module模块/ mod_ext_filter.so
#LoadModule file_cache_module模块/ mod_file_cache.so
#LoadModule filter_module模块/ mod_filter.so
#LoadModule headers_module模块/ mod_headers.so
#LoadModule heartbeat_module模块/ mod_heartbeat.so
#LoadModule heartmonitor_module模块/ mod_heartmonitor.so
#LoadModule ident_module模块/ mod_ident.so
#LoadModule imagemap_module模块/ mod_imagemap.so
的LoadModule include_module模块/ mod_include.so
#LoadModule info_module模块/ mod_info.so
的LoadModule isapi_module模块/ mod_isapi.so
#LoadModule lbmethod_bybusyness_module模块/ mod_lbmethod_bybusyness.so
#LoadModule lbmethod_byrequests_module模块/ mod_lbmethod_byrequests.so
#LoadModule lbmethod_bytraffic_module模块/ mod_lbmethod_bytraffic.so
#LoadModule lbmethod_heartbeat_module模块/ mod_lbmethod_heartbeat.so
#LoadModule ldap_module模块/ mod_ldap.so
#LoadModule logio_module模块/ mod_logio.so
的LoadModule log_config_module模块/ mod_log_config.so
#LoadModule log_debug_module模块/ mod_log_debug.so
#LoadModule log_forensic_module模块/ mod_log_forensic.so
#LoadModule lua_module模块/ mod_lua.so
的LoadModule mime_module模块/ mod_mime.so
#LoadModule mime_magic_module模块/ mod_mime_magic.so
的LoadModule negotiation_module模块/ mod_negotiation.so
#LoadModule proxy_module模块/ mod_proxy.so
#LoadModule proxy_ajp_module模块/ mod_proxy_ajp.so
#LoadModule proxy_balancer_module模块/ mod_proxy_balancer.so
#LoadModule proxy_connect_module模块/ mod_proxy_connect.so
#LoadModule proxy_ex press_module模块/ mod_proxy_ex press.so
#LoadModule proxy_fcgi_module模块/ mod_proxy_fcgi.so
#LoadModule proxy_ftp_module模块/ mod_proxy_ftp.so
#LoadModule proxy_html_module模块/ mod_proxy_html.so
#LoadModule proxy_http_module模块/ mod_proxy_http.so
#LoadModule proxy_scgi_module模块/ mod_proxy_scgi.so
#LoadModule ratelimit_module模块/ mod_ratelimit.so
#LoadModule reflector_module模块/ mod_reflector.so
#LoadModule remoteip_module模块/ mod_remoteip.so
#LoadModule request_module模块/ mod_request.so
#LoadModule reqtimeout_module模块/ mod_reqtimeout.so
#LoadModule rewrite_module模块/ mod_rewrite.so
#LoadModule sed_module模块/ mod_sed.so
#LoadModule session_module模块/ mod_session.so
#LoadModule session_cookie_module模块/ mod_session_cookie.so
#LoadModule session_crypto_module模块/ mod_session_crypto.so
#LoadModule session_dbd_module模块/ mod_session_dbd.so
的LoadModule setenvif_module模块/ mod_setenvif.so
#LoadModule slotmem_plain_module模块/ mod_slotmem_plain.so
#LoadModule slotmem_shm_module模块/ mod_slotmem_shm.so
#LoadModule socache_dbm_module模块/ mod_socache_dbm.so
#LoadModule socache_memcache_module模块/ mod_socache_memcache.so
#LoadModule socache_shmcb_module模块/ mod_socache_shmcb.so
#LoadModule speling_module模块/ mod_speling.so
#LoadModule ssl_module模块/ mod_ssl.so
#LoadModule status_module模块/ mod_status.so
#LoadModule substitute_module模块/ mod_substitute.so
#LoadModule unique_id_module模块/ mod_unique_id.so
#LoadModule userdir_module模块/ mod_userdir.so
#LoadModule usertrack_module模块/ mod_usertrack.so
#LoadModule version_module模块/ mod_version.so
#LoadModule vhost_alias_module模块/ mod_vhost_alias.so
#LoadModule watchdog_module模块/ mod_watchdog.so
#LoadModule xml2enc_module模块/ mod_xml2enc.so的LoadModule php5_moduleC:/wamp/bin/php/php5.4.16/php5apache2_4.dll< IfModule unixd_module>

#如果你想的httpd作为一个不同的用户或组运行,则必须运行
#的httpd以root最初,它会切换。

#用户/组:用户/组运行httpd的名称(或#NUMBER)。
#它通常是很好的做法,建立一个专门的用户和组
#运行的httpd,与大多数的系统服务。

用户守护进程
集团守护进程< / IfModule>#主服务器配置

#本节中的指示成立了由'主'使用的值
#服务器,这是为了响应不是由一个处理的所有请求
#<虚拟主机>定义。这些值也为默认值
#任何<虚拟主机>容器可能会在文件中定义后面。

#所有这些指令可能会出现内部<虚拟主机>集装箱,
#在这种情况下,这些默认设置将被覆盖的
#虚拟主机被定义。
##
#的ServerAdmin:你的邮件地址,当服务器的问题,应该是
#电子邮件发送。这个地址显示在服务器生成的页面,如
#作为一个出错文档。例如admin@your-domain.com

的ServerAdmin admin@example.com#
#ServerName指定Apache用于识别自身的名字和端口。
#通常可以自动确定,但我们建议您指定
#它明确地启动时prevent问题。

#如果你的主机没有注册DNS名,在这里输入IP地址。

服务器名本地主机#
#拒绝访问您的服务器的文件系统的全部内容。你必须
#明确允许访问其他Web内容目录
#<名录及GT;下面块。

<目录/>
    没有的AllowOverride
    要求所有批准
< /目录>#
#注意,从这一点你一定要明确允许
#特别是功能启用 - 所以,如果事情不工作的
#你所期望的,请确保您已专门启用它
#以下。
##
#的DocumentRoot:目录外面,你会为你的
#文件。默认情况下,所有的请求都从这里开始,但
#符号链接和别名可用于指向其他位置。

的DocumentRootC:/ WAMP / WWW
<目录C:/ WAMP / WWW>
    #
    在Options指令#可能的值是无,全部,
    #或任意组合:
    #指标包括了FollowSymLinks SymLinksifOwnerMatch ExecCGI多视图
    #
    #注意,多视图必须显式的指定---所有选项
    #它不给你。
    #
    #Options指令既复杂又重要。请参见
    #http://httpd.apache.org/docs/2.4/mod/core.html#options
    # 了解更多信息。
    #
    #Options指数的FollowSymLinks
选择指数包括了FollowSymLinks ExecCGI    #
    #设置AllowOverride控制那些被放置在.htaccess文件。
    #它可以是全部,无,或关键字的任意组合:
    #设置AllowOverride FileInfo的AuthConfig极限
    #
    所有的AllowOverride    #
    #控制谁可以从服务器获得资料。
    #
#要求所有批准
#onlineoffline标签 - 不要删除
     为了拒绝,允许
     所有#Deny
     所有允许
< /目录>#
#DirectoryIndex的:它设置Apache将服务如果一个目录中的文件
#请求。

< IfModule dir_module>
    DirectoryIndex的的index.php index.php3 index.htm的index.html的
< / IfModule>#
#以下行prevent的.htaccess和htpasswd文件被
#Web客户端查看。

<文件.HT *>
    要求所有被拒绝
< /文件>#
#错误日志:错误日志文件的位置。
#如果没有指定&LT内的ErrorLog指令,虚拟主机>
#集装箱,与该虚拟主机的错误信息会
#记录在这里。如果你做* *定义一个℃的错误日志文件,虚拟主机>
#集装箱,该主机的错误会被那里,没有记录在这里。

#ErrorLog日志/ error.log中
错误日志C:/wamp/logs/apache_error.log#
#LogLevel的:控制记录在error_log中的消息的数量。
#可能的值包括:调试,信息,通知,警告,错误,暴击,
#警报,EMERG。

LOGLEVEL警告< IfModule log_config_module>
    #
    #下面的指令定义格式别名搭配使用
    #CustomLog指令(见下文)。
    #
    的LogFormat%H%L%U%T \\%r \\%> S%B \\%{Referer的}​​ I \\\\%{用户代理} I \\组合拳
    的LogFormat%H%L%U%T \\%r \\%>%B的共同    < IfModule logio_module>
      #您需要启用mod_logio.c使用%I和%氧
      的LogFormat%H%L%U%T \\%r \\%> S%B \\%{Referer的}​​ I \\\\%{用户代理} I \\%I%Ocombinedio
    < / IfModule>    #
    #访问日志(通用日志文件格式)的位置和格式。
    #如果你没有定义&LT内的任何访问日志文件;虚拟主机>
    #容器,它们将被记录在这里。反之,如果你做* *
    #定义per-<虚拟主机>访问日志文件,交易将是
    #记录在其中并没有*在这个文件*。
    #
    的CustomLog日志/ access.log的共同
    的CustomLogC:/wamp/logs/access.log共同    #
    #如果preFER访问,代理和referer信息,日志文件
    #(合并日志文件格式),可以使用下面的指令。
    #
    #CustomLog日志/ access.log的组合拳
< / IfModule>< IfModule alias_module>
    #
    #重定向:允许你告诉客户有关使用文件
    #在你的服务器的命名空间存在,但不是现在。客户端
    #将在新位置的文档的新要求。
    #示例:
    #重定向常任/美孚http://www.example.com/bar    #
    #别名:地图网络路径到文件系统路径,用于
    #不DocumentRoot的生活下访问内容。
    #示例:
    #别名/ webpath /全/文件系统/路径
    #
    #如果你有一个尾随/上/ webpath则服务器将
    #要求它是在URL present。你也有可能
    #需要提供<名录及GT;部分,以允许访问
    #文件系统路径。    #
    #ScriptAlias​​指令:该控制哪个目录包含服务器脚本。
    #ScriptAlias​​es是基本上相同别名,除了
    在目标目录#文件被视为应用和
    #由服务器时请求,而不是作为发送到文档上运行
    #客户端。尾部的规则/适用于ScriptAlias​​指令
    #指令为别名。
    #
    ScriptAlias​​指令/的cgi-bin /C:/ WAMP / cgi-bin目录/< / IfModule>< IfModule cgid_module>
    #
    #ScriptSock:在线程服务器,指定路径UNIX
    #插槽用于mod_cgid的CGI守护进程进行通信。
    #
    #Scriptsock cgisock
< / IfModule>#
#C:/ WAMP / cgi-bin目录应改为你的ScriptAlias​​ed
#CGI目录存在,如果有配置。

<目录C:/ WAMP / cgi-bin目录>
    设置AllowOverride无
    选择无
    要求所有批准
< /目录>< IfModule mime_module>
    #
    #TypesConfig指向包含映射从列表的文件
    #文件扩展名的MIME类型。
    #
    TypesConfig的conf /的mime.types    #
    #将AddType允许您添加或覆盖的MIME配置
    在TypesConfig特定的文件类型指定#文件。
    #
    #AddType应用程序/ x-gzip的.tgz的
    #
    #AddEncoding允许你有一定的浏览器uncom preSS
    #动态信息。注:并非所有浏览器都支持这一点。
    #
    #AddEncoding幽浮preSS .Z
    #AddEncoding的X gzip的。广州.tgz的
    #
    #如果AddEncoding指令以上是注释掉,那么你
    #也许应该确定这些扩展指示媒体类型:
    #
    将AddType应用程序/ x-COM preSS .Z
    将AddType应用程序/ x-gzip的。广州.tgz的
    将AddType应用/ X的httpd - PHP的.php
    将AddType应用/ X的httpd - PHP .php3    #
    #的AddHandler允许你某些文件扩展名映射到处理程序:
    #行动无关的文件类型。这些既可以内置在服务器
    #或Action指令增加(见下文)
    #
    #要使用CGI脚本ScriptAlias​​ed指令之外:
    #(你还需要为ExecCGI添加到选项指令。)
    #
    #AddHandler CGI脚本的CGI    #对于类型映射(协商资源):
    #AddHandler型地图变种    #
    #过滤器允许你来之前,发送到客户端处理的内容。
    #
    #要解析的.shtml服务器端包含(SSI)文件:
    #(你还需要添加包括到选项指令。)
    #
    #AddType的text / html的.shtml
    #AddOutputFilter INCLUDES的.shtml
< / IfModule>#
#mod_mime_magic模块,允许服务器使用来自各种提示
该文件本身的#内容以确定其类型。该MIMEMagicFile
#指令告诉那里的提示定义所在的模块。

#MIMEMagicFile的conf /魔法#
#可定制的错误响应有三种类型:
#1)纯文本2)本地重定向3)外部重定向

# 一些例子:
#ErrorDocument 500的服务器提出了布布。
#ErrorDocument 404 /missing.html
#ErrorDocument 404/cgi-bin/missing_handler.pl
#ErrorDocument 402 http://www.example.com/subscription_info.html
##
#MaxRanges:在之前的请求范围的最大数量
#返回整个资源,或是特殊的一个
#值默认,无或无限。
#默认设置是接受200范围。
#MaxRanges无限#
#EnableMMAP和EnableSendfile:在支持它的系统​​,
#内存映射或sendfile的系统调用可用于递送
#文件。这通常提高服务器性能,但必须
#从网络安装发球时被关闭
#文件系统,或者对于这些功能的支持,否则是
#打破了你的系统上。
#默认值:EnableMMAP开,EnableSendfile关闭

#EnableMMAP关闭
#EnableSendfile上#补充配置

#在conf /额外/目录中的配置文件可以
#包括添加额外的功能或修改的默认配置
#服务器,或者你可能只是在这里复制它们的内容,并更改为
#必要的。#服务器池的管理(MPM专用)
包括的conf /额外/的httpd-mpm.conf#多语言错误信息
#INCLUDE的conf /额外/的httpd-multilang-errordoc.conf#花式目录列表
#INCLUDE的conf /额外/的httpd-autoindex.conf# 语言设定
#INCLUDE的conf /额外/的httpd-languages​​.conf#用户主目录
#INCLUDE的conf /额外/的httpd-userdir.conf请求和配置#实时信息
#INCLUDE的conf /额外/的httpd-info.conf#虚拟主机
#INCLUDE的conf /额外/的httpd-vhosts.conf#本地访问Apache HTTP服务器手册
#INCLUDE的conf /额外/的httpd-manual.conf#分布式创作和版本控制(WebDAV)
#INCLUDE的conf /额外/的httpd-dav.conf#各个默认设置
#INCLUDE的conf /额外/的httpd-default.conf#配置mod_proxy_html理解HTML4 / XHTML1
< IfModule proxy_html_module>
包括的conf /额外/代理html.conf
< / IfModule>#安全(SSL / TLS)连接
#INCLUDE的conf /额外/的httpd-ssl.conf中

#注:以下条件必须要present支持
#没有SSL开始与没有的/ dev /随机相当于平台
#但是静态编译-mod_ssl中。

< IfModule ssl_module>
SSLRandomSeed启动内置
SSLRandomSeed内置连接
< / IfModule>

#注释出下面故意处理用户代理
#对滥用DNT(DNT *必须违反了开放标准*是一个特定的
#最终用户的选择)

#< IfModule setenvif_module>
#BrowserMatchMSIE 10.0; bad_DNT
#< / IfModule>
#< IfModule headers_module>
#RequestHeader未设置DNT ENV = bad_DNT
#< / IfModule>
IncludeOptionalC:/ WAMP /虚拟主机/ *
包括C:/ WAMP /别名/ *


解决方案

您需要将您的路由器到WAMP服务器计算机的IP地址上转发端口80。有些路由器胡作非为,如果你尝试从路由器后面访问您的公网IP​​地址,所以记住这一点;如果你想验证80端口转发正确,你可以像使用ShieldsUP的工具!在grc.com端口扫描80端口,看看它是否返回OPEN。请记住,如果你有DSL服务,DSL调制解调器还可能包含一个NAT路由器,造成额外的问题,端口转发。

I have set up an webserver as well as adding firewall exceptions and servies on my netgear router, and when I attempt to access the server on local machines with my local ip address it works fine, however I wanted to test to see if remote machines could access the server so I tried using my global ip address on local machines however it just loads my routers management page. Am I using the wrong ip? i used google to find my global ip. I'm running windows

Here is my apache config:

#
# This is the main Apache HTTP server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.
# In particular, see 
# <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are unsure
# consult the online docs. You have been warned.  
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path.  If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "logs/access_log"
# with ServerRoot set to "/usr/local/apache2" will be interpreted by the
# server as "/usr/local/apache2/logs/access_log", whereas "/logs/access_log" 
# will be interpreted as '/logs/access_log'.
#
# NOTE: Where filenames are specified, you must use forward slashes
# instead of backslashes (e.g., "c:/apache" instead of "c:\apache").
# If a drive letter is omitted, the drive on which httpd.exe is located
# will be used by default.  It is recommended that you always supply
# an explicit drive letter in absolute paths to avoid confusion.

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# Do not add a slash at the end of the directory path.  If you point
# ServerRoot at a non-local disk, be sure to specify a local disk on the
# Mutex directive, if file-based mutexes are used.  If you wish to share the
# same ServerRoot for multiple httpd daemons, you will need to change at
# least PidFile.
#
ServerRoot "c:/wamp/bin/apache/apache2.4.4"

#
# Mutex: Allows you to set the mutex mechanism and mutex file directory
# for individual mutexes, or change the global defaults
#
# Uncomment and change the directory if mutexes are file-based and the default
# mutex file directory is not on a local disk or is not appropriate for some
# other reason.
#
# Mutex default:logs

#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to 
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 127.0.0.1:80
Listen 80

#
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO you
# have to place corresponding `LoadModule' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Statically compiled modules (those listed by `httpd -l') do not need
# to be loaded here.
#
# Example:
# LoadModule foo_module modules/mod_foo.so
#
LoadModule access_compat_module modules/mod_access_compat.so
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule allowmethods_module modules/mod_allowmethods.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
#LoadModule auth_digest_module modules/mod_auth_digest.so
#LoadModule authn_anon_module modules/mod_authn_anon.so
LoadModule authn_core_module modules/mod_authn_core.so
#LoadModule authn_dbd_module modules/mod_authn_dbd.so
#LoadModule authn_dbm_module modules/mod_authn_dbm.so
LoadModule authn_file_module modules/mod_authn_file.so
#LoadModule authn_socache_module modules/mod_authn_socache.so
#LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
LoadModule authz_core_module modules/mod_authz_core.so
#LoadModule authz_dbd_module modules/mod_authz_dbd.so
#LoadModule authz_dbm_module modules/mod_authz_dbm.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
#LoadModule authz_owner_module modules/mod_authz_owner.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
#LoadModule buffer_module modules/mod_buffer.so
#LoadModule cache_module modules/mod_cache.so
#LoadModule cache_disk_module modules/mod_cache_disk.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule cgi_module modules/mod_cgi.so
#LoadModule charset_lite_module modules/mod_charset_lite.so
#LoadModule data_module modules/mod_data.so
#LoadModule dav_module modules/mod_dav.so
#LoadModule dav_fs_module modules/mod_dav_fs.so
#LoadModule dav_lock_module modules/mod_dav_lock.so
#LoadModule dbd_module modules/mod_dbd.so
#LoadModule deflate_module modules/mod_deflate.so
LoadModule dir_module modules/mod_dir.so
#LoadModule dumpio_module modules/mod_dumpio.so
LoadModule env_module modules/mod_env.so
#LoadModule expires_module modules/mod_expires.so
#LoadModule ext_filter_module modules/mod_ext_filter.so
#LoadModule file_cache_module modules/mod_file_cache.so
#LoadModule filter_module modules/mod_filter.so
#LoadModule headers_module modules/mod_headers.so
#LoadModule heartbeat_module modules/mod_heartbeat.so
#LoadModule heartmonitor_module modules/mod_heartmonitor.so
#LoadModule ident_module modules/mod_ident.so
#LoadModule imagemap_module modules/mod_imagemap.so
LoadModule include_module modules/mod_include.so
#LoadModule info_module modules/mod_info.so
LoadModule isapi_module modules/mod_isapi.so
#LoadModule lbmethod_bybusyness_module modules/mod_lbmethod_bybusyness.so
#LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so
#LoadModule lbmethod_bytraffic_module modules/mod_lbmethod_bytraffic.so
#LoadModule lbmethod_heartbeat_module modules/mod_lbmethod_heartbeat.so
#LoadModule ldap_module modules/mod_ldap.so
#LoadModule logio_module modules/mod_logio.so
LoadModule log_config_module modules/mod_log_config.so
#LoadModule log_debug_module modules/mod_log_debug.so
#LoadModule log_forensic_module modules/mod_log_forensic.so
#LoadModule lua_module modules/mod_lua.so
LoadModule mime_module modules/mod_mime.so
#LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule negotiation_module modules/mod_negotiation.so
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
#LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
#LoadModule proxy_connect_module modules/mod_proxy_connect.so
#LoadModule proxy_express_module modules/mod_proxy_express.so
#LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
#LoadModule proxy_html_module modules/mod_proxy_html.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
#LoadModule proxy_scgi_module modules/mod_proxy_scgi.so
#LoadModule ratelimit_module modules/mod_ratelimit.so
#LoadModule reflector_module modules/mod_reflector.so
#LoadModule remoteip_module modules/mod_remoteip.so
#LoadModule request_module modules/mod_request.so
#LoadModule reqtimeout_module modules/mod_reqtimeout.so
#LoadModule rewrite_module modules/mod_rewrite.so
#LoadModule sed_module modules/mod_sed.so
#LoadModule session_module modules/mod_session.so
#LoadModule session_cookie_module modules/mod_session_cookie.so
#LoadModule session_crypto_module modules/mod_session_crypto.so
#LoadModule session_dbd_module modules/mod_session_dbd.so
LoadModule setenvif_module modules/mod_setenvif.so
#LoadModule slotmem_plain_module modules/mod_slotmem_plain.so
#LoadModule slotmem_shm_module modules/mod_slotmem_shm.so
#LoadModule socache_dbm_module modules/mod_socache_dbm.so
#LoadModule socache_memcache_module modules/mod_socache_memcache.so
#LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
#LoadModule speling_module modules/mod_speling.so
#LoadModule ssl_module modules/mod_ssl.so
#LoadModule status_module modules/mod_status.so
#LoadModule substitute_module modules/mod_substitute.so
#LoadModule unique_id_module modules/mod_unique_id.so
#LoadModule userdir_module modules/mod_userdir.so
#LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule version_module modules/mod_version.so
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
#LoadModule watchdog_module modules/mod_watchdog.so
#LoadModule xml2enc_module modules/mod_xml2enc.so

LoadModule php5_module "c:/wamp/bin/php/php5.4.16/php5apache2_4.dll"

<IfModule unixd_module>
#
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.  
#
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
User daemon
Group daemon

</IfModule>

# 'Main' server configuration
#
# The directives in this section set up the values used by the 'main'
# server, which responds to any requests that aren't handled by a
# <VirtualHost> definition.  These values also provide defaults for
# any <VirtualHost> containers you may define later in the file.
#
# All of these directives may appear inside <VirtualHost> containers,
# in which case these default settings will be overridden for the
# virtual host being defined.
#

#
# ServerAdmin: Your address, where problems with the server should be
# e-mailed.  This address appears on some server-generated pages, such
# as error documents.  e.g. admin@your-domain.com
#
ServerAdmin admin@example.com

#
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
#
ServerName localhost

#
# Deny access to the entirety of your server's filesystem. You must
# explicitly permit access to web content directories in other 
# <Directory> blocks below.
#
<Directory />
    AllowOverride none
    Require all granted
</Directory>

#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#

#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "c:/wamp/www"
<Directory "c:/wamp/www">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.4/mod/core.html#options
    # for more information.
    #
    #Options Indexes FollowSymLinks
Options Indexes FollowSymLinks Includes ExecCGI

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   AllowOverride FileInfo AuthConfig Limit
    #
    AllowOverride All

    #
    # Controls who can get stuff from this server.
    #
#    Require all granted
#   onlineoffline tag - don't remove
     Order Deny,Allow
     #Deny from all
     Allow from all
</Directory>

#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
    DirectoryIndex index.php index.php3 index.html index.htm
</IfModule>

#
# The following lines prevent .htaccess and .htpasswd files from being 
# viewed by Web clients. 
#
<Files ".ht*">
    Require all denied
</Files>

#
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
#ErrorLog "logs/error.log"
ErrorLog "c:/wamp/logs/apache_error.log"

#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn

<IfModule log_config_module>
    #
    # The following directives define some format nicknames for use with
    # a CustomLog directive (see below).
    #
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common

    <IfModule logio_module>
      # You need to enable mod_logio.c to use %I and %O
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    </IfModule>

    #
    # The location and format of the access logfile (Common Logfile Format).
    # If you do not define any access logfiles within a <VirtualHost>
    # container, they will be logged here.  Contrariwise, if you *do*
    # define per-<VirtualHost> access logfiles, transactions will be
    # logged therein and *not* in this file.
    #
    CustomLog "logs/access.log" common
    CustomLog "c:/wamp/logs/access.log" common

    #
    # If you prefer a logfile with access, agent, and referer information
    # (Combined Logfile Format) you can use the following directive.
    #
    #CustomLog "logs/access.log" combined
</IfModule>

<IfModule alias_module>
    #
    # Redirect: Allows you to tell clients about documents that used to 
    # exist in your server's namespace, but do not anymore. The client 
    # will make a new request for the document at its new location.
    # Example:
    # Redirect permanent /foo http://www.example.com/bar

    #
    # Alias: Maps web paths into filesystem paths and is used to
    # access content that does not live under the DocumentRoot.
    # Example:
    # Alias /webpath /full/filesystem/path
    #
    # If you include a trailing / on /webpath then the server will
    # require it to be present in the URL.  You will also likely
    # need to provide a <Directory> section to allow access to
    # the filesystem path.

    #
    # ScriptAlias: This controls which directories contain server scripts. 
    # ScriptAliases are essentially the same as Aliases, except that
    # documents in the target directory are treated as applications and
    # run by the server when requested rather than as documents sent to the
    # client.  The same rules about trailing "/" apply to ScriptAlias
    # directives as to Alias.
    #
    ScriptAlias /cgi-bin/ "c:/wamp/cgi-bin/"

</IfModule>

<IfModule cgid_module>
    #
    # ScriptSock: On threaded servers, designate the path to the UNIX
    # socket used to communicate with the CGI daemon of mod_cgid.
    #
    #Scriptsock cgisock
</IfModule>

#
# "c:/wamp/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "c:/wamp/cgi-bin">
    AllowOverride None
    Options None
    Require all granted
</Directory>

<IfModule mime_module>
    #
    # TypesConfig points to the file containing the list of mappings from
    # filename extension to MIME-type.
    #
    TypesConfig conf/mime.types

    #
    # AddType allows you to add to or override the MIME configuration
    # file specified in TypesConfig for specific file types.
    #
    #AddType application/x-gzip .tgz
    #
    # AddEncoding allows you to have certain browsers uncompress
    # information on the fly. Note: Not all browsers support this.
    #
    #AddEncoding x-compress .Z
    #AddEncoding x-gzip .gz .tgz
    #
    # If the AddEncoding directives above are commented-out, then you
    # probably should define those extensions to indicate media types:
    #
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php .php3

    #
    # AddHandler allows you to map certain file extensions to "handlers":
    # actions unrelated to filetype. These can be either built into the server
    # or added with the Action directive (see below)
    #
    # To use CGI scripts outside of ScriptAliased directories:
    # (You will also need to add "ExecCGI" to the "Options" directive.)
    #
    #AddHandler cgi-script .cgi

    # For type maps (negotiated resources):
    #AddHandler type-map var

    #
    # Filters allow you to process content before it is sent to the client.
    #
    # To parse .shtml files for server-side includes (SSI):
    # (You will also need to add "Includes" to the "Options" directive.)
    #
    #AddType text/html .shtml
    #AddOutputFilter INCLUDES .shtml
</IfModule>

#
# The mod_mime_magic module allows the server to use various hints from the
# contents of the file itself to determine its type.  The MIMEMagicFile
# directive tells the module where the hint definitions are located.
#
#MIMEMagicFile conf/magic

#
# Customizable error responses come in three flavors:
# 1) plain text 2) local redirects 3) external redirects
#
# Some examples:
#ErrorDocument 500 "The server made a boo boo."
#ErrorDocument 404 /missing.html
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 http://www.example.com/subscription_info.html
#

#
# MaxRanges: Maximum number of Ranges in a request before
# returning the entire resource, or one of the special
# values 'default', 'none' or 'unlimited'.
# Default setting is to accept 200 Ranges.
#MaxRanges unlimited

#
# EnableMMAP and EnableSendfile: On systems that support it, 
# memory-mapping or the sendfile syscall may be used to deliver
# files.  This usually improves server performance, but must
# be turned off when serving from networked-mounted 
# filesystems or if support for these functions is otherwise
# broken on your system.
# Defaults: EnableMMAP On, EnableSendfile Off
#
#EnableMMAP off
#EnableSendfile on

# Supplemental configuration
#
# The configuration files in the conf/extra/ directory can be 
# included to add extra features or to modify the default configuration of 
# the server, or you may simply copy their contents here and change as 
# necessary.

# Server-pool management (MPM specific)
Include conf/extra/httpd-mpm.conf

# Multi-language error messages
#Include conf/extra/httpd-multilang-errordoc.conf

# Fancy directory listings
#Include conf/extra/httpd-autoindex.conf

# Language settings
#Include conf/extra/httpd-languages.conf

# User home directories
#Include conf/extra/httpd-userdir.conf

# Real-time info on requests and configuration
#Include conf/extra/httpd-info.conf

# Virtual hosts
#Include conf/extra/httpd-vhosts.conf

# Local access to the Apache HTTP Server Manual
#Include conf/extra/httpd-manual.conf

# Distributed authoring and versioning (WebDAV)
#Include conf/extra/httpd-dav.conf

# Various default settings
#Include conf/extra/httpd-default.conf

# Configure mod_proxy_html to understand HTML4/XHTML1
<IfModule proxy_html_module>
Include conf/extra/proxy-html.conf
</IfModule>

# Secure (SSL/TLS) connections
#Include conf/extra/httpd-ssl.conf
#
# Note: The following must must be present to support
#       starting without SSL on platforms with no /dev/random equivalent
#       but a statically compiled-in mod_ssl.
#
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
#
# uncomment out the below to deal with user agents that deliberately
# violate open standards by misusing DNT (DNT *must* be a specific
# end-user choice)
#
#<IfModule setenvif_module>
#BrowserMatch "MSIE 10.0;" bad_DNT
#</IfModule>
#<IfModule headers_module>
#RequestHeader unset DNT env=bad_DNT
#</IfModule>


IncludeOptional "c:/wamp/vhosts/*"
Include "c:/wamp/alias/*"

解决方案

You need to forward port 80 on your router to the WAMP server machine's IP address. Some routers misbehave if you try to access your public IP address from behind the router, so keep that in mind; if you want to verify that port 80 is forwarding properly, you can use a tool like ShieldsUP! at grc.com to port-scan port 80 and see if it returns OPEN. Remember that if you have DSL service, your DSL modem may also contain a NAT router, causing additional problems with port forwarding.

这篇关于远程访问Apache服务器,细跟本地IP,错误全球的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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