Refactor for httpd22 and httpd24, and simplify built-in httpd