Forum

405 Method Not Allowed

Gour
8 February 2015, 14:28
Hello,

I'm trying to serve Fossil repositories in shared hosting environment where Hiawatha is working behind reverse-proxy (nginx)...

The CGI script is Fossil binary and it's in my $PATH.

The hiawatha config is:

...
CGIhandler = /path/to/binary/fossil:fsl
CGIextension = fsl


and the config for virtual host is:

# Fossil repos
VirtualHost {
Hostname = fossil.domain.tld
WebsiteRoot = /path/to/the/site
AccessLogfile = /path/to/access.log
ErrorLogfile = /path/to/error.log
ExecuteCGI = yes
StartFile = repo.fsl
EnablePathInfo = yes
}


repo.fsl 'script' contains:

#!/path/to/binary/fossil
repository: /path/to/the/site/repo.fossil


When I try to acces my repo at url [fossil.domain.tld] Hiawatha renders my with this URL:

http://fossil.domain.tld/repo.fsl/index


but the problem is when I try to push from my desktop machine to the remote server's repository:

fossil push --verbose http://userid:password@fossil.domain.tld/path/to/the/site/repo.fossil
Bytes Cards Artifacts Deltas
waiting for server...
server says: 405 Method Not Allowed
Push finished with 877 bytes sent, 863 bytes received


Here is the appropriate log entry:

94.250.191.15|Sun 08 Feb 2015 13:26:43 +0000|405|872||POST /path/to/the/site/repo.fossil/xfer/xfer HTTP/1.0|Host: fossil.domain.tld|X-Forwarded-Host: fossil.domain.tld|X-Forwarded-Server: fossil.domain.tld|X-Forwarded-For: 94.250.191.15|Forwarded-Request-Uri: /path/to/the/site/repo.fossil/xfer/xfer|Http-X-Forwarded-Proto: http|Https: off|X-Forwarded-Proto: http|X-Forwarded-SSL: off|Connection: close|Content-Length: 658|User-Agent: Fossil/1.30 (2015-01-19 13:06:21 [151473ae36])|Content-Type: application/x-fossil


Any idea what might be wrong?

I might try by using system-wide instance of Apache, but I'd like to use Hiawatha for it as it is used for all other sites.



Hiawatha version: 9.11
Operating System: Linux CentOS x86_64
Hugo Leisink
8 February 2015, 14:32
First, don't use CGIhandler and CGIextension for the same extension. Read this HOWTO for further details.

Second, you specified .fsl as a CGI, but the file that gave errors as extension .fossil. Hiawatha doesn't know that extension, so it treats it as a normal file (non-CGI that is). Tell Hiawatha how to handle .fossil via the CGIhandler (or CGIextension) as well.
Gour
8 February 2015, 17:59
First, don't use CGIhandler and CGIextension for the same extension. Read this HOWTO for further details.


That's result of too much experimentation. Fixed.

Second, you specified .fsl as a CGI, but the file that gave errors as extension .fossil. Hiawatha doesn't know that extension, so it treats it as a normal file (non-CGI that is). Tell Hiawatha how to handle .fossil via the CGIhandler (or CGIextension) as well.


This was fixed by using proper URL in push, iow. there is only one CGI extension to be handled and now I put it to 'CGI' instead of 'fsl', while I still use '.fossil' for local repos.

Thanks for helping me find the way.
This topic has been closed.