WAMP使用静态IP地址提供禁止错误

时间:2016-06-05 00:30:49

标签: php apache wamp

我在Windows Server 2012中安装了WAMP服务器3.0.4。想要为局域网用户在线托管我的网站。

WAMP组件详述如下:

  • Apache版本2.4.18
  • MySQL版本5.7.11
  • PHP版本5.6.19

服务器2012安装在虚拟PC上,静态IP地址为10.238.1.60。右键单击系统托盘中的WAMP图标并将站点置于联机状态。对Apache服务器中的HTTPD文件进行了更改。在Windows防火墙上创建了新规则,允许端口80上的TCP流量和端口443上的UDP流量。

当我在本地服务器上运行http //:10.238.1.60/mysite时,我显示正确的页面但是当我从同一局域网内的另一台PC运行相同的地址时,它会给出禁止的错误。

enter image description here

以下是Apache服务器的httpd文件。

#
# This is the main Apache HTTP server configuration file.  It contains the
# configuration directives that give the server its instructions.

ServerSignature On
ServerTokens Full

#
# least PidFile.
#
ServerRoot "c:/wamp/bin/apache/apache2.4.18"

Define APACHE24 Apache2.4

# prevent Apache from glomming onto all bound IP addresses.

# Changes were made here 
#the original setting are commented out

#Listen 12.34.56.78:80
#Listen 0.0.0.0:80
#Listen [::0]:80
Listen 10.238.1.60:80

#
#
#
# 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 wampserver@otomatic.net

#
# If your host doesn't have a registered DNS name, enter its IP address here.
#Made change here from local host to static ip address
ServerName 10.238.1.60:80

#
# 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 all
    Require all granted
</Directory>

#
enabled it
# below.
#
HostnameLookups Off

#
locations.
#
DocumentRoot "c:/wamp/www"
<Directory "c:/wamp/www/">
    #
       #
    AllowOverride all

    #
    # Controls who can get stuff from this server.
    #

#   onlineoffline tag - don't remove
    Require all granted
</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 "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>

    #
 #
#MIMEMagicFile conf/magic

#
#EnableMMAP off
EnableSendfile off

# AcceptFilter: On Windows, none uses accept() rather than AcceptEx() and
# will not recycle sockets between connections. This is useful for network
# adapters with broken driver support, as well as some virtual network
# providers such as vpn drivers, or spam, virus or spyware filters.
AcceptFilter http none
AcceptFilter https none

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

#
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>

Include "c:/wamp/alias/*"

任何让我这样做的建议。

0 个答案:

没有答案