Home | 简体中文 | 繁体中文 | 杂文 | Github | 知乎专栏 | 51CTO学院 | CSDN程序员研修院 | OSChina 博客 | 腾讯云社区 | 阿里云栖社区 | Facebook | Linkedin | Youtube | 打赏(Donations) | About
知乎专栏多维度架构

Netkiller Linux Web 手札

Apache, Lighttpd, Nginx, Resin, Tomcat, Jboss, Zope...

Mr. Neo Chan, 陈景峯(BG7NYT)



中国广东省深圳市望海路半岛城邦三期
518067
+86 13113668890


$Date: 2013-04-10 15:03:49 +0800 (Wed, 10 Apr 2013) $, $Id: book.xml 559 2013-04-10 07:03:49Z netkiller $

电子书最近一次更新于 2023-08-09 22:10:55

版权声明

转载请与作者联系,转载时请务必标明文章原始出处和作者信息及本声明。

http://www.netkiller.cn
http://netkiller.github.io
http://netkiller.sourceforge.net
微信公众号: netkiller
微信:13113668890 请注明“读者”
QQ:13721218 请注明“读者”
QQ群:128659835 请注明“读者”
知乎专栏 | 多维度架构

2017-02-13


致读者

Netkiller 系列手札 已经被 Github 收录,并备份保存在北极地下250米深的代码库中,备份会保留1000年。

Preserving open source software for future generations

The world is powered by open source software. It is a hidden cornerstone of modern civilization, and the shared heritage of all humanity.

The GitHub Arctic Code Vault is a data repository preserved in the Arctic World Archive (AWA), a very-long-term archival facility 250 meters deep in the permafrost of an Arctic mountain.

We are collaborating with the Bodleian Library in Oxford, the Bibliotheca Alexandrina in Egypt, and Stanford Libraries in California to store copies of 17,000 of GitHub’s most popular and most-depended-upon projects—open source’s “greatest hits”—in their archives, in museum-quality cases, to preserve them for future generations.

https://archiveprogram.github.com/arctic-vault/

目录

