httpd的设置

URL的别名


Options Indexes
#定义了/app/www/html 网页主目录没有,就会显示文件目录
AllowOverride All
#这个指令定义了是否允许在数据目录下创建.与访问控制相关的哪些指令可以放在指定目录下的.htaccess (由AccessFileName 指定)文
件中,覆盖之前的配置指令只对 语句有效AllowOverride All:  所有指令都有效AllowOverride None :.htaccess  文件无>
效AllowOverride AuthConfig Indexes  除了AuthConfig和Indexes
#
Alias /hy /etc/passwd
#URL别名定义
# Possible values for the Options directive are "None", "All",
# or any combination of:
#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important.  Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
-- 插入 --                                                                                             361,17-13     34%

客户端访问

httpd的设置_第1张图片
  • 配置基于用户的访问控制;安装生产用户与密码的工具
    [root@root html]# yum -y install http-tools
  • 生成秘钥
[root@root html]# htpasswd -s /etc/httpd/conf.d/.htusers chenxi
New password: 
Re-type new password: 
Adding password for user chenxi
[root@root html]# cat /etc/httpd/conf.d/.htusers
chenxi2:lb1QBQV7Tj7tw
chenxi:{SHA}9FQtubow95WK5CwRPdh60h+y7ds=
[root@root html]# 
  • 设置允许用户目录下的.htaccess
  网页目录

#
# Possible values for the Options directive are "None", "All",
# or any combination of:
#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important.  Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
    Options Indexes FollowSymLinks

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   Options FileInfo AuthConfig Limit
#

#
# Controls who can get stuff from this server.
#
    Order allow,deny
    Allow from all  允许网页目录下的.htaccess文件里所有设置生效


[root@root html]# vim .htaccess 

AuthType Basic
AuthName "String“
AuthUserFile "/etc/httpd/conf.d/.htusers"
Require valid-user
~                                         
httpd的设置_第2张图片

虚拟主机设置

httpd的设置_第3张图片

基于端口的虚拟主机设置

httpd的设置_第4张图片

基于名字的虚拟主机

httpd的设置_第5张图片

在网页上显示工作状态

httpd的设置_第6张图片
httpd的设置_第7张图片
httpd的设置_第8张图片

你可能感兴趣的:(httpd的设置)