Discussion:
Fossil on IIS
(too old to reply)
Tony Perovic
2011-03-01 21:57:52 UTC
Permalink
Anybody get Fossil working as a "CGI script" on Microsoft Server 2003 / IIS?

I'm trying to access multiple repositories with one script as described at:
http://www.fossil-scm.org/index.html/doc/trunk/www/server.wiki

Learned more than I ever wanted to know about IIS/CGI/Scripting.

[cid:***@01CBD829.6BEE9E10]

TONY PEROVIC

***@compumation.com<mailto:***@compumation.com>
www.compumation.com

205 W. Grand Ave., Ste. 121
Bensenville, IL 60106
630-860-1921 Phone
630-860-1928 Fax
Richard Hipp
2011-03-01 22:05:13 UTC
Permalink
Anybody get Fossil working as a “CGI script” on Microsoft Server 2003 /
IIS?
http://www.fossil-scm.org/index.html/doc/trunk/www/server.wiki
Learned more than I ever wanted to know about IIS/CGI/Scripting.
Please share lessons learned once you figure this out, so that I can update
the document you reference above. Tnx.
*TONY PEROVIC*
www.compumation.com
205 W. Grand Ave., Ste. 121
Bensenville, IL 60106
630-860-1921 Phone
630-860-1928 Fax
_______________________________________________
fossil-users mailing list
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
--
D. Richard Hipp
***@sqlite.org
Tony Perovic
2011-03-04 22:27:44 UTC
Permalink
This is what I've got:

- All our project files area stored on a shared file server (Windows Server 2003)
- We have multiple clients
- Clients have one or more projects
- Clients could have multiple locations
- Projects could have one or more subprojects
- Each client/location/project/subproject has a folder
- Each project or subproject will have a Fossil repository on the server
- Each repository will be kept in the appropriate project or subproject folder

Here is an example directory structure on the file server:

\Projects
\Client1 (This client has multiple locations)
\Location1
\Project1 (This project has subprojects)
\Subproject1
\Subproject2
\Subproject3
\Project2 (This project has no subprojects)
\Project3 (This project has no subprojects)
...
\Location2
...
\Location3
...
\Client2 (This client has only one location)
\Project1
\Project2
\Project3
...
\Client3
...

Clearly, all the Fossil repositories will not be stored in the same folder. I'm testing a Perl script that'll sort it all out and invoke Fossil using CGI as required. Almost there. One last hurdle:

The script generates a Fossil.cgi file dynamically, as needed, per repository, then invokes Fossil. The initial CGI file looks like this:

#!\Program Files\Fossil\Fossil
repository: \Projects\Client\Location\Project\repository.fossil

Subsequently, the browser comes back asking for resources referenced in the resulting HTML:

<img src="/cgi-bin/Fossil.pl/logo" alt="logo" />

It's obviously asking for the logo within the repository it just accessed.

Q: How should the CGI script invoke Fossil to request these internal resources?

I tried:

#!\Program Files\Fossil\Fossil
repository: \Projects\Client\Location\Project\repository.fossil/logo

without success.

Please advise.

[cid:***@01CBDA88.AE35A5F0]

TONY PEROVIC

***@compumation.com<mailto:***@compumation.com>
www.compumation.com

205 W. Grand Ave., Ste. 121
Bensenville, IL 60106
630-860-1921 Phone
630-860-1928 Fax
Lluís Batlle i Rossell
2011-03-04 22:44:44 UTC
Permalink
Post by Tony Perovic
Q: How should the CGI script invoke Fossil to request these internal resources?
The CGI is quite a defined interface, telling any query information through
environment variables, and expecting any answer in stdout.
Tony Perovic
2011-03-07 21:32:05 UTC
Permalink
Got it!!!



I created a virtual directory that redirects all requests to a Perl script that takes CGI requests like this:



http://myserver/Fossil/Projects/.../project.fossil



generates a Fossil CGI script (Fossil.cgi):



#!\Program Files\Fossil\Fossil

repository: \Projects\...\myrepository.fossil



then invokes Fossil:



Fossil \...\Fossil.cgi



Fossil returns HTML containing references to resources in the repository like this:



<img src="/Fossil/.../myrepository.fossil/logo" alt="logo" />



The browser requests each resource as:



http://myserver/Fossil/.../myrepository.fossil/logo



The Perl script parses each resource request into repository name and the resource (ex. /logo), recreates the Fossil.cgi, sets the CGI environmental variables then invokes Fossil:



PATH_INFO=/logo



Whew!



Tony Perovic

Compumation, Inc.



-----Original Message-----

From: fossil-users-***@lists.fossil-scm.org [mailto:fossil-users-***@lists.fossil-scm.org] On Behalf Of Lluís Batlle i Rossell

Sent: Friday, March 04, 2011 4:45 PM

To: fossil-***@lists.fossil-scm.org

Subject: Re: [fossil-users] Fossil on IIS
Post by Tony Perovic
Q: How should the CGI script invoke Fossil to request these internal resources?
The CGI is quite a defined interface, telling any query information through

environment variables, and expecting any answer in stdout.



_______________________________________________

fossil-users mailing list

fossil-***@lists.fossil-scm.org

http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Tony Perovic
2011-03-18 16:01:09 UTC
Permalink
I'm having trouble with the Login page on IIS/CGI....

I wrote a Perl script that accepts Fossil requests like this:

http://myserver/cgi-bin/Fossil.pl?repository=\Projects\...\Test.fossil


It generates a CGI script (Fossil.cgi):



#! Fossil

repository: \Projects\...\Test.fossil



then invokes Fossil and logs the output:



$output = `Fossil.exe Fossil.cgi`

print $output

log $output

It also creates a cookie that used for subsequent page requests:

