VPS侦探论坛

 找回密码
 注册
查看: 3672|回复: 2

www 权限

[复制链接]
发表于 2017-1-18 14:23:22 | 显示全部楼层 |阅读模式

我安装了LNMP 1.3,在添加virtual host 时候,我写了mydomain.com 和 www.mydomain.com.
我用了一个商用系统,现在有一个地方出错。该商用软件的技术人员帮我调试的时候,说我的www权限没有全部开启。原因是:

如果用以下网址(不带www)登录管理后台:
http://mydomain.com/admin.php
如附件图1所示,有登录验证码显示出来。

如果用以下网址(带www)登录管理后台:
http://www.mydomain.com/admin.php
如附件图2所示,没有登录验证码显示出来。

因此,他们说我的www权限不够。


请问怎么设置www权限?

[ 本帖最后由 eustao 于 2017-1-18 14:30 编辑 ]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2017-1-18 14:37:09 | 显示全部楼层


会是伪静态问题吗?我目前伪静态用的是Nginx官方针对Drupal 8 的文件
  1. #if (!-e $request_filename) {
  2. #      rewrite ^/(.*)$ /index.php?q=$1 last;
  3. #    }

  4.     location = /favicon.ico {
  5.         log_not_found off;
  6.         access_log off;
  7.     }

  8.     location = /robots.txt {
  9.         allow all;
  10.         log_not_found off;
  11.         access_log off;
  12.     }

  13.     # Very rarely should these ever be accessed outside of your lan
  14.     location ~* \.(txt|log)$ {
  15.         allow 192.168.0.0/16;
  16.         deny all;
  17.     }

  18.     location ~ \..*/.*\.php$ {
  19.         return 403;
  20.     }

  21.     location ~ ^/sites/.*/private/ {
  22.         return 403;
  23.     }

  24.     # Allow "Well-Known URIs" as per RFC 5785
  25.     location ~* ^/.well-known/ {
  26.         allow all;
  27.     }

  28.     # Block access to "hidden" files and directories whose names begin with a
  29.     # period. This includes directories used by version control systems such
  30.     # as Subversion or Git to store control files.

  31. rewrite ^/core/authorize.php/core/authorize.php(.*)$ /core/authorize.php$1;
  32.     location ~ (^|/)\. {
  33.         return 403;
  34.     }

  35.     location / {
  36.         # try_files $uri @rewrite; # For Drupal <= 6
  37.         try_files $uri /index.php?$query_string; # For Drupal >= 7
  38.     }

  39.     location @rewrite {
  40.         rewrite ^/(.*)$ /index.php?q=$1;
  41.     }

  42.     # Don't allow direct access to PHP files in the vendor directory.
  43.     location ~ /vendor/.*\.php$ {
  44.         deny all;
  45.         return 404;
  46.     }

  47.     # In Drupal 8, we must also match new paths where the '.php' appears in
  48.     # the middle, such as update.php/selection. The rule we use is strict,
  49.     # and only allows this pattern with the update.php front controller.
  50.     # This allows legacy path aliases in the form of
  51.     # blog/index.php/legacy-path to continue to route to Drupal nodes. If
  52.     # you do not have any paths like that, then you might prefer to use a
  53.     # laxer rule, such as:
  54.     #   location ~ \.php(/|$) {
  55.     # The laxer rule will continue to work if Drupal uses this new URL
  56.     # pattern with front controllers other than update.php in a future
  57.     # release.
  58.     location ~ '\.php$|^/update.php' {
  59.         fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
  60.         # Security note: If you're running a version of PHP older than the
  61.         # latest 5.3, you should have "cgi.fix_pathinfo = 0;" in php.ini.
  62.         # See http://serverfault.com/q/627903/94922 for details.
  63.         include fastcgi_params;
  64.         # Block httpoxy attacks. See https://httpoxy.org/.
  65.         fastcgi_param HTTP_PROXY "";
  66.         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  67.         fastcgi_param PATH_INFO $fastcgi_path_info;
  68.         fastcgi_param QUERY_STRING $query_string;
  69.         fastcgi_intercept_errors on;
  70.         # PHP 5 socket location.
  71.         fastcgi_pass unix:/tmp/php-cgi.sock;
  72.         # PHP 7 socket location.
  73.         #fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
  74.     }

  75.     # Fighting with Styles? This little gem is amazing.
  76.     # location ~ ^/sites/.*/files/imagecache/ { # For Drupal <= 6
  77.     location ~ ^/sites/.*/files/styles/ { # For Drupal >= 7
  78.         try_files $uri @rewrite;
  79.     }

  80.     # Handle private files through Drupal. Private file's path can come
  81.     # with a language prefix.
  82.     location ~ ^(/[a-z\-]+)?/system/files/ { # For Drupal >= 7
  83.         try_files $uri /index.php?$query_string;
  84.     }

  85.     location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
  86.         expires max;
  87.         log_not_found off;
  88.     }
复制代码


是不是在这里面需要对www做些什么?谢谢指点!
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2017-1-18 19:53:20 | 显示全部楼层

直接访问验证码图片看看什么信息
网站都是同一个用户运行不可能是权限问题
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-11-17 00:33 , Processed in 0.026395 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表