Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
httpd.conf programming
Search
jeffhung
April 20, 2013
Programming
1
320
httpd.conf programming
My Lightning talk in OSDC.tw 2013
jeffhung
April 20, 2013
Tweet
Share
Other Decks in Programming
See All in Programming
チームをチームにするEM
hitode909
0
320
tparseでgo testの出力を見やすくする
utgwkk
2
210
30分でDoctrineの仕組みと使い方を完全にマスターする / phpconkagawa 2025 Doctrine
ttskch
3
830
AIの誤りが許されない業務システムにおいて“信頼されるAI” を目指す / building-trusted-ai-systems
yuya4
6
3.2k
LLMで複雑な検索条件アセットから脱却する!! 生成的検索インタフェースの設計論
po3rin
3
700
開発に寄りそう自動テストの実現
goyoki
2
910
20251212 AI 時代的 Legacy Code 營救術 2025 WebConf
mouson
0
130
大体よく分かるscala.collection.immutable.HashMap ~ Compressed Hash-Array Mapped Prefix-tree (CHAMP) ~
matsu_chara
2
220
DevFest Android in Korea 2025 - 개발자 커뮤니티를 통해 얻는 가치
wisemuji
0
140
WebRTC、 綺麗に見るか滑らかに見るか
sublimer
1
160
複数人でのCLI/Infrastructure as Codeの暮らしを良くする
shmokmt
5
2.3k
ローターアクトEクラブ アメリカンナイト:川端 柚菜 氏(Japan O.K. ローターアクトEクラブ 会長):2720 Japan O.K. ロータリーEクラブ2025年12月1日卓話
2720japanoke
0
730
Featured
See All Featured
Code Reviewing Like a Champion
maltzj
527
40k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
34k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
10
720
Designing Experiences People Love
moore
143
24k
Unsuck your backbone
ammeep
671
58k
Automating Front-end Workflow
addyosmani
1371
200k
It's Worth the Effort
3n
187
29k
Reflections from 52 weeks, 52 projects
jeffersonlam
355
21k
RailsConf 2023
tenderlove
30
1.3k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
710
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.