eustao 发表于 2017-1-18 14:23:22

www 权限

我安装了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 编辑 ]

eustao 发表于 2017-1-18 14:37:09

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

    location = /favicon.ico {
      log_not_found off;
      access_log off;
    }

    location = /robots.txt {
      allow all;
      log_not_found off;
      access_log off;
    }

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

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

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

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

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

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

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

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

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

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

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

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

    location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
      expires max;
      log_not_found off;
    }

是不是在这里面需要对www做些什么?谢谢指点!

licess 发表于 2017-1-18 19:53:20

直接访问验证码图片看看什么信息
网站都是同一个用户运行不可能是权限问题
页: [1]
查看完整版本: www 权限