手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

Linux下Web服务器应用之基础简介

[日期:2012-05-08] 来源:Linux社区  作者:xjzhujunjie [字体:大 中 小]
身份验证 
AllowOverride all
.htaccess (说明文件) (站点主目录里面)
.htpasswd(账号库)
[root@junjie_www html]# cat .htaccess
authuserfile /var/www/html/.htpasswd
authtype basic
authname   "please input your name and password"
require        valid-user
[root@junjie_www html]# htpasswd -c .htpasswd qq (首次使用需要-c选项)
[root@junjie_www html]# htpasswd .htpasswd qq1(第二次使用需要-c选项)
客户端测试:出现如下验证信息:(需要输入正确的用户名与密码)

来源控制
【 Order allow,deny
    Allow from all】
【Order allow,deny
    Allow from 192.168.2.0/24
     deny from 192.168.2.1】
【Order deny,allow
    Allow from 192.168.2.0/24
     deny from 192.168.2.1】

349 <IfModule mod_userdir.c>

355     UserDir disable         #用户的目录安全性

362     #UserDir public_html     ##打开此行,创建个人主页,取消注释

364 </IfModule>

/var/log/httpd /    #日志目录

/home/$USER/public_html/   #都要有可读权限

370 #<Directory /home/*/public_html>       #个人目录的安全性

371 #    AllowOverride FileInfo AuthConfig Limit #一些限制

372 #    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoE    xec        #一些可用参数

373 #    <Limit GET POST OPTIONS>

374 #        Order allow,deny

375 #        Allow from all

376 #    </Limit>

377 #    <LimitExcept GET POST OPTIONS>

378 #        Order deny,allow

379 #        Deny from all

380 #    </LimitExcept>

381 #</Directory>

 

 

391 DirectoryIndex index.html index.html.var          #支持的目录文件

398 AccessFileName .htaccess     #用于用户验证的信息

413 TypesConfig /etc/mime.types
424 DefaultType text/plain
444 HostnameLookups Off
472 ErrorLog logs/error_log
479 LogLevel warn
485 LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Ag    ent}i\"" combined
486 LogFormat "%h %l %u %t \"%r\" %>s %b" common
487 LogFormat "%{Referer}i -> %U" referer
488 LogFormat "%{User-agent}i" agent
514 CustomLog logs/access_log combined
739 LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl     nn no pl pt pt-BR ru sv zh-CN zh-TW //语言显示的优先级
755 AddDefaultCharset UTF-8     //西欧文字集,若显示中文建议关闭
845 Alias /error/ "/var/www/error/" #错误显示文件
937 #<Proxy *>         #apache的代理功能
938 #    Order deny,allow
939 #    Deny from all
940 #    Allow from .example.com
941 #</Proxy>
963 ### Section 3: Virtual Hosts4 #                #第三部分配置(虚拟主机)
993 #<VirtualHost *:80>
994 #    ServerAdmin webmaster@dummy-host.example.com
995 #    DocumentRoot /www/docs/dummy-host.example.com
996 #    ServerName dummy-host.example.com
997 #    ErrorLog logs/dummy-host.example.com-error_log
998 #    CustomLog logs/dummy-host.example.com-access_log common
999 #</VirtualHost>
虚拟主机:
1.    物理目录
2.    虚拟目录
3.    基于ip地址的虚拟主机
4.    基于端口的虚拟主机
5.    基于主机头的虚拟主机
linux
相关资讯       Linux服务器 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款