http虚拟主机的简单配置训练
2024-10-22 05:07:51
http的虚拟主机
对于某些web访问站点而言,每天的访问量很少,因此真正的放一台服务器去进行web站点是很
浪费资源的,因此我们选择了虚拟主机
web处理模块的分类(MPM)
1.perfork
一个请求占用一个进程
2.worker
一个请求占用一个线程
3.event(httpd2.2暂时不支持httpd2.4默认的就是event)
事件驱动模型,通知
对于某些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>
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>
最新文章
- MongoDB【第二篇】MongoDB逻辑与物理存储结构
- PHP7 redis扩展安装
- 《零成本实现Web性能测试:基于Apache JMeter》读书笔记
- html5中的clip
- LVDS,MIPI,EDP
- ICMP type code 对应表(转)
- 【CodeForces 471A】MUH and Sticks
- oracle增加表空间的四种方法,查询表空间使用情况
- 使用jqueryui
- QQ空间g_tk加密算法PHP版
- python 函数初识和文件操作
- Android 定义自己的学习(5)它们的定义Progressbar
- redhat 6.8 配置centos6的yum源
- POJ 1324(BFS + 状态压缩)
- 安装vs2017后造成无法打开xproj项目无法打开
- BZOJ.2301.[HAOI2011]Problem B(莫比乌斯反演 容斥)
- Nginx ab压力测试
- golang的配置文件操作:viper
- saltstack安装配置及常用命令
- Win(Phone)10开发第(1)弹,桌面和手机的扩展API,还我后退键