ITPub博客

首页 > > > 部署Apache服务-Alias 将URI中的没用了映射到文件系统目录(绝对路径)

部署Apache服务-Alias 将URI中的没用了映射到文件系统目录(绝对路径)

作者:longmanma 时间:2019-12-12 17:43:46 0 删除 编辑

#Alias 将URI中的没用了映射到文件系统目录(绝对路径)

#比如将网站URL http://ip/abc 访问的/abc目录映射到文件系统/usr/local/apache/htdocs/7878

Alias /abc /usr/local/apache/htdocs/7878

#需要注意是文件系统路径

#

# ScriptAlias: This controls which directories contain server scripts.

# ScriptAliases are essentially the same as Aliases, except that

# documents in the target directory are treated as applications and

# run by the server when requested rather than as documents sent to the

# client. The same rules about trailing "/" apply to ScriptAlias

# directives as to Alias.

#

ScriptAlias /cgi-bin/ "/usr/local/apache/cgi-bin/"

#脚本目录别名

</IfModule>

#使用外部CGI守护进程执行CGI脚本

<IfModule cgid_module>

#

# ScriptSock: On threaded servers, designate the path to the UNIX

# socket used to communicate with the CGI daemon of mod_cgid.

#

#Scriptsock cgisock

</IfModule>

#

# "/usr/local/apache/cgi-bin" should be changed to whatever your ScriptAliased

# CGI directory exists, if you have that configured.

#

#CGI目录的访问权限

<Directory "/usr/local/apache/cgi-bin">

AllowOverride None

Options None

Require all granted

</Directory>

#自定义http的请求头和响应头

#RequestHeader 设置请求头 http://httpd.apache.org/docs/2.4/mod/mod_headers.html

#Header 设置响应头 http://httpd.apache.org/docs/2.4/mod/mod_headers.html

<IfModule headers_module>

#

# Avoid passing HTTP_PROXY environment to CGI's on this or any proxied

# backend servers which have lingering "httpoxy" defects.

# 'Proxy' request header is undefined by the IETF, not listed by IANA

#

RequestHeader unset Proxy early

</IfModule>

#将请求的文件扩展名与文件的行为(处理程序和筛选器)和内容(mime类型、语言、字符集和编码)相关联。

#明确告诉apache 可以接受什么类型的文件

<IfModule mime_module>

#

# TypesConfig points to the file containing the list of mappings from

# filename extension to MIME-type.

#

TypesConfig conf/mime.types

#

# AddType allows you to add to or override the MIME configuration

# file specified in TypesConfig for specific file types.

#

#AddType application/x-gzip .tgz

#

# AddEncoding allows you to have certain browsers uncompress

# information on the fly. Note: Not all browsers support this.

#

#AddEncoding x-compress .Z

#AddEncoding x-gzip .gz .tgz

#

# If the AddEncoding directives above are commented-out, then you

# probably should define those extensions to indicate media types:

#

AddType application/x-compress .Z

AddType application/x-gzip .gz .tgz

#

# AddHandler allows you to map certain file extensions to "handlers":

# actions unrelated to filetype. These can be either built into the server

# or added with the Action directive (see below)

#

# To use CGI scripts outside of ScriptAliased directories:

# (You will also need to add "ExecCGI" to the "Options" directive.)

#

#AddHandler cgi-script .cgi

# For type maps (negotiated resources):

#AddHandler type-map var

#

# Filters allow you to process content before it is sent to the client.

#

# To parse .shtml files for server-side includes (SSI):

# (You will also need to add "Includes" to the "Options" directive.)

#

#AddType text/html .shtml

#AddOutputFilter INCLUDES .shtml

</IfModule>

#

# The mod_mime_magic module allows the server to use various hints from the

# contents of the file itself to determine its type. The MIMEMagicFile

# directive tells the module where the hint definitions are located.

#

#MIMEMagicFile conf/magic

#

# Customizable error responses come in three flavors:

# 1) plain text 2) local redirects 3) external redirects

#

# Some examples:

#ErrorDocument 500 "The server made a boo boo."

#ErrorDocument 404 /missing.html

#ErrorDocument 404 "/cgi-bin/missing_handler.pl"

#ErrorDocument 402 http://www.example.com/subscription_info.html

#

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/2730/viewspace-3125750/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: myBase7 激活方法
请登录后发表评论 登录
全部评论

注册时间:2019-12-18

  • 博文量
    492
  • 访问量
    11996