Mercurial and hgweb on IIS 7.5 - python error

…衆ロ難τιáo~ 提交于 2019-11-27 18:38:07
Brook

I've been struggling with this same setup for the past week or so.

It looks to me like they have made some significant changes to how mercurial works in IIS recently, so the link above to Jeremy Skinners tutorial will be problematic for 1.7.2

This is a more recent link I found I had to do a couple things differently.

These instructions are for 1.7.x, if you're using 1.8.x, be sure to read Ethan's comment below!

I followed the instructions in the comments of /contrib/win32/hgwebdir_wsgi.py.

  • Install Python 2.6.6

  • Add Python to system PATH (to make life easier)

  • Install pywin32 v214 (using the Python installer, Important!) (Note that this is built against python 2.6)

  • Install isapi_wsgi

  • download the mercurial source package
    Extract, Then Run

    python setup.py --pure build_py -c -d . build_ext -i build_mo --force
    python setup.py --pure install --force
    
  • Copy hgwebdir_wsgi.py from /contrib/win32 to the folder you want to host it from.

  • Create a file hgweb.config in the folder you're going to host from. Add the contents

    [paths]
    yourRepoName = c:\yourRepoLocation
    
  • Edit hgwebdir_wsgi.py to point the hgweb.config. path_prefix is 0 if hg is the root of the website. if you're putting it in a vdir 1 deep, then it's 1, etc.

  • Run python hgwebdir_wsgi.py to create the isapi dll _hgwebdir_wsgi.dll. Console should print out "installation complete"

  • Create your app pool in IIS (no managed code)

  • Create your website, with the folder set to the same folder as hgwebdir_wsgi.py

  • Add Handler of type Module, use "*" as the mapping, select _hgwebdir_wsgi.dll as the executable, select isapimodule as the type, Mercurial-ISAPI as the name (although name doesn't really matter)

  • Edit feature permissions of the module to allow execute.

web.config (for the previous 2 steps):

<system.webServer>
<handlers accessPolicy="Read, Execute, Script">
<add name="Mercurial-Isapi" path="*" verb="*" modules="IsapiModule" scriptProcessor="C:\inetpub\hgweb\_hgwebdir_wsgi.dll" resourceType="Unspecified" />
</handlers>
</system.webServer>

After all this, I was able to get it working.

One last thing, I did copy MFC71.dll to windows/system32, although I'm not sure it was necessary http://python.net/crew/skippy/win32/

I think the main difference between what I've got here and what's on the above link is that I did the "pure python" mercurial install, Although I'm a complete python newbie so I'm not sure. Also I did the "python installs" for pywin and isapi_wsgi rather than the plain windows msis.

Adam Boddington has written an updated installation description that works now: http://stackingcode.com/blog/2011/02/24/running-a-mercurial-server-on-iis-7-5-windows-server-2008-r2

I wrote out up to date instructions on how to setup a mercurial repository on IIS7 using the current versions of Mercurial (1.8.x) as well the current version of Python (2.7).

This will work for you and I appreciate if you use it to vote the answer up (or down ;)).

lvandenb

I did have a lot of errors before. Uninstalled all python, pywin32, isapi_wsgi an dinstalled it like above. It worked as a breeze. Luc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!