(Resending in plain text due to the HTML scrub mess I caused. SORRY!)

----------------

Hello, fellow Fossil users!
This is my first message on this mailing list, and I'd like to share my log of 
today's struggle.

As the subject says, I just found some weird action of Fossil.
To make long story short, I tried to run Fossil SCGI server with aid of nginx. 
So I put few of my Fossil repositories under `/usr/local/fossil_repositories`, 
gave ownership of `www:www` to that directory, and wrote following 
configuration files: (I referred Fossil wiki article [1] while doing this.)


## /etc/rc.conf
# run nginx upon booting
nginx_enable="YES"
# run Fossil as SCGI server daemon upon booting.
fossil_enable="YES"
fossil_user="www"
fossil_port="53080"
fossil_directory="/usr/local/fossil_repositories/"
fossil_proto="scgi"
fossil_listenall="" #  Leave this empty!!
fossil_notfound="http://fossil.my.example.com/index.html";

## /usr/local/etc/nginx/nginx.conf: Default nginx config file on FreeBSD
http {
    ...
    server {
        listen 80 default_server;
        server_name fossil.my.example.com;

        location / {
            root /usr/local/www/public_html;
            index index.html; # Display the list of ALL Fossil repositories.
        }

        location /my-homepage/ {
            include scgi_params;
            scgi_pass localhost:53080;
            scgi_param SCRIPT_NAME "/my-homepage";
        }
        ...
    }
}


According to service init script, the command got invoked by rc script is: 
`/usr/local/bin/fossil server -P 53080 --scgi --localhost --notfound 
http://fossil.my.example.com/index.html /usr/local/fossil_repositories/`.

After configuring, when I headed http://fossil.my.exmple.com/my-homepage/ I got 
redirected to http://fossil.my.example.com/index.html, which is clearly 
`fossil_notfound` fallback. So I started digging into source code. What I found 
while scheming through main.c is that I can give `--httptrace` command line 
option to any of subcommands. So I added that option, ran Fossil command above 
manually, and got following output on another web browser request:


...
# cgi: REQUEST_URI = [/my-homepage/]
...
# cgi: SCRIPT_NAME = [/my-homepage]
...
# cgi: PATH_INFO = [/]
...


Seems nothing wrong, since the relevant source code [2] says what Fossil 
requires is `SCRIPT_NAME`. Still in question, I ran Fossil HTTP server instead 
of SCGI, and made direct access like this: 
http://fossil.my.example.com:53080/my-homepage/.
This time, I got WORKING Fossil web UI and following trace output:


====== SERVER pid 93606 =======
...
# cgi: REQUEST_URI = [/my-homepage/]
# cgi: SCRIPT_NAME = []
# cgi: PATH_INFO = [/my-homepage/]
...
# repository: [/my-homepage.fossil]
# new PATH_INFO = [/]
# new SCRIPT_NAME = [/my-homepage]
====== SERVER pid 93607 =======
...
# cgi: REQUEST_URI = [/my-homepage/index]
# cgi: SCRIPT_NAME = []
# cgi: PATH_INFO = [/my-homepage/index]
...
# repository: [/my-homepage.fossil]
# new PATH_INFO = [/index]
# new SCRIPT_NAME = [/my-homepage]
# login: [nobody] with capabilities [gjor]


Then I got an idea; how about omitting `SCRIPT_NAME` completely? So I amended 
nginx.conf like this:


location /my-homepage/ {
    include scgi_params;
    scgi_pass localhost:53080;
    scgi_param SCRIPT_NAME ""; # EMPTY!
}


Finally, upon heading http://fossil.my.example.com/my-homepage/, I got WORKING 
Fossil web UI again. Problem solved.

At least I found a detour, I still don't know why this happened though I 
followed Fossil wiki's instruction. Can someone identify the reason please?


p.s. Actually, the true reason of this message is to answer Jon's question [3]:
> How do you run `fossil server` in verbose/debug mode and/or have it log out 
> detailed info?
Use `--httptrace`!


[1]: http://www.fossil-scm.org/fossil/doc/tip/www/server.wiki#scgi 
[2]: 
http://www.fossil-scm.org/fossil/info/76a4af25a1df3fa6c112d09e291c4bba140df662?ln=864
 
[3]: 
http://lists.fossil-scm.org:8080/pipermail/fossil-users/2014-March/015478.html

--
Ardie Hyun Hwang
----------------
email: i...@ardiefox.me
mobile: +82-10-I-AM-ARDIE
_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to