minad / olelo

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

Deploy on vhost subir using apache+passenger (trailing slash problem) #60

Closed fernandes closed 11 years ago

fernandes commented 13 years ago

Hi Minad,

I deployed olelo to vhost.com/wiki then set base_path: '/wiki' on my config.yml

But when I access /wiki without trailing slash, It returns a #404, so my dirty hack, was add to lib/olelo/application.rb the following lines:

```get '' do
  redirect '/wiki/'
end```

and replicate post '/(:path)', :tail => true do

code block changing the route to post '', :tail => true do

Yeah, I know they are really dirty ;) just made to put the wiki working on my server, but didn't know how to make a decent fix, so here is my suggestion.

Thank you

minad commented 13 years ago

I have deployed it also under /wiki and this works for me. But with unicorn. I will take a look at it.

fernandes commented 13 years ago

If you wanna put two wikis..

You run two unicorns, one in each tcp port and edit apache to proxy it?

Maybe this is a better approach than mine, will try it here and update as soon as a I configure it

minad commented 13 years ago

This is how I do it. I never tried passenger and I use 1.9.2 now.

fernandes commented 13 years ago

unicorn listening on addr=0.0.0.0:8081

and apache config

        ProxyPass         /wiki http://127.0.0.1:8081/wiki
        ProxyPassReverse  /wiki http://127.0.0.1:8081/wiki
        ProxyRequests     Off
<Proxy http://127.0.0.1:8081/wiki/*>
        Order deny,allow
        Allow from all
</Proxy>```


then unicorn detects host address as 127.0.0.1 and redirects me to login page at http://127.0.0.1:8081/wiki/login
fernandes commented 13 years ago

now I got into a infinite loop :/

this is my first deploy of a rack app and using unicorn, but I swear after everything is fixed, to write a deploy wiki page heheh

minad commented 13 years ago

My working configuration

   ProxyPass /wiki http://localhost:5000
    ProxyPassReverse /wiki http://localhost:5000
    ProxyPreserveHost On
    ProxyRequests Off
    <Proxy *>
            Order deny,allow
            Allow from all
    </Proxy>
fernandes commented 13 years ago

now I got into a recursive redirect loop, I checked unicorn log, and its

189.107.106.25 - - [18/Mar/2011 00:44:40] "GET /wiki/login HTTP/1.1" 302 - 0.1762 189.107.106.25 - - [18/Mar/2011 00:44:41] "GET /wiki/login HTTP/1.1" 302 - 0.0134 189.107.106.25 - - [18/Mar/2011 00:44:41] "GET /wiki/login HTTP/1.1" 302 - 0.0126 189.107.106.25 - - [18/Mar/2011 00:44:42] "GET /wiki/login HTTP/1.1" 302 - 0.0132 189.107.106.25 - - [18/Mar/2011 00:44:42] "GET /wiki/login HTTP/1.1" 302 - 0.0128

I re-checked my config.rb and don't know what's happening

(I'm using olelo as a private wiki [enabled private_wiki plugin])

minad commented 13 years ago

I have the private_wiki option enabled too. Did you remove your hack?

fernandes commented 13 years ago

yeah.. re-cloned a new project from github to be sure

minad commented 11 years ago

Closing this one. Please reopen or create a guide if you want to use passenger.