Set-Cookie: repository=\Projects\...\Test.fossil

Now the Login page URL looks like this:

http://myserver/cgi-bin/Fossil.pl/login

Using Fill out captcha and clicking the Login button generates the following HTTP request:

POST /cgi-bin/Fossil.pl/login HTTP/1.1
Host: vserver1
Connection: keep-alive
Referer: http://myserver/cgi-bin/Fossil.pl/login
Content-Length: 45
Cache-Control: max-age=0
Origin: http://myserver
Content-Type: application/x-www-form-urlencoded
Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: repository=\Projects\Test\Test.fossil

u=anonymous&p=c22b0422&in=Login&cs=1403348019

Fossil reponds with:

Status: 302 Moved Temporarily
Set-Cookie: fossil_login_b213c069=anon%2F2455639.13208575%2F3590e822388f03d7bd4897801ec42b0a7d5e88b6; Path=/cgi-bin/Fossil.pl; expires=Fri, 18 Mar 2011 21:10:12 GMT; Version=1
Location: /cgi-bin/Fossil.pl/index
Cache-control: no-cache, no-store
Content-Type: text/html; charset=utf-8
Content-Length: 59

<html>
<p>Redirect to /cgi-bin/Fossil.pl/index</p>
</html>

Which should display the Home page logged in as Anonymous but, instead, the browser receives:

HTTP/1.1 200 OK
Cache-Control: no-cache, no-store
Content-Length: 1305
Content-Type: text/html; charset=utf-8
Server: Microsoft-IIS/6.0
Date: Fri, 18 Mar 2011 15:10:12 GMT

<!DOCTYPE html><html>
<head>
<title>Unnamed Fossil Project: Home</title>
<link rel="alternate" type="application/rss+xml" title="RSS Feed"
href="/cgi-bin/Fossil.pl/timeline.rss" />
<link rel="stylesheet" href="/cgi-bin/Fossil.pl/style.css?default" type="text/css"
media="screen" />
</head>
<body>
<div class="header">
<div class="logo">
<img src="/cgi-bin/Fossil.pl/logo" alt="logo" />
</div>
<div class="title"><small>Unnamed Fossil Project</small><br />Home</div>
<div class="status">Not logged in</div>
</div>
<div class="mainmenu"><a href='/cgi-bin/Fossil.pl/home'>Home</a> <a href='/cgi-bin/Fossil.pl/timeline'>Timeline</a> <a href='/cgi-bin/Fossil.pl/brlist'>Branches</a> <a href='/cgi-bin/Fossil.pl/taglist'>Tags</a> <a href='/cgi-bin/Fossil.pl/reportlist'>Tickets</a> <a href='/cgi-bin/Fossil.pl/wiki'>Wiki</a> <a href='/cgi-bin/Fossil.pl/login'>Login</a> </div>
<div class="content">
<p>This is a stub home-page for the project.
To fill in this page, first go to
<a href="/cgi-bin/Fossil.pl/setup_config">setup/config</a>
and establish a "Project Name". Then create a
wiki page with that name. The content of that wiki page
will be displayed in place of this message.</p>
</div>
<div class="footer">
Fossil version [1d93222627] 2011-03-01 19:04

This is the Home page but I'm not logged in because I never got the login cookie Fossil sent.

I realize this is probably an IIS question more than a Fossil question but I'm hoping somebody out there got this working on IIS 6.0 or can at least point me in the right direction.

Switching from IIS to Linux is not an option. The web server is what it is.

Thank you,
Tony Perovic
Compumation, Inc.
Tony Perovic
2011-03-22 15:23:11 UTC
Permalink
Apparently, the Fossil Login with never work with IIS 6.0:
http://support.microsoft.com/kb/176113

Tony Perovic
Compumation, Inc.
________________________________
From: Tony Perovic
Sent: Friday, March 18, 2011 11:01 AM
To: 'fossil-***@lists.fossil-scm.org'
Subject: RE: [fossil-users] Fossil on IIS

I'm having trouble with the Login page on IIS/CGI....

I wrote a Perl script that accepts Fossil requests like this:

http://myserver/cgi-bin/Fossil.pl?repository=\Projects\...\Test.fossil


It generates a CGI script (Fossil.cgi):



#! Fossil

repository: \Projects\...\Test.fossil



then invokes Fossil and logs the output:



$output = `Fossil.exe Fossil.cgi`

print $output

log $output

It also creates a cookie that used for subsequent page requests:

Set-Cookie: repository=\Projects\...\Test.fossil

Now the Login page URL looks like this:

http://myserver/cgi-bin/Fossil.pl/login

Using Fill out captcha and clicking the Login button generates the following HTTP request:

POST /cgi-bin/Fossil.pl/login HTTP/1.1
Host: vserver1
Connection: keep-alive
Referer: http://myserver/cgi-bin/Fossil.pl/login
Content-Length: 45
Cache-Control: max-age=0
Origin: http://myserver
Content-Type: application/x-www-form-urlencoded
Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: repository=\Projects\Test\Test.fossil

u=anonymous&p=c22b0422&in=Login&cs=1403348019

Fossil reponds with:

Status: 302 Moved Temporarily
Set-Cookie: fossil_login_b213c069=anon%2F2455639.13208575%2F3590e822388f03d7bd4897801ec42b0a7d5e88b6; Path=/cgi-bin/Fossil.pl; expires=Fri, 18 Mar 2011 21:10:12 GMT; Version=1
Location: /cgi-bin/Fossil.pl/index
Cache-control: no-cache, no-store
Content-Type: text/html; charset=utf-8
Content-Length: 59

<html>
<p>Redirect to /cgi-bin/Fossil.pl/index</p>
</html>

Which should display the Home page logged in as Anonymous but, instead, the browser receives:

