WAMP - 禁止 - 您无权访问此服务器上的/

问题描述 投票:2回答:1

我正在尝试通过互联网访问我的WAMP网络服务器(3.1.4),即使经过堆栈交换主题的每个回答问题,我也会收到权限错误。

WAMP设置为“在线”并且为绿色。我可以在我的主机上访问我的服务器,看到我的每个网页都很好。我甚至可以使用域名查看和浏览网站,这不是问题。

我的防火墙在侦听端口上打开了入站连接,我的路由器也为该端口启用了端口转发。

我已经在httpd-vhosts.conf中授予了所有权限:

# Virtual Hosts
  <VirtualHost *:80>
  ServerName localhost
  ServerAlias localhost
  DocumentRoot "${INSTALL_DIR}/www"
  <Directory "${INSTALL_DIR}/www/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require all granted
  </Directory>
</VirtualHost>


#
<VirtualHost *:80>
    ServerName example
    DocumentRoot "c:/wamp64/www/example"

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteRule ^index\.php$ - [L]
        RewriteCond $1 ^(index\.php)?$ [OR]
        RewriteCond $1 \.(gif|jpg|png|ico|css|js)$ [NC,OR]
        RewriteCond %{REQUEST_FILENAME} -f [OR]
        RewriteCond %{REQUEST_FILENAME} -d
        RewriteRule ^(.*)$ - [S=1]
        RewriteRule . /index.php [L]
    </IfModule>
    # END wordpress

    <Directory  "c:/wamp64/www/example/">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

我已经在httpd.conf中授予了所有权限:

DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
    Options +Indexes +FollowSymLinks +Multiviews
    AllowOverride all

#   onlineoffline tag - don't remove
    Require all granted
</Directory>

我已经在phpmyadmin.conf中授予了所有权限:

Alias /phpmyadmin "c:/wamp64/apps/phpmyadmin4.8.3/"

<Directory "c:/wamp64/apps/phpmyadmin4.8.3/">
    Options +Indexes +FollowSymLinks +MultiViews
  AllowOverride all
  <ifDefine APACHE24>
        Require all granted
    </ifDefine>
    <ifDefine !APACHE24>
        Order Deny,Allow
        Allow from all
        Allow from ::1
    </ifDefine>

# To import big file you can increase values
  php_admin_value upload_max_filesize 128M
  php_admin_value post_max_size 128M
  php_admin_value max_execution_time 360
  php_admin_value max_input_time 360
</Directory>

我已在hosts文件中授予所有权限:

127.0.0.1   localhost
::1 localhost
127.0.0.1   example.com
::1 example.com

编辑

我忘了在httpd.conf中显示其他设置:

# Virtual hosts
Include conf/extra/httpd-vhosts.conf
php apache wamp
1个回答
0
投票

原来,域名没有重定向到我的主机,而是重定向到我购买域名的网站的DNS。我设置的权限没问题,所以这是我不熟悉的替代解决方案。

© www.soinside.com 2019 - 2024. All rights reserved.