1. 自述
1.1. 写给读者
1.2. 作者简介
1.3. 如何获得文档
1.4. 打赏(Donations)
1.5. 联系方式
1. Nginx
1.1. Installing
1.1.1. Netkiller OSCM 一键安装 (CentOS 7)
1.1.2. Installing by apt-get under the debain/ubuntu
1.1.3. CentOS
1.1.4. installing by source
1.1.5. CentOS 7
1.1.6. Mac
1.1.7. rotate log
1.2. Nginx 命令
1.2.1. -V show version and configure options then exit
1.2.2. -t : test configuration and exit
1.2.3. test configuration, dump it and exit
1.3. nginx.conf 配置文件
1.3.1. 处理器配置
1.3.2. events 配置
1.3.3. Nginx 变量
1.4. http 配置
1.4.1. 缓冲区相关设置
1.4.2. 超时设置
1.4.3. gzip
1.4.4. server_tokens
1.4.5. ssi
1.4.6. DNS 解析
1.4.7. rewrite
1.5. server
1.5.1. listen
1.5.2. server_name 配置
1.5.3. location
1.5.4. root 通过$host智能匹配目录
1.5.5. try_files
1.5.6. SSL 虚拟主机
1.5.7. HTTP2 配置 SSL证书
1.5.8. 免费 SSL 证书
1.5.9. expires
1.5.10. access
1.5.11. autoindex
1.5.12. return
1.5.13. add_header
1.5.14. client_max_body_size 上传文件尺寸限制
1.6. 单域名虚拟主机
1.7. upstream 负载均衡
1.7.1. weight 权重配置
1.7.2. backup 实现热备
1.8. Proxy
1.8.1. proxy_cache
1.8.2. rewrite + proxy_pass
1.8.3. request_filename + proxy_pass
1.8.4. $request_uri 与 proxy_pass 联合使用
1.8.5. try_files 与 proxy_pass 共用
1.8.6. Proxy 与 SSI
1.8.7. Host
1.8.8. expires
1.8.9. X-Forwarded-For
1.8.10. X-Sendfile
1.8.11. proxy_http_version
1.8.12. proxy_set_header
1.8.13. 隐藏头部信息
1.8.14. 忽略头
1.8.15. proxy_pass_request_headers 透传 Header
1.8.16. timeout 超时时间
1.8.17. sub_filter 文本替换
1.8.18. 站外代理
1.8.19. example
1.8.20. HTTP Auth 认证冲突
1.9. fastcgi
1.9.1. spawn-fcgi
1.9.2. php-fpm
1.10. Nginx module
1.10.1. stub_status 服务器状态采集模块
1.10.2. sub_filter 页面中查找和替换
1.10.3. auth_basic HTTP 认证模块
1.10.4. valid_referers
1.10.5. ngx_http_flv_module
1.10.6. ngx_http_mp4_module
1.10.7. limit_zone
1.10.8. image_filter
1.10.9. ngx_stream_proxy_module
1.10.10. ngx_http_mirror_module
1.10.11. limit_except
1.10.12. geoip_country_code
1.11. Example
1.11.1. Nginx + Tomcat
1.11.2. 拦截index.html
1.11.3. Session 的 Cookie 域处理
1.12. FAQ
1.12.1. 405 Not Allowed?
1.12.2. 413 Request Entity Too Large
1.12.3. 499 Client Closed Request
1.12.4. 502 Bad Gateway?
1.12.5. 504 Gateway Time-out
1.12.6. proxy_pass
1.12.7. proxy_pass SESSION 丢失问题
1.12.8. [alert] 55785#0: *11449 socket() failed (24: Too many open files) while connecting to upstream
1.12.9. server_name 与 SSI 注意事项
1.12.10. location 跨 document_root 引用,引用 document_root 之外的资源
1.12.11. nginx: [warn] duplicate MIME type "text/html" in /etc/nginx/nginx.conf
1.12.12. 127.0.0.1:8080 failed
1.12.13. failed (13: Permission denied) while connecting to upstream
1.12.14. upstream sent too big header while reading response header from upstream
1.12.15. 很目录 index.html 正常访问,其他文件都是 404
1.12.16. nginx: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead
2. Openresty
2.1. 安装 Openresty
2.1.1. 源码安装
2.2. Openresty 开发
2.2.1. Hello world!!!
2.2.2. 日期和时间
2.2.3. 数据结构
2.2.4. echo 输出
2.2.5. 参数处理
2.2.6. Nginx 变量
2.2.7. Json
2.2.8. Redis
2.2.9. Nginx 缓存
2.2.10. logs
2.3. 实现灰度发布
2.4. Redis
3. Caddy
3.1. 安装 Caddy
3.1.1. CentOS/Rocky Linux/AlmiLinux
3.2. 命令行
3.2.1. 启动 Caddy
3.2.2. 文件服务器
3.3. /etc/caddy/Caddyfile
3.3.1. 监听地址
3.3.2. 反向代理
3.3.3. Let's Encrypt 免费 SSL 证书
3.3.4. 返回内容
4. Apache Tomcat
4.1. Tomcat 安装与配置
4.1.1. Tomcat 6
4.1.2. Tomcat 7
4.1.3. Java 8 + Tomcat 8
4.1.4. Tomcat 9/10
4.1.5. 防火墙配置
4.1.6. 同时运行多实例
4.1.7. Testing file
4.1.8. mod_jk
4.1.9. mod_proxy_ajp
4.1.10. RewriteEngine 连接 Tomcat
4.1.11. SSL 双向认证
4.2. 配置 Tomcat 服务器
4.2.1. server.xml
4.2.2. tomcat-users.xml
4.2.3. context.xml
4.2.4. logging.properties
4.2.5. catalina.properties
4.3. 虚拟主机配置
4.3.1. 方案一
4.3.2. 方案二
4.3.3. Alias 别名
4.3.4. access_log
4.3.5. Context 配置
4.3.6. 主机绑定IP地址
4.4. SSI
4.5. Logging 日志
4.5.1. 开启 debug 模式
4.5.2. 切割 catalina.out 日志
4.6. Init.d Script
4.6.1. Script 1
4.6.2. Shell Script 2
5. Apache httpd
5.1. Install
5.1.1. Quick install apache with aptitude
5.1.2. CentOS 6
5.1.3. Compile and then install Apache
5.1.4. XAMPP
5.2. Module
5.2.1. Output a list of modules compiled into the server.
5.2.2. Core
5.2.3. mpm
5.2.4. Apache Log
5.2.5. mod_access
5.2.6. VirtualHost
5.2.7. Alias / AliasMatch
5.2.8. Redirect / RedirectMatch
5.2.9. Rewrite
5.2.10. Proxy
5.2.11. Deflate
5.2.12. Expires
5.2.13. Cache
5.2.14. usertrack
5.2.15. Charset
5.2.16. Dir
5.2.17. Includes
5.2.18. Apache Status
5.2.19. Mod Perl
5.2.20. mod_pagespeed -
5.2.21. Module FAQ
5.2.22. mod_setenvif
5.2.23. PHP 程序安全问题 php_admin_value
5.2.24. mod_spdy
5.3. 设置Apache实现防盗连
5.4. .htaccess
5.5. Error Prompt
5.5.1. Invalid command 'Order', perhaps misspelled or defined by a module not included in the server configuration
5.5.2. Invalid command 'AuthUserFile', perhaps misspelled or defined by a module not included in the server configuration
6. Lighttpd
6.1. 安装Lighttpd
6.1.1. quick install with aptitude
6.1.2. yum install
6.1.3. to compile and then install lighttpd
6.2. /etc/lighttpd/lighttpd.conf
6.2.1. max-worker / max-fds
6.2.2. accesslog.filename
6.2.3. ETags
6.2.4. server.tag
6.3. Module
6.3.1. simple_vhost
6.3.2. ssl
6.3.3. redirect
6.3.4. rewrite
6.3.5. alias
6.3.6. auth
6.3.7. compress
6.3.8. expire
6.3.9. status
6.3.10. setenv
6.3.11. fastcgi
6.3.12. user-agent
6.3.13. spdy
6.4. 其他模块
6.4.1. mod_secdownload 防盗链
6.5. Example
6.5.1. s-maxage
7. Resin
7.1. 安装Resin
7.1.1. 直接使用
7.1.2. Debian/Ubuntu
7.1.3. 源码安装Resin
7.2. Compiling mod_caucho.so
7.3. resin.conf
7.3.1. Maximum number of threads
7.3.2. Configures the keepalive
7.3.3. ssl
7.4. virtual hosts
7.4.1. explicit host
7.4.2. regexp host
7.4.3. host-alias
7.4.4. configures a deployment directory for virtual hosts
7.4.5. Resources
7.5. FAQ
7.5.1. java.lang.OutOfMemoryError: PermGen space
8. Application Server
8.1. Zope
8.2. JBoss - JBoss Enterprise Middleware
9. Web Server Optimization
9.1. ulimit
9.1.1. open files
9.2. khttpd
9.3. php.ini
9.3.1. Resource Limits
9.3.2. File Uploads
9.3.3. Session Shared
9.3.4. PATHINFO
9.4. APC Cache (php-apc - APC (Alternative PHP Cache) module for PHP 5)
9.5. Zend Optimizer
9.6. eaccelerator
10. varnish - a state-of-the-art, high-performance HTTP accelerator
10.1. Varnish Install
10.2. varnish utility
10.2.1. status
10.2.2. varnishadm
10.2.3. varnishtop
10.2.4. varnishhist
10.2.5. varnishsizes
10.3. log file
10.4. Varnish Configuration Language - VCL
10.4.1. unset / set
10.5. example
11. Apache Traffic Server
11.1. Install
11.2. Configure
12. Cherokee
12.1. Installing Cherokee
13. Jetty
14. Other Web Server
14.1. Python SimpleHTTPServer
15. web 服务器排名
15.1. HTTP状态码
16. HTTP2
16.1. Chrome

范例清单

1.1. Nginx SSL 双向认证,证书生成过程
1.2. Expires Examples
1.3. nginx expires
1.4. Example: valid_referers
1.5. Nginx + Tomcat
4.1. /etc/profile.d/java.sh
4.2. /etc/init.d/tomcat
4.3. Example /srv/apache-tomcat/conf
4.4. tomcat firewall
4.5. /etc/rc.d/init.d/www
5.1. index.php
5.2. autolamp.sh
5.3. R=301
5.4. mod_perl.conf
6.1. /etc/init.d/lighttpd
6.2. lighttpd compress
6.3. lighttpd expire
6.4. fastcgi.conf
6.5. Cache
7.1. explicit host in resin.conf
7.2. regexp host in resin.conf
7.3. host-alias in the resin.conf
7.4. host-alias in a /var/www/hosts/foo/host.xml
7.5. host-alias-regexp in the resin.conf
7.6. shared database in host
7.7. rewrite-dispatch
10.1. default.vcl