HTTP/1.1 200 OK
Cache-Control: no-cache, no-store
Content-Length: 1305
Content-Type: text/html; charset=utf-8
Server: Microsoft-IIS/6.0
Date: Fri, 18 Mar 2011 15:10:12 GMT

<!DOCTYPE html><html>
<head>
<title>Unnamed Fossil Project: Home</title>
<link rel="alternate" type="application/rss+xml" title="RSS Feed"
href="/cgi-bin/Fossil.pl/timeline.rss" />
<link rel="stylesheet" href="/cgi-bin/Fossil.pl/style.css?default" type="text/css"
media="screen" />
</head>
<body>
<div class="header">
<div class="logo">
<img src="/cgi-bin/Fossil.pl/logo" alt="logo" />
</div>
<div class="title"><small>Unnamed Fossil Project</small><br />Home</div>
<div class="status">Not logged in</div>
</div>
<div class="mainmenu"><a href='/cgi-bin/Fossil.pl/home'>Home</a> <a href='/cgi-bin/Fossil.pl/timeline'>Timeline</a> <a href='/cgi-bin/Fossil.pl/brlist'>Branches</a> <a href='/cgi-bin/Fossil.pl/taglist'>Tags</a> <a href='/cgi-bin/Fossil.pl/reportlist'>Tickets</a> <a href='/cgi-bin/Fossil.pl/wiki'>Wiki</a> <a href='/cgi-bin/Fossil.pl/login'>Login</a> </div>
<div class="content">
<p>This is a stub home-page for the project.
To fill in this page, first go to
<a href="/cgi-bin/Fossil.pl/setup_config">setup/config</a>
and establish a "Project Name". Then create a
wiki page with that name. The content of that wiki page
will be displayed in place of this message.</p>
</div>
<div class="footer">
Fossil version [1d93222627] 2011-03-01 19:04

This is the Home page but I'm not logged in because I never got the login cookie Fossil sent.

I realize this is probably an IIS question more than a Fossil question but I'm hoping somebody out there got this working on IIS 6.0 or can at least point me in the right direction.

Switching from IIS to Linux is not an option. The web server is what it is.

Thank you,
Tony Perovic
Compumation, Inc.
Richard Hipp
2011-03-22 16:02:18 UTC
Permalink
Post by Tony Perovic
http://support.microsoft.com/kb/176113
Do I understand that the bug in question has been fixed in IIS 7.0 and that
upgrading to IIS 7.0 will fix the issue?
Post by Tony Perovic
Tony Perovic
Compumation, Inc.
------------------------------
*From:* Tony Perovic
*Sent:* Friday, March 18, 2011 11:01 AM
*Subject:* RE: [fossil-users] Fossil on IIS
I’m having trouble with the Login page on IIS/CGI….
http://myserver/cgi-bin/Fossil.pl?repository=\Projects\...\Test.fossil
#! Fossil
repository: \Projects\...\Test.fossil
$output = `Fossil.exe Fossil.cgi`
print $output
log $output
Set-Cookie: repository=\Projects\...\Test.fossil
http://myserver/cgi-bin/Fossil.pl/login
POST /cgi-bin/Fossil.pl/login HTTP/1.1
Host: vserver1
Connection: keep-alive
Referer: http://myserver/cgi-bin/Fossil.pl/login
Content-Length: 45
Cache-Control: max-age=0
Origin: http://myserver
Content-Type: application/x-www-form-urlencoded
application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: repository=\Projects\Test\Test.fossil
u=anonymous&p=c22b0422&in=Login&cs=1403348019
Status: 302 Moved Temporarily
fossil_login_b213c069=anon%2F2455639.13208575%2F3590e822388f03d7bd4897801ec42b0a7d5e88b6;
Path=/cgi-bin/Fossil.pl; expires=Fri, 18 Mar 2011 21:10:12 GMT; Version=1
Location: /cgi-bin/Fossil.pl/index
Cache-control: no-cache, no-store
Content-Type: text/html; charset=utf-8
Content-Length: 59
<html>
<p>Redirect to /cgi-bin/Fossil.pl/index</p>
</html>
Which should display the Home page logged in as Anonymous but, instead, the
HTTP/1.1 200 OK
Cache-Control: no-cache, no-store
Content-Length: 1305
Content-Type: text/html; charset=utf-8
Server: Microsoft-IIS/6.0
Date: Fri, 18 Mar 2011 15:10:12 GMT
<!DOCTYPE html><html>
<head>
<title>Unnamed Fossil Project: Home</title>
<link rel="alternate" type="application/rss+xml" title="RSS Feed"
href="/cgi-bin/Fossil.pl/timeline.rss" />
<link rel="stylesheet" href="/cgi-bin/Fossil.pl/style.css?default" type="text/css"
media="screen" />
</head>
<body>
<div class="header">
<div class="logo">
<img src="/cgi-bin/Fossil.pl/logo" alt="logo" />
</div>
<div class="title"><small>Unnamed Fossil Project</small><br />Home</div>
<div class="status">*Not logged in*</div>
</div>
<div class="mainmenu"><a href='/cgi-bin/Fossil.pl/home'>Home</a> <a
href='/cgi-bin/Fossil.pl/timeline'>Timeline</a> <a
href='/cgi-bin/Fossil.pl/brlist'>Branches</a> <a
href='/cgi-bin/Fossil.pl/taglist'>Tags</a> <a
href='/cgi-bin/Fossil.pl/reportlist'>Tickets</a> <a
href='/cgi-bin/Fossil.pl/wiki'>Wiki</a> <a
href='/cgi-bin/Fossil.pl/login'>Login</a> </div>
<div class="content">
<p>This is a stub home-page for the project.
To fill in this page, first go to
<a href="/cgi-bin/Fossil.pl/setup_config">setup/config</a>
and establish a "Project Name". Then create a
wiki page with that name. The content of that wiki page
will be displayed in place of this message.</p>
</div>
<div class="footer">
Fossil version [1d93222627] 2011-03-01 19:04
This is the Home page but I’m not logged in because I never got the login
cookie Fossil sent.
I realize this is probably an IIS question more than a Fossil question but
I’m hoping somebody out there got this working on IIS 6.0 or can at least
point me in the right direction.
Switching from IIS to Linux is not an option. The web server is what it is.
Thank you,
Tony Perovic
Compumation, Inc.
_______________________________________________
fossil-users mailing list
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
--
D. Richard Hipp
***@sqlite.org
Tony Perovic
2011-03-22 19:08:24 UTC
Permalink
Yes but, upgrading to IIS 7.x involves upgrading the server to Windows Server 2008. Not exactly a walk in the park. I think I'll setup a virtual machine with Windows Server 2008 and test it there before suggesting a server upgrade. I'll post the results in a couple days.

