New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Analysis of current SCL3 Apache config, and possible conversion to Python #180
Comments
I spent a day with the existing SCL3 Apache config. Here are some crude (low level) notes on my investigation: https://gist.github.com/metadave/f7f84d62e9aac10ca1d116e57b40a0f0 SummaryThe existing Apache config is complex, running it in Docker and Kubernetes has proven to be extremely difficult. Even running a partial Apache config for redirects and rewrites presents several technical challenges, such as config conversion to support our AWS infrastructure, module compilation against older version of Apache (2.2), and lots of table flipping. I recommend migrating the important redirects and rewrites to Django/Python, as I believe this path will take less time than using the existing Apache config running in AWS (either running in Kubernetes OR standalone on EC2 instances). We already have a Jenkins multi branch pipeline that pushes our demos out to Kubernetes, so we won't need to bring the SCL3 deployment scripts/tooling over to AWS/Kubernetes. Web/App tiersThe existing Apache config runs both Apache and Django on the same instance. This makes packaging to run in Docker significantly more difficult, as we'd either have to run Apache and Django/Kuma from a single Docker image (resulting in a compilation nightmare and huge images), or setup named pipes between multiple containers so Apache can connect to Django. Kubernetes Services and Deployments do this for us "for free". As Kuma is already running in demo mode in Kubernetes, we can take advantage of the new setup and either have Django handle all incoming requests (w/ ELB terminating TLS), or run nginx pods to do some more web lifting for us. You can see my attempt to compile some of the additional Apache modules in the context of a new Docker image here. Rewrites and RedirectsI recommend implementing redirects/rewrites in Python and/or nginx to keep things simple. @pmac is planning to implement some common redirect functionality in Bedrock that we can leverage.
EDIT: @pmac has released this lib: https://github.com/pmac/django-redirect-urls Rewrites:
Redirects:
Serving static contantKuma server several non-(image, css, js) content from the Additional Apache modulesThe existing Apache config uses some additional modules to handle some log rewriting for incoming Cloudflare request addresses, and communications from Apache to Python:
Misc Apache configBelow are some things that we may have to address when moving to the new config. I'm sure there are additional Important Details that need to be extracted from the Apache config as well. Custom headers:
Additional file types:
Log format:
File upload caching:
|
Additional aliases we may have to implement:
|
I spent some time trying to get https://github.com/pmac/django-redirect-urls to work as a replacement for some of the redirects, but I could use ~30 minute (time-boxed!) assist from @escattone @pmac or @jgmize. |
Wow, thanks for all of this detailed work @metadave ! I would be happy to assist as much as I am able. |
I'm available tomorrow, will ping you on IRC. |
related: discussion of serving legacy samples from EFS/Kuma here |
excluding the following rewrite rule, which may be leftover from dekiwiki:
https://developer.mozilla.org/index.php doesn't currently do anything. https://github.com/mozilla/kumascript/blob/master/macros/NotFound.ejs#L16 |
As noted in mdn/kuma#4215, this rewrite remains unimplemented:
|
TODO:
|
thanks, that list looks pretty simple. I'll get to that in the AM.
|
Tracked for MDN in Bugzilla |
Do we need to also implement rewrites from https://github.com/mozilla/kuma/blob/master/configs/htaccess ? |
:sigh: Looks like it is active in production:
I'll leave it up to you if you add more to this PR or finish this one and open a second. |
Some of those rules are a bit more complicated, I suppose I'll follow up in a later PR. |
Closing this for now, followup rewrites will occur here |
Parent issue
Once we have the SCL3 Apache config, determine:
I'll need more info on the Python libs that we use for similar tasks.
The text was updated successfully, but these errors were encountered: