Apache目录指令

时间:2018-05-24 16:28:07

标签: apache

Apache默认安装附带

private String formatUsernameAction(UserInfo userInfo, String action) {
        String username = userInfo.getUsername();
        @SuppressLint("ResourceType") String usernameColor = getContext().getResources().getString(R.color.background_button);
        return "<font color=\""+usernameColor+"\">" + username
                + "</font> <font color=\"#787f83\">" + action.toLowerCase() + "</font>";
    }

问题1:这是根目录吗?

我们说我们使用了DocumentRoot参数

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Require all allow
</Directory>

问题2:DocumentRoot参数是否消除了&#34; /&#34; ?

1 个答案:

答案 0 :(得分:0)

是的,'/'将指向文件系统的根目录。通常,根目录的Directory节将默认拒绝所有访问,例如:

# Deny access to all files on the server's filesystem.
<Directory />
  AllowOverride none
  Require all denied
</Directory>

然后,您将允许访问httpd应该有权访问的特定目录。例如,服务器的DocumentRoot:

Define DOCROOT "/var/www/httpd/htdocs"
DocumentRoot "${DOCROOT}"
<Directory "${DOCROOT}">
  Options Indexes FollowSymLinks
  AllowOverride None

  #
  # Allow access to resources in the server's DocumentRoot.
  #
  Require all granted
</Directory>