Thanks,
Tony Perovic
Compumation, Inc.
________________________________
From: fossil-users-***@lists.fossil-scm.org [mailto:fossil-users-***@lists.fossil-scm.org] On Behalf Of Richard Hipp
Sent: Tuesday, March 22, 2011 11:02 AM
To: fossil-***@lists.fossil-scm.org
Subject: Re: [fossil-users] Fossil on IIS


On Tue, Mar 22, 2011 at 11:23 AM, Tony Perovic <***@compumation.com<mailto:***@compumation.com>> wrote:
Apparently, the Fossil Login with never work with IIS 6.0:
http://support.microsoft.com/kb/176113

Do I understand that the bug in question has been fixed in IIS 7.0 and that upgrading to IIS 7.0 will fix the issue?


--
D. Richard Hipp
***@sqlite.org<mailto:***@sqlite.org>
Tony Perovic
2011-03-23 19:10:22 UTC
Permalink
Same shit with IIS 7.5. Good news is that I won't have to upgrade the server. I'll have script around it somehow.

So, clicking the Login button on the Login page returns this:

Status: 302 Moved Temporarily
Set-Cookie: fossil_login_3213c06d=anon%2F2455644... Path=/Fossil/Fossil.pl; expires=Wed, 23 Mar 2011 23:51:39 GMT; Version=1
Location: /Fossil/Fossil.pl/index
Cache-control: no-cache, no-store
Content-Type: text/html; charset=utf-8
Content-Length: 58

<html>
<p>Redirect to /Fossil/Fossil.pl/index</p>
</html>

The browser never gets it. Instead, IIS redirects automatically but forgets to pass the cookie.

Wouldn't this suffice?

Status: 302 Moved Temporarily
Set-Cookie: fossil_login_3213c06d=anon%2F2455644...; Path=/Fossil/Fossil.pl; expires=Wed, 23 Mar 2011 23:51:39 GMT; Version=1
Location: /Fossil/Fossil.pl/index

All it needs to do is create the login cookie and redirect to the home page. In fact, that's probably how I'll script it assuming that IIS doesn't try to outsmart itself again.

Tony Perovic
Compumation, Inc.
________________________________
From: Tony Perovic
Sent: Tuesday, March 22, 2011 2:08 PM
To: 'fossil-***@lists.fossil-scm.org'
Subject: RE: [fossil-users] Fossil on IIS

Yes but, upgrading to IIS 7.x involves upgrading the server to Windows Server 2008. Not exactly a walk in the park. I think I'll setup a virtual machine with Windows Server 2008 and test it there before suggesting a server upgrade. I'll post the results in a couple days.

Thanks,
Tony Perovic
Compumation, Inc.
________________________________
From: fossil-users-***@lists.fossil-scm.org [mailto:fossil-users-***@lists.fossil-scm.org] On Behalf Of Richard Hipp
Sent: Tuesday, March 22, 2011 11:02 AM
To: fossil-***@lists.fossil-scm.org
Subject: Re: [fossil-users] Fossil on IIS


On Tue, Mar 22, 2011 at 11:23 AM, Tony Perovic <***@compumation.com<mailto:***@compumation.com>> wrote:
Apparently, the Fossil Login with never work with IIS 6.0:
http://support.microsoft.com/kb/176113

Do I understand that the bug in question has been fixed in IIS 7.0 and that upgrading to IIS 7.0 will fix the issue?

--
D. Richard Hipp
***@sqlite.org<mailto:***@sqlite.org>
Tony Perovic
2011-03-24 21:03:48 UTC
Permalink
My Perl script checks the HTTP output from Fossil looking for Redirect and Set-Cookie and replaces it with this:

Status: 200 OK
Set-Cookie: fossil_login_3213c06d= anon%2F2455644; Path=/Fossil/Fossil.pl; Version=1
Cache-control: no-cache, no-store
Content-Type: text/html; charset=utf-8
Content-Length: 192

<html>
<title>Fossil</title>
<body>
<h1>Login/Logout Successul</h1>
<form name="Continue" action="/Fossil/Fossil.pl/index" method="get">
<input type="submit" value="Continue" />
</form>
</body>
</html>

This page says "Login Successful" or "Logout Successful" depending on whether the cookie is getting set or cleared and it contains a Continue button.

I just needed to separate the redirection from the Set-Cookie. Now I can login, logout and jump around page-to-page. Hurray!!!

This bug has been lurking in IIS since 3.0. Pathetic.

Q: Are there any other pages, other than Login/Logout, where Fossil attempts to redirect and set a cookie all at once?

