快速业务通道

apache配置

作者 佚名技术 来源 Linux系统 浏览 发布时间 2012-03-23
r vhost cd vhost vi vhost.conf 添加如下内容 Alias /test1 "/root/web/test1/" <Directory "/root/web/test1"> Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all </Directory> Alias /test2 "/root/web/test2/" <Directory "/root/web/test2"> Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all </Directory> 然后改变 chmod 755 -R /root/web/test1 chmod 755 -R /root/web/test2 http://localhost/test1 http://localhost/test2 可以增加权限的设置... apache 虚拟目录 deny 和allow 访问列表的几种形式 ******************************************* 认证和授权 认证类型 basic(常用) digest(再要认证)不常用 建立认证与授权的步骤 建立用户库 配置服务器的保护域 什么用户具有访问权限 认证指令 Authname 受保护领域名称 Authtype 认证方式 Authuserfile 认证口令文件 Authgroupfile 认证组文件 Require use 授权指定用户 Require group 授权指定组 Require valid-user 授权给认证口令文件用户 建立用户库基本认证 htpasswd -c authfile username 口令文件格式 username:password $$$$$$$$$$$$$$$ 用户认证: 例如:给添加认证 Alias /test2 "/root/web/test2/" <Directory "/root/web/test2"> Options Indexes MultiViews authtype basic authname "welcome test" authuserfile /etc/httpd/httppwd require Valid-user = user test </Directory> cd /etc/httpd 下实行 建立用户名和密码 文件名 用户名 htpasswd -c httppwd test 如果要添加多个用户那么只要第一使用过-c;以后都不用 htpasswd httppwd aaa 并在添加 Alias /test2 "/root/web/test2/" require Valid-user = user test aaa %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 用户组授权 Alias /test2 "/root/web/test2/" <Directory "/root/web/test2"> Options Indexes MultiViews allowOverride None authtype basic authname "welcome admin" authuserfile /etc/httpd/httppwd authgroupfile /etc/httpd/httpgrp require group admin </Directory> vi httpgrp 添加 如下内容: admin:test aaa 在/etc/httpd/httppwd 和/etc/httpd/httpgrp 都存在相同的用户 &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 用.htaccess 文件授权 Alias /test2 "/root/web/test2/" <Directory "/root/web/test2"> Options Indexes MultiViews AllowOve

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号