制造工厂剖析--组织架构,职能职位
2009-07-01 13:58
489 查看
①:Nginx 基于ip的虚拟主机配置实例
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
server {
listen 80 default;
server_name _;
access_log logs/default.access.log main;
server_name_in_redirect off;
location / {
index index.html index.htm;
root /var/www/default/htdocs;
}
}
server {
listen 80;
server_name 10.5.10.34;
access_log logs/34.access.log main;
location / {
index index.html index.htm;
root /www/nginx/34;
}
}
server {
listen 80;
server_name 10.5.10.35;
access_log logs/35.access.log main;
location / {
index index.html index.htm;
root /www/nginx/35;
}
}
}
PS:
①基于ip的虚拟主机server的红色部分一定要有否则访问10.5.10.34和35是同一个目录(参看http://wiki.nginx.org/ServerBlockExample).
②由于红色部分中access.log 类型为main 故nginx.conf中默认的日志格式一定要打开(即去掉前面的“#”),否则会出现如下错误信息"2013/03/02 01:22:10 [emerg] 31055#0: unknown log format "main" in /usr/local/nginx/conf/nginx.conf:80"
②基于域名的虚拟主机配置实例
http{
server{
listen 80;
server_name www.a.com;
access_log a.com.access.log combined;
location / {
index index.html index.htm;
root /www/nginx/34;
}
}
server{
listen 80;
server_name www.b.net;
access_log b.net.access.log combined;
location / {
index index.html index.htm;
root /www/nginx/35;
}
}
server{
listen 80;
server_name www.c.org;
access_log c.org.access.log combined;
location / {
index index.html index.htm;
root /www/nginx/36;
}
}
}
以下是我通过chrome和elinks访问的日志信息。
③基于端口的虚拟机主机实例
http{
server{
listen 80;
server_name 10.5.10.34;
access_log port.80.access.log combined;
location / {
index index.html index.htm;
root /www/nginx/34;
}
}
server{
listen 8080;
server_name 10.5.10.34;
access_log port.8080.access.log combined;
location / {
index index.html index.htm;
root /www/nginx/35;
}
}
server{
listen 8081;
server_name 10.5.10.34;
access_log port.8081.access.log combined;
location / {
index index.html index.htm;
root /www/nginx/36;
}
}
}
#elinks 10.5.10.34
#elinks 10.5.10.34:8080
#elinks 10.5.10.34:8081
以下是我用elinks访问基于port虚拟主机的access日志
ps:基于域名和基于端口的虚拟主机不需要像基于ip的添加那段红色代码便可以正常访问。
快乐学习,快乐分享!
本文出自 “Peace与你一起学Linux” 博客,请务必保留此出处http://hepeace.blog.51cto.com/4387185/1143429
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
server {
listen 80 default;
server_name _;
access_log logs/default.access.log main;
server_name_in_redirect off;
location / {
index index.html index.htm;
root /var/www/default/htdocs;
}
}
server {
listen 80;
server_name 10.5.10.34;
access_log logs/34.access.log main;
location / {
index index.html index.htm;
root /www/nginx/34;
}
}
server {
listen 80;
server_name 10.5.10.35;
access_log logs/35.access.log main;
location / {
index index.html index.htm;
root /www/nginx/35;
}
}
}
PS:
①基于ip的虚拟主机server的红色部分一定要有否则访问10.5.10.34和35是同一个目录(参看http://wiki.nginx.org/ServerBlockExample).
②由于红色部分中access.log 类型为main 故nginx.conf中默认的日志格式一定要打开(即去掉前面的“#”),否则会出现如下错误信息"2013/03/02 01:22:10 [emerg] 31055#0: unknown log format "main" in /usr/local/nginx/conf/nginx.conf:80"
②基于域名的虚拟主机配置实例
http{
server{
listen 80;
server_name www.a.com;
access_log a.com.access.log combined;
location / {
index index.html index.htm;
root /www/nginx/34;
}
}
server{
listen 80;
server_name www.b.net;
access_log b.net.access.log combined;
location / {
index index.html index.htm;
root /www/nginx/35;
}
}
server{
listen 80;
server_name www.c.org;
access_log c.org.access.log combined;
location / {
index index.html index.htm;
root /www/nginx/36;
}
}
}
以下是我通过chrome和elinks访问的日志信息。
③基于端口的虚拟机主机实例
http{
server{
listen 80;
server_name 10.5.10.34;
access_log port.80.access.log combined;
location / {
index index.html index.htm;
root /www/nginx/34;
}
}
server{
listen 8080;
server_name 10.5.10.34;
access_log port.8080.access.log combined;
location / {
index index.html index.htm;
root /www/nginx/35;
}
}
server{
listen 8081;
server_name 10.5.10.34;
access_log port.8081.access.log combined;
location / {
index index.html index.htm;
root /www/nginx/36;
}
}
}
#elinks 10.5.10.34
#elinks 10.5.10.34:8080
#elinks 10.5.10.34:8081
以下是我用elinks访问基于port虚拟主机的access日志
ps:基于域名和基于端口的虚拟主机不需要像基于ip的添加那段红色代码便可以正常访问。
快乐学习,快乐分享!
本文出自 “Peace与你一起学Linux” 博客,请务必保留此出处http://hepeace.blog.51cto.com/4387185/1143429
相关文章推荐
- 解码知乎:知乎组织架构模型“大剖析”UGC 网站优化如何借鉴
- 致互联网人:一篇文章让你了解互联网公司的职位架构以及职能要求
- 致互联网人:一篇文章让你了解互联网公司的职位架构以及职能要求
- 致互联网人:一篇文章让你了解互联网公司的职位架构以及职能要求
- 解码知乎:知乎组织架构模型“大剖析”
- 小议IT公司的组织架构
- Android Sensor 架构深入剖析
- iOS代码组织和架构总结
- 剖析SalesForce的多租户架构(PAAS\SAAS\云计算)
- Kafka剖析(一):Kafka背景及架构介绍
- 转 Unity3D-深入剖析NGUI的游戏UI架构
- 浅谈微博营销公司的组织架构
- 域基础架构的创建 dns 反向创建,组织单位创建 ,域用户创建
- 小议IT公司的组织架构
- 设计系统的组织,其产生的设计和架构等价于组织间的沟通结构(转)
- 组织架构适配下的敏捷开发
- ARMv5 架构寄存器的组织
- 微服务化架构演进与人员组织
- Linux内核笔记(4) Linux实时架构剖析
- 云存储基础架构剖析