Tony Perovic
Compumation, Inc.
________________________________
From: Tony Perovic
Sent: Wednesday, March 23, 2011 2:10 PM
To: 'fossil-***@lists.fossil-scm.org'
Subject: RE: [fossil-users] Fossil on IIS

Same shit with IIS 7.5. Good news is that I won't have to upgrade the server. I'll have script around it somehow.

So, clicking the Login button on the Login page returns this:

Status: 302 Moved Temporarily
Set-Cookie: fossil_login_3213c06d=anon%2F2455644... Path=/Fossil/Fossil.pl; expires=Wed, 23 Mar 2011 23:51:39 GMT; Version=1
Location: /Fossil/Fossil.pl/index
Cache-control: no-cache, no-store
Content-Type: text/html; charset=utf-8
Content-Length: 58

<html>
<p>Redirect to /Fossil/Fossil.pl/index</p>
</html>

The browser never gets it. Instead, IIS redirects automatically but forgets to pass the cookie.

Wouldn't this suffice?

Status: 302 Moved Temporarily
Set-Cookie: fossil_login_3213c06d=anon%2F2455644...; Path=/Fossil/Fossil.pl; expires=Wed, 23 Mar 2011 23:51:39 GMT; Version=1
Location: /Fossil/Fossil.pl/index

All it needs to do is create the login cookie and redirect to the home page. In fact, that's probably how I'll script it assuming that IIS doesn't try to outsmart itself again.

Tony Perovic
Compumation, Inc.
________________________________
From: Tony Perovic
Sent: Tuesday, March 22, 2011 2:08 PM
To: 'fossil-***@lists.fossil-scm.org'
Subject: RE: [fossil-users] Fossil on IIS

Yes but, upgrading to IIS 7.x involves upgrading the server to Windows Server 2008. Not exactly a walk in the park. I think I'll setup a virtual machine with Windows Server 2008 and test it there before suggesting a server upgrade. I'll post the results in a couple days.

Thanks,
Tony Perovic
Compumation, Inc.
________________________________
From: fossil-users-***@lists.fossil-scm.org [mailto:fossil-users-***@lists.fossil-scm.org] On Behalf Of Richard Hipp
Sent: Tuesday, March 22, 2011 11:02 AM
To: fossil-***@lists.fossil-scm.org
Subject: Re: [fossil-users] Fossil on IIS


On Tue, Mar 22, 2011 at 11:23 AM, Tony Perovic <***@compumation.com<mailto:***@compumation.com>> wrote:
Apparently, the Fossil Login with never work with IIS 6.0:
http://support.microsoft.com/kb/176113

Do I understand that the bug in question has been fixed in IIS 7.0 and that upgrading to IIS 7.0 will fix the issue?

--
D. Richard Hipp
***@sqlite.org<mailto:***@sqlite.org>
Tony Perovic
2011-03-29 16:40:21 UTC
Permalink
This is driving me nuts......

I created a CGI file for my repository on the server:

Test.cgi:

!#\Program Files\Fossil\Fossil.exe
repository: C:\Projects\Test\Test.fossil

I configured IIS to send *.cgi requests to Fossil.exe then pointed my browser to:

http://myserver/Projects/Test/Test.cgi

I get an unformatted web page (no logo, no css). Snooping with Wireshark shows this exchange:

Request:

GET /Projects/Test/Test.cgi HTTP/1.1
Host: myserver
Connection: keep-alive
Cache-Control: max-age=0
Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.224 Safari/534.10
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3

Reponse:

HTTP/1.1 200 OK
Cache-Control: no-cache, no-store
Content-Length: 1360
Content-Type: text/html; charset=utf-8
Server: Microsoft-IIS/6.0
Date: Tue, 29 Mar 2011 14:49:39 GMT

<!DOCTYPE html><html>
<head>
<title>Unnamed Fossil Project: Home</title>
<link rel="stylesheet" href="/Projects/Test/Test.cgi/style.css?default" type="text/css" media="screen" />
.......
</head>
<body>
<div class="header">
<div class="logo">
<img src="/Projects/Test/Test.cgi/logo" alt="logo" />
</div>
<div class="title"><small>Unnamed Fossil Project</small><br />Home</div>
<div class="status">Not logged in</div>
</div>
.....
</html>

Request:

GET /Projects/Test/Test.cgi/style.css?default HTTP/1.1
Host: myserver
Connection: keep-alive
Referer: http://myserver/Projects/Test/Test.cgi
Cache-Control: max-age=0
Accept: text/css,*/*;q=0.1
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.224 Safari/534.10
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3

Reponse:

HTTP/1.1 200 OK
....
<head>
<title>Unnamed Fossil Project: Home</title>
.......
</html>

Request:

GET / Projects/Test/Test.cgi/logo HTTP/1.1
Host: myserver
Connection: keep-alive
Referer: http://myserver/Projects/Test/Test.cgi
Cache-Control: max-age=0
Accept: text/css,*/*;q=0.1
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.224 Safari/534.10
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3

Reponse:

HTTP/1.1 200 OK
....
<head>
<title>Unnamed Fossil Project: Home</title>
.......
</html>

Yeah, that's right; I got the home page again and again. By trial and error I found that the requests should be:

GET /style.css?default HTTP/1.1
GET /logo HTTP/1.1

It seems that Fossil uses the PATH_INFO to construct its reply in CGI mode. I achieved the correct results by writing a Perl script that strips the SCRIPT_NAME portion from the PATH_INFO environment variable before invoking Fossil:

$path = $ENV{"PATH_INFO"};
$script = $ENV{"SCRIPT_NAME"};

if ($path =~ m/^$script/) { # PATH_INFO starts with SCRIPT_NAME?
$ENV{"PATH_INFO"} = substr($path, length($script));
}

All Fossil / CGI requests must be processed through this Perl script. Thus, I concluded, Fossil/CGI cannot possibly work on Windows/IIS without scripting.

