minad / olelo

Wiki with git backend
MIT License
241 stars 44 forks source link

https and apache #81

Closed inktrap closed 11 years ago

inktrap commented 11 years ago

I am running olelo with apache in a shared hosting environment. I am using a htaccess-file to redirect the incoming traffic to localhost and to provide https for olelo (becaues, you know, login-stuff, privacy, …).

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteCond %{ENV:HTTPS} !=on
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
RewriteRule (.*) http://127.0.0.1:4567/$1 [P]

The htaccess creates a base href that is invalid (example: <base href="wiki.foobar.org:443">). The consequence is that neither js, images nor css are working properly.

Where would you go from here?

Everything else is great (and i guess this is a configuration issue and not a bug).

minad commented 11 years ago

I think your configuration is wrong. You have to use either passenger or use apache as proxy:

    ProxyPass / http://localhost:3000/
    ProxyPassReverse / http://localhost:3000/
    ProxyPreserveHost On
    ProxyRequests Off
    <Proxy *>
            Order deny,allow
            Allow from all
    </Proxy>
inktrap commented 11 years ago

Wow! Quick reply!

Sorry, I can't edit the server config or use Virtual Hosts and ProxyPass can't be specified in an .htaccess file. However, I can use rewriting with the P-flag as shown above. This works fine, but not with https. I'll ask my hoster, updates follow.

minad commented 11 years ago

Ok, thank you! I am really not a deployment expert. I never used passenger. I always use proxypass and unicorn/thin.

minad commented 11 years ago

@inktrap: Any progress here?