Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
httpd.conf programming
Search
jeffhung
April 20, 2013
Programming
320
1
Share
httpd.conf programming
My Lightning talk in OSDC.tw 2013
jeffhung
April 20, 2013
Other Decks in Programming
See All in Programming
Lightning-Fast Method Calls with Ruby 4.1 ZJIT / RubyKaigi 2026
k0kubun
3
560
クラウドネイティブなエンジニアに向ける Raycastの魅力と実際の活用事例
nealle
2
200
PHPで TLSのプロトコルを実装してみるをもう一度しゃべりたい
higaki_program
0
210
検索設計から 推論設計への重心移動と Recall-First Retrieval
po3rin
2
510
Going Multiplatform with Your Android App (Android Makers 2026)
zsmb
2
440
PDI: Como Alavancar Sua Carreira e Seu Negócio
marcelgsantos
0
120
アクセシビリティ試験の"その後"を仕組み化する
yuuumiravy
0
150
UIの境界線をデザインする | React Tokyo #15 メイントーク
sasagar
2
370
Angular Signal Forms
debug_mode
0
110
レガシーPHP転生 〜父がドメインエキスパートだったのでDDD+Claude Codeでチート開発します〜
panda_program
0
1k
JOAI2026 1st solution - heron0519 -
heron0519
0
140
tRPCの概要と少しだけパフォーマンス
misoton665
2
220
Featured
See All Featured
Java REST API Framework Comparison - PWX 2021
mraible
34
9.3k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
210
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
64
55k
Believing is Seeing
oripsolob
1
110
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
100
Faster Mobile Websites
deanohume
310
31k
Side Projects
sachag
455
43k
Utilizing Notion as your number one productivity tool
mfonobong
4
290
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
200
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.2k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Transcript
httpd.conf programming OSDC.tw 2013
@jeffhung • www.jeffhung.net/blog • Trend Micro Developer • Hadoop, Big
Data • and.. PaaS
PaaS?
Platform as a Service
Google AppEngine
TCloud, 2010
The Path to Pass into PasS Talk @ OSDC.tw 2011
Dispatcher MySQL& Database& MySQL& Database& MySQL& Database& MySQL& Database& Java&Web&
Container& Java&Web& Container& Java&Web& Container& Java&Web& Container& Hadoop& HBase& Hadoop& HBase& Hadoop& HBase& Hadoop& HBase& Lucene& Indexer& Lucene& Indexer& Lucene& Indexer& Search& Engine& Elaster&CAP&Service& (API&Server)& Elaster&CAP&Service& (API&Server)& Elaster&CAP&Service& (API&Server)& Elaster&CAP&Service& (API&Server)& api.elasterlabs.com.tw *.app.elasterlabs.com.tw Internet& Balancer Manage&
nginx
ZooKeeper
Lots of Java codes to implement the agents to control
nginx according to routing rules subscribed from ZK
Jserv: 㑌ཁሜҰ ࡞ۀܥ౷
lunastorm: 㑌ཁሜ Ұ message system
jeffhung: 㑌ཁሜҰ PaaS
20 RD + 6 months to built Elaster CAP
5 RD + 6 weeks to bootstrap a private PaaS
for our own
How?
We have a strong OPS team
do more with less don’t code anything
Apache HTTPd ++
Dispatcher done in httpd.conf
If it works, it works.
Bug? It’s apache’s fault
Redis replaces ZK
Apache replaces nginx
Glue together with httpd.conf
httpd.conf programming
function REDIS (cmd) { ... } # Call REDIS()?
# function REDIS (cmd) { ... } RewriteMap REDIS "prg:redis-cli
--raw" # Call REDIS()? ${REDIS:cmd}
if url == "/index.html" redirect "/404.html" else if proxy "/app/...",
"http://app/REDIS(app)"
# function REDIS (cmd) { ... } RewriteMap REDIS "prg:redis-cli
--raw" # if url == "/index.html" # redirect "/404.html" RewriteRule ^/index.html /404.html [L,P] # else if # proxy "/app/...", "http://app/REDIS(app)" RewriteRule ^([^\/]*)/(.*) ${REDIS:GET\ $1}/$2 [L,P]
Live Demo simplified https://github.com/jeffhung/osdc-2013-lightning
The Actual httpd.conf • Authentication & Authorization • Customer Header
Injection • Dispatching & Load Balancing
~200 lines of httpd.conf And several filter scripts
~200 lines of httpd.conf And several filter scripts dash2under.pl: #!/usr/bin/perl
$| = 1; # Turn off I/O buffering while (<STDIN>) { s/-/_/g; # Replace dashes with underscores print $_; }
If it works, it works.