Skip to content
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

add sample Apache configuration #374

Merged
merged 2 commits into from
Oct 23, 2018
Merged

Conversation

anarcat
Copy link
Contributor

@anarcat anarcat commented Aug 30, 2018

Description

This patch updates the documentation to add a configuration snippet
for Apache.

Motivation and Context

This configuration can be used when launching wayback in the default
configuration, which is useful to add stuff like access control,
authentication, or encryption without going through the trouble of
setting up a UWSGI proxy.

The force_scheme configuration wouldn't be necessary if pywb would
support the (de-facto) standard X-Forwarded-Proto header. This is
not, unfortunately, currently the case so the configuration cannot be
only on Apache's side. Note that this is similar to the concerns raised in #314

Types of changes

  • Replay fix (fixes a replay specific issue)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added or updated tests to cover my changes.
  • All new and existing tests passed.

This configuration can be used when launching `wayback` in the default
configuration, which is useful to add stuff like access control,
authentication, or encryption without going through the trouble of
setting up a UWSGI proxy.
@anarcat
Copy link
Contributor Author

anarcat commented Aug 30, 2018

Also note that I've tried to use UWSGI with Apache, but ultimately failed. The procedure I follow, on Debian Buster, was to install the uwsgi-core and uwsgi-plugin-python packages, then run:

uwsgi --plugin python uwsgi.ini

Then, on the server, I tried to configure the proxy with:

ProxyPass "/" "uwsgi://localhost:8080/"
ProxyPassReverse "/" "uwsgi://localhost:8080/"

It yielded a 500 internal server error after a ~10 seconds time, without anything particular in the logs, on the server or uwsgi side. Not sure what's up with that...

@codecov
Copy link

codecov bot commented Aug 30, 2018

Codecov Report

Merging #374 into master will increase coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #374      +/-   ##
==========================================
+ Coverage   87.56%   87.59%   +0.02%     
==========================================
  Files          59       59              
  Lines        7078     7078              
  Branches     1253     1253              
==========================================
+ Hits         6198     6200       +2     
+ Misses        594      593       -1     
+ Partials      286      285       -1
Impacted Files Coverage Δ
pywb/manager/autoindex.py 91.13% <0%> (+2.53%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a52fdee...c0ca0bc. Read the comment docs.

@ikreymer
Copy link
Member

Apologies for long delay in response.

The way to integrate uwsgi with Apache would be to set it up with: https://uwsgi-docs.readthedocs.io/en/latest/Apache.html
This should also allow for setting the scheme correctly.
(uWSGI uses the 'uwsgi' protocol so a regular reverse proxy will not work).

You are correct that a direct reverse proxy will just work with just the standard wayback (using the gevent wsgi server).

We can add support for X-Forwarded-Proto (and the newer Forwarded header) and then this can be merged with better instructions, otherwise one has to switch the force_scheme option based on whether using http or https.

(It is not clear if X-Forwarded-Proto would work for the op in #314 but will follow up).

@anarcat
Copy link
Contributor Author

anarcat commented Oct 23, 2018

i'm not sure what to do with this - do you want me to make changes to the patch?

@ikreymer
Copy link
Member

@anarcat yes, I'm adding support for X-Forwarded-Proto header and deprecating force_https in #395 so can probably remove that and believe this should work:

RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME}
``

@anarcat
Copy link
Contributor Author

anarcat commented Oct 23, 2018

okay, i've tweaked the docs to follow #395, so I guess this can be merged when the other lands.

@anarcat
Copy link
Contributor Author

anarcat commented Oct 23, 2018

and for the record, I just couldn't quite figure out how to make pywb work uwsgi with uwsgi. i don't have time right now to dig deeper into that, but it would be useful to have a better, step-by-step set of instructions on how to set that up instead of just delegating this to the (rather huge) uwsgi documentation. :)

thanks!

ikreymer added a commit that referenced this pull request Oct 23, 2018
@ikreymer ikreymer merged commit 40f904a into webrecorder:master Oct 23, 2018
ikreymer added a commit that referenced this pull request Oct 23, 2018
@anarcat anarcat deleted the patch-1 branch October 23, 2018 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants