http的虚拟主机

对于某些web访问站点而言,每天的访问量很少,因此真正的放一台服务器去进行web站点是很

浪费资源的,因此我们选择了虚拟主机

web处理模块的分类(MPM)

1.perfork

一个请求占用一个进程

2.worker

一个请求占用一个线程

3.event(httpd2.2暂时不支持httpd2.4默认的就是event)

事件驱动模型,通知


我们都知道,无论是虚拟的还是物理的主机,我们都需要去辨识这台主机,辨识的方法有三种

1.基于ip

2.基于端口

3.基于域名


以下例子就是对于以上三种的配置练习:

-----------------------------------------------------------------------------------------------------------

NameVirtualHost 192.168.192.130:80



       
ServerName hello2.magedu.com

       
DocumentRoot "/www/magedu2.com"

       
CustomLog "/var/log/httpd/magedu2.com/access_log" combined

      
< Directory "/www/magedu2.com">

               
Options none

               
AllowOverride AuthConfig

               
AuthType Basic

               
AuthName       
"My name."

               
AuthUserFile "/etc/httpd/conf/htpasswd"

               
Require valid-user

      
<
/Directory>   

< /VirtualHost>



       
Servername hello.magedu.com

       
DocumentRoot "/www/magedu.com"

       
CustomLog  "/var/log/httpd/magedu.com/access_log"
combined

< /VirtualHost>

 

 



       
ServerName www.a.org

       
DocumentRoot "/www/a.org"  

       
CustomLog "/var/log/httpd/a.org/access_log" combined

< /VirtualHost>

 



       
ServerName www.b.org

       
DocumentRoot   
"/www/b.org"

      
< Directory "/www/b.org">

               
Options none

               
AllowOverride none

#              
Order deny,allow

#                      
deny from 192.168.192.131

      
< /Directory>

< /VirtualHost>

 

最新文章

  1. MongoDB【第二篇】MongoDB逻辑与物理存储结构
  2. PHP7 redis扩展安装
  3. 《零成本实现Web性能测试:基于Apache JMeter》读书笔记
  4. html5中的clip
  5. LVDS,MIPI,EDP
  6. ICMP type code 对应表(转)
  7. 【CodeForces 471A】MUH and Sticks
  8. oracle增加表空间的四种方法,查询表空间使用情况
  9. 使用jqueryui
  10. QQ空间g_tk加密算法PHP版
  11. python 函数初识和文件操作
  12. Android 定义自己的学习(5)它们的定义Progressbar
  13. redhat 6.8 配置centos6的yum源
  14. POJ 1324(BFS + 状态压缩)
  15. 安装vs2017后造成无法打开xproj项目无法打开
  16. BZOJ.2301.[HAOI2011]Problem B(莫比乌斯反演 容斥)
  17. Nginx ab压力测试
  18. golang的配置文件操作:viper
  19. saltstack安装配置及常用命令
  20. Win(Phone)10开发第(1)弹,桌面和手机的扩展API,还我后退键

热门文章

  1. url长度
  2. 对数组排序进行&quot;洗牌&quot;(随机排序)
  3. FRM-40654 Record has been updated
  4. Java -GUI开发九九乘法表
  5. MongoDB详解
  6. python3 爬虫笔记(一)beautiful_soup
  7. leetcode:回溯——permutation-sequence,
  8. express不是内部命令
  9. 静态库是.o文件的集合与弱符号
  10. 45. 腾讯面试题: 使用hashmap 插入数据,怎么样依照插入数据的顺序输出数据