Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
httpd.conf programming
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
jeffhung
April 20, 2013
Programming
330
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
httpd.conf programming
My Lightning talk in OSDC.tw 2013
jeffhung
April 20, 2013
Other Decks in Programming
See All in Programming
Python Lambdaにおけるテストしやすい設計とAI支援の活用 / Designing Testable Python Lambda Functions with AI
kitano_yuichi
1
220
Jetpack Compose Mechanisms
skydoves
3
880
JIS keyboard support in Omarchy
lef237
0
160
SFCで実現する病院・医療システムの動的組み立て式UI
koukimiura
1
130
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Kaigi on Rails 2026, Tokyo, Japan
marcoroth
2
360
Seven New Principles of Software Engineering
yegor256
0
350
Compiling a real-world CLI tool to native with Static Hermes
tmikov2023
0
130
graphql-ruby を Spinel で速くしようとした話
mtsmfm
0
120
[2026-10-14](C)Re:ゼロから始める異世界生活〜始まりの終わりと終わりの始まり〜
tosite
0
160
R8 の設定見直しでアプリサイズ削減
andpad
0
230
AI-Powered Domain-Driven Design
ziobrando
0
340
あなたの await、OS まで届いてる? strace で覗く JavaScript の非同期
hasutosasaki
1
1.6k
Featured
See All Featured
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
330
Mobile First: as difficult as doing things right
swwweet
225
10k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
440
sira's awesome portfolio website redesign presentation
elsirapls
0
470
Crafting Experiences
bethany
1
390
How to Talk to Developers About Accessibility
jct
2
590
Six Lessons from altMBA
skipperchong
29
4.5k
Scaling GitHub
holman
464
140k
From π to Pie charts
rasagy
1
420
New Earth Scene 8
popppiees
4
2.7k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
490
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.