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
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
Transcript
36 slides
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.
Other Decks in Programming
See All in Programming
SONY CISC-NEWS NWS-1750 + NWB-225 ハードウェアメンテとフレームバッファカラー対応 / KOF2026
tsutsui
0
120
Zero-Tap Sign-In対応、結局何をすればいいの?
mitohato14
0
2.5k
Beyond Chatbots: Agentic UI with Open Standards @W-JAX 2026, München
manfredsteyer
PRO
0
120
私なりのハーネスエンジニアリング ~独自の言語処理系の開発を通して~
seosoft
0
230
AIが実装を担う時代の「技術設計」と「チームマネジメント」
kamina_zzz
2
290
あなたはMCPの機能を、まだ知らない。
4geru
1
700
선언형 햅틱 라이브러리 진동을 소개합니다
l2hyunwoo
1
330
Spec-Driven Development - Why Vaadin Is the Perfect Fit
simas
PRO
0
260
将来の標準フォーマッター?ktfmtを深堀る
t45k
0
230
Spec-driven Development with AI
simas
PRO
0
2.3k
オーケストレーション記述言語 Katari
yukikurage
0
270
Kotlin JVM用に作られたライブラリのKMPを前提とした再設計
jsoizo
0
220
Featured
See All Featured
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
3
3.9k
The Limits of Empathy - UXLibs8
cassininazir
2
800
AI: The stuff that nobody shows you
jnunemaker
PRO
12
1.3k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.8k
Building Flexible Design Systems
yeseniaperezcruz
330
41k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
680
The untapped power of vector embeddings
frankvandijk
2
2k
Paper Plane (Part 1)
katiecoart
PRO
3
12k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
350
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
480
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
640