Dec 31 2009
∞
Installing Mercurial hgwebdir.cgi on Windows 2003 IIS 6.0
This walk-through is based on the following stackoverflow article.
- Download and install Python 2.6.4 to C:\Mercurial\Python
- Download and install MiniGW 5.1.6
- Choose the Download and Install Option.
- Choose the Current Package Option to Install.
- For the Components to Install Select the “Minimal” option. Install to C:\Mercurial\MinGW
- Add to path “C:\Mercurial\Python\Scripts;C:\Mercurial\Python;C:\Mercurial\MinGW\bin”
- Download and unzip Mercurial source to C:\Mercurial\Source
- Build Mercurial from command line:
python setup.py build --force -c mingw32 python setup.py install --force --skip-build
- Create default hgrc from command line type:
cd %userprofile%
copy con .hgrc [ui]
username = Firstname Lastname <firstname.lastname@example.net>
verbose = True- CTRL-Z
- ENTER
- hg debuginstall should display “No problems detected”
- Create C:\Mercurial\Web and C:\Mercurial\Repositories directories
- Copy the hgwebdir.cgi file from the C:\Mercurial\Source to C:\Mercurial\Web
- Create hgweb.config in C:\Mercurial\Web
- Insert text in hgweb.config
[paths]
/ = C:\Mercurial\Repositories\ - Give IUSR_{ComputerName} Modify permissions for C:\Mercurial\Repositories
- Create a test repository
cd C:\Mercurial\Repositories
md test
cd test
hg init - Enable push for this repository
- create hgrc file with notepad in cd C:\Mercurial\Repositories\test.hg
- insert the following text
[web]
allow_push = *
push_ssl = false - Start IIS Manager
- Allow All Unknown CGI Extensions in Web Server Extensions.
- Create virtual dir or new website with C:\Mercurial\Web path.
- Grant website execute permission
- In application configuration (Home Directory, Configuration button) add new extension. Executable:
"C:\Mercurial\Python\python.exe" %s
Extension:.cgi
- Test your newly configured website: eg. http://localhost/hgwebdir.cgi
TODO:
- Don’t forget to configure authentication.
- Change file system permissions accordingly.
- Increase cgi timeout
cd \inetpub\AdminScripts\
cscript adsutil.vbs GET /W3SVC/CGITimeout
cscript adsutil.vbs SET /W3SVC/CGITimeout 3000