Q: Is this correct? Am I missing something?

In fact, given the above analysis, it shouldn't work in Linux either, yet, (I assume) it does.

Q: Can somebody please explain what is or isn't happening in Linux that is or isn't happening in Windows/IIS?

Tony Perovic
Compumation, Inc.
________________________________
From: fossil-users-***@lists.fossil-scm.org [mailto:fossil-users-***@lists.fossil-scm.org] On Behalf Of Tony Perovic
Sent: Tuesday, March 01, 2011 3:58 PM
To: 'fossil-***@lists.fossil-scm.org'
Subject: [fossil-users] Fossil on IIS

Anybody get Fossil working as a "CGI script" on Microsoft Server 2003 / IIS?

I'm trying to access multiple repositories with one script as described at:
http://www.fossil-scm.org/index.html/doc/trunk/www/server.wiki

Learned more than I ever wanted to know about IIS/CGI/Scripting.

[cid:***@01CBEE05.FBC6AD60]

TONY PEROVIC

***@compumation.com<mailto:***@compumation.com>
www.compumation.com

205 W. Grand Ave., Ste. 121
Bensenville, IL 60106
630-860-1921 Phone
630-860-1928 Fax
Richard Hipp
2011-03-29 17:37:40 UTC
Permalink
This is driving me nuts……
It seems that Fossil uses the PATH_INFO to construct its reply in CGI mode.
I achieved the correct results by writing a Perl script that strips the
SCRIPT_NAME portion from the PATH_INFO environment variable before invoking
$path = $ENV{"PATH_INFO"};
$script = $ENV{"SCRIPT_NAME"};
if ($path =~ m/^$script/) { # PATH_INFO starts with SCRIPT_NAME?
$ENV{"PATH_INFO"} = substr($path, length($script));
}
All Fossil / CGI requests must be processed through this Perl script. Thus,
I concluded, Fossil/CGI cannot possibly work on Windows/IIS without
scripting.
Fossil assumes that PATH_INFO and SCRIPT_NAME are set up as described in
RFC3875. If what you say is correct, ISS appears not to follow RFC3875 and
hence does not really support CGI, but rather something that is merely
CGI-like.
Q: Is this correct? Am I missing something?
In fact, given the above analysis, it shouldn’t work in Linux either, yet,
(I assume) it does.
The main Fossil website (http://www.fossil-scm.org/) is just an instance of
Fossil running on a Linux box as CGI. See
http://www.fossil-scm.org/fossil/doc/trunk/www/selfhost.wiki for additional
information, including the scripts used to enable CGI on the various Fossil
mirrors.
Q: Can somebody please explain what is or isn’t happening in Linux that is
or isn’t happening in Windows/IIS?
Reminds me of a haiku I read years ago:

Yesterday it worked.
Today it is not working.
Windows is like that.
Tony Perovic
Compumation, Inc.
------------------------------
*Sent:* Tuesday, March 01, 2011 3:58 PM
*Subject:* [fossil-users] Fossil on IIS
Anybody get Fossil working as a “CGI script” on Microsoft Server 2003 /
IIS?
http://www.fossil-scm.org/index.html/doc/trunk/www/server.wiki
Learned more than I ever wanted to know about IIS/CGI/Scripting.
*TONY PEROVIC*
www.compumation.com
205 W. Grand Ave., Ste. 121
Bensenville, IL 60106
630-860-1921 Phone
630-860-1928 Fax
_______________________________________________
fossil-users mailing list
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
--
D. Richard Hipp
***@sqlite.org
Tony Perovic
2011-03-29 18:14:08 UTC
Permalink
Richard Hipp
2011-03-29 18:20:59 UTC
Permalink
On Tue, Mar 29, 2011 at 2:14 PM, Tony Perovic <***@compumation.com>wrote:
Tony Perovic
2011-03-29 20:39:57 UTC
Permalink
IIS/CGI sets the following environmental variable:
SERVER_SOFTWARE=Microsoft-IIS/6.0
So you could look for that.

IIS has another bug that prevents Set-Cookie and Redirection within the same HTTP response. IIS tries to be efficient by executing the redirection without involving the browser but fails to pass along the cookie so the Login/Logout pages don't work. I had to script around that too. Now that I've got all that worked out I'm battling the Active Directory security model. Painful.

Are you sure you want to start modifying Fossil to compensate for IIS idiosyncrasies (bugs)? Judging by the lack of responses I've gotten, I don't think there are too many Fossil on IIS/CGI users out there. A Wiki page with detailed instructions might suffice.

Regards,
Tony Perovic
Compumation, Inc.
________________________________
From: fossil-users-***@lists.fossil-scm.org [mailto:fossil-users-***@lists.fossil-scm.org] On Behalf Of Richard Hipp
Sent: Tuesday, March 29, 2011 1:21 PM
To: fossil-***@lists.fossil-scm.org
Subject: Re: [fossil-users] Fossil on IIS


On Tue, Mar 29, 2011 at 2:14 PM, Tony Perovic <***@compumation.com<mailto:***@compumation.com>> wrote:
Ron Wilson
2011-03-29 21:10:30 UTC
Permalink
Post by Tony Perovic
IIS has another bug that prevents Set-Cookie and Redirection within the
same HTTP response. IIS tries to be efficient by executing the redirection
without involving the browser but fails to pass along the cookie so the
Login/Logout pages don’t work. I had to script around that too.
Seems to me that a meta reload HTML tag could be used, assuming IIS doesn't
mess with that, too. I have seen many websites that display a login-succeded
page that automatically loads the target page after a very short delay. I
assume this is done via meta reload.
Tony Perovic
2011-03-29 21:39:16 UTC
Permalink
I'm not familiar with the HTML meta reload tag...I had to google it.

Clicking the Login button, Fossil outputs this:

Status: 302 Moved Temporarily
Set-Cookie: fossil_login_3213c06d=anon%2F2455644... Path: /Projects/Test/Test.fossil; expires=Wed, 23 Mar 2011 23:51:39 GMT; Version=1
Location: /Projects/Test/Test.fossil/index
Cache-control: no-cache, no-store
Content-Type: text/html; charset=utf-8
Content-Length: 58

<html>
<p>Redirect to /Fossil/Fossil.pl/index</p>
</html>

My understanding is that the Location directive specifies the redirection. The <html>...</html> is only for Netscape compatibility.

IIS redirects to /Projects/Test/Test.fossil/index but forgets the cookie. Login fails.

So, are you suggesting I change that to:

Status: 302 Moved Temporarily
Set-Cookie: fossil_login_3213c06d=anon%2F2455644... Path: /Projects/Test/Test.fossil; expires=Wed, 23 Mar 2011 23:51:39 GMT; Version=1
Location: /Projects/Test/Test.fossil/index
Cache-control: no-cache, no-store
Content-Type: text/html; charset=utf-8
Content-Length: 109

<html>
<head>
<meta HTTP-EQUIV="REFRESH" content="0; url=/Projects/Test/Test.fossil/index.html"/>
</head>
</html>

Then see if the browser gets the cookie and redirects?

Tony Perovic
Compumation, Inc.
________________________________
From: fossil-users-***@lists.fossil-scm.org [mailto:fossil-users-***@lists.fossil-scm.org] On Behalf Of Ron Wilson
Sent: Tuesday, March 29, 2011 4:11 PM
To: fossil-***@lists.fossil-scm.org
Subject: Re: [fossil-users] Fossil on IIS

On Tue, Mar 29, 2011 at 4:39 PM, Tony Perovic <***@compumation.com<mailto:***@compumation.com>> wrote:
IIS has another bug that prevents Set-Cookie and Redirection within the same HTTP response. IIS tries to be efficient by executing the redirection without involving the browser but fails to pass along the cookie so the Login/Logout pages don't work. I had to script around that too.

Seems to me that a meta reload HTML tag could be used, assuming IIS doesn't mess with that, too. I have seen many websites that display a login-succeded page that automatically loads the target page after a very short delay. I assume this is done via meta reload.
Tony Perovic
2011-03-29 22:08:06 UTC
Permalink
Works with Chrome, but Microsoft Internet Explorer didn't like it.
Now, if I could just get the users to switch....

Tony Perovic
Compumation, Inc.
________________________________
From: Tony Perovic
Sent: Tuesday, March 29, 2011 4:39 PM
To: 'fossil-***@lists.fossil-scm.org'
Subject: RE: [fossil-users] Fossil on IIS

I'm not familiar with the HTML meta reload tag...I had to google it.

Clicking the Login button, Fossil outputs this:

Status: 302 Moved Temporarily
Set-Cookie: fossil_login_3213c06d=anon%2F2455644... Path: /Projects/Test/Test.fossil; expires=Wed, 23 Mar 2011 23:51:39 GMT; Version=1
Location: /Projects/Test/Test.fossil/index
Cache-control: no-cache, no-store
Content-Type: text/html; charset=utf-8
Content-Length: 58

<html>
<p>Redirect to /Fossil/Fossil.pl/index</p>
</html>

My understanding is that the Location directive specifies the redirection. The <html>...</html> is only for Netscape compatibility.

IIS redirects to /Projects/Test/Test.fossil/index but forgets the cookie. Login fails.

So, are you suggesting I change that to:

Status: 302 Moved Temporarily
Set-Cookie: fossil_login_3213c06d=anon%2F2455644... Path: /Projects/Test/Test.fossil; expires=Wed, 23 Mar 2011 23:51:39 GMT; Version=1
Location: /Projects/Test/Test.fossil/index
Cache-control: no-cache, no-store
Content-Type: text/html; charset=utf-8
Content-Length: 109

<html>
<head>
<meta HTTP-EQUIV="REFRESH" content="0; url=/Projects/Test/Test.fossil/index.html"/>
</head>
</html>

Then see if the browser gets the cookie and redirects?

Tony Perovic
Compumation, Inc.
________________________________
From: fossil-users-***@lists.fossil-scm.org [mailto:fossil-users-***@lists.fossil-scm.org] On Behalf Of Ron Wilson
Sent: Tuesday, March 29, 2011 4:11 PM
To: fossil-***@lists.fossil-scm.org
Subject: Re: [fossil-users] Fossil on IIS

On Tue, Mar 29, 2011 at 4:39 PM, Tony Perovic <***@compumation.com<mailto:***@compumation.com>> wrote:
IIS has another bug that prevents Set-Cookie and Redirection within the same HTTP response. IIS tries to be efficient by executing the redirection without involving the browser but fails to pass along the cookie so the Login/Logout pages don't work. I had to script around that too.

Seems to me that a meta reload HTML tag could be used, assuming IIS doesn't mess with that, too. I have seen many websites that display a login-succeded page that automatically loads the target page after a very short delay. I assume this is done via meta reload.
Ron Wilson
2011-03-29 23:10:40 UTC
Permalink
Post by Tony Perovic
Status: 302 Moved Temporarily
/Projects/Test/Test.fossil; expires=Wed, 23 Mar 2011 23:51:39 GMT; Version=1
Location: /Projects/Test/Test.fossil/index
....
<html>
<p>Redirect to /Fossil/Fossil.pl/index</p>
</html>
My understanding is that the Location directive specifies the redirection.
As I recall, yes.
Post by Tony Perovic
The <html>…</html> is only for Netscape compatibility.
All html documents are supposed to start with <html> and end with </html>.
Post by Tony Perovic
Status: 302 Moved Temporarily
I was thinking "Status: 200 Ok".
Post by Tony Perovic
....
<html>
<head>
<meta HTTP-EQUIV="REFRESH" content="0;
url=/Projects/Test/Test.fossil/index.html"/>
</head>
</html>
Otherwise, correct.
Post by Tony Perovic
Works with Chrome, but Microsoft Internet Explorer didn’t like it.
Now, if I could just get the users to switch….
Maybe using status 200 would work.
Tony Perovic
2011-03-31 14:47:06 UTC
Permalink
Indeed, Status: 200 fixed it. Nice catch. Thanks.

Tony Perovic
Compumation, Inc.

-----Original Message-----
From: fossil-users-***@lists.fossil-scm.org [mailto:fossil-users-***@lists.fossil-scm.org] On Behalf Of Ron Wilson
Sent: Tuesday, March 29, 2011 6:11 PM
To: fossil-***@lists.fossil-scm.org
Subject: Re: [fossil-users] Fossil on IIS
Post by Tony Perovic
Works with Chrome, but Microsoft Internet Explorer didn't like it.
Now, if I could just get the users to switch....
Maybe using status 200 would work.

[mailto:fossil-users-bounce= ] On Behalf Of Richard Hipp
1970-01-01 00:00:00 UTC
Permalink
The PATH_INFO variable specifies a path to be interpreted by the CGI

script. It identifies the resource or sub-resource to be returned by

the CGI script, and is derived from the portion of the URI path

hierarchy following the part that identifies the script itself.


So, basically, my Perl script is taking a non-compliant IIS/CGI PATH_INFO and making it compliant.

Microsoft sucks.

Hopefully, my efforts will help the next poor guy trying to configure Fossil on IIS.

Thank you,
Tony Perovic
Compumation, Inc.
________________________________
From: fossil-users-***@lists.fossil-scm.org [mailto:fossil-users-***@lists.fossil-scm.org] On Behalf Of Richard Hipp
Sent: Tuesday, March 29, 2011 12:38 PM
To: fossil-***@lists.fossil-scm.org
Subject: Re: [fossil-users] Fossil on IIS


On Tue, Mar 29, 2011 at 12:40 PM, Tony Perovic <***@compumation.com<mailto:***@compumation.com>> wrote:
This is driving me nuts......

I created a CGI file for my repository on the server:


It seems that Fossil uses the PATH_INFO to construct its reply in CGI mode. I achieved the correct results by writing a Perl script that strips the SCRIPT_NAME portion from the PATH_INFO environment variable before invoking Fossil:

$path = $ENV{"PATH_INFO"};
$script = $ENV{"SCRIPT_NAME"};

if ($path =~ m/^$script/) { # PATH_INFO starts with SCRIPT_NAME?
$ENV{"PATH_INFO"} = substr($path, length($script));
}

All Fossil / CGI requests must be processed through this Perl script. Thus, I concluded, Fossil/CGI cannot possibly work on Windows/IIS without scripting.

Fossil assumes that PATH_INFO and SCRIPT_NAME are set up as described in RFC3875. If what you say is correct, ISS appears not to follow RFC3875 and hence does not really support CGI, but rather something that is merely CGI-like.



Q: Is this correct? Am I missing something?

In fact, given the above analysis, it shouldn't work in Linux either, yet, (I assume) it does.

The main Fossil website (http://www.fossil-scm.org/) is just an instance of Fossil running on a Linux box as CGI. See http://www.fossil-scm.org/fossil/doc/trunk/www/selfhost.wiki for additional information, including the scripts used to enable CGI on the various Fossil mirrors.


Q: Can somebody please explain what is or isn't happening in Linux that is or isn't happening in Windows/IIS?

Reminds me of a haiku I read years ago:

Yesterday it worked.
Today it is not working.
Windows is like that.


Tony Perovic
Compumation, Inc.
________________________________
From: fossil-users-***@lists.fossil-scm.org<mailto:fossil-users-***@lists.fossil-scm.org> [mailto:fossil-users-***@lists.fossil-scm.org<mailto:fossil-users-***@lists.fossil-scm.org>] On Behalf Of Tony Perovic
Sent: Tuesday, March 01, 2011 3:58 PM

To: 'fossil-***@lists.fossil-scm.org<mailto:fossil-***@lists.fossil-scm.org>'
Subject: [fossil-users] Fossil on IIS

Anybody get Fossil working as a "CGI script" on Microsoft Server 2003 / IIS?

I'm trying to access multiple repositories with one script as described at:
http://www.fossil-scm.org/index.html/doc/trunk/www/server.wiki

Learned more than I ever wanted to know about IIS/CGI/Scripting.

[cid:***@01CBEE12.FC5B3950]

TONY PEROVIC

***@compumation.com<mailto:***@compumation.com>
www.compumation.com<http://www.compumation.com>

205 W. Grand Ave., Ste. 121
Bensenville, IL 60106
630-860-1921<tel:630-860-1921> Phone
630-860-1928<tel:630-860-1928> Fax



_______________________________________________
fossil-users mailing list
fossil-***@lists.fossil-scm.org<mailto:fossil-***@lists.fossil-scm.org>
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users



--
D. Richard Hipp
***@sqlite.org<mailto:***@sqlite.org>

--_000_36FC1E0126D9294EA0C28336B13801138B11186499CompumationCO_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PostalCode"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="State"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="place"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="City"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="Street"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="address"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Univers;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:blue;
text-decoration:underline;}
p
{mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman";}
pre
{margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:Arial;
color:navy;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=blue>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>
Continue reading on narkive:
Loading...