zoukankan      html  css  js  c++  java
  • Hg WebServer 搭建

    Win7系统 64位, 以下程序均为64位.

    1. python-2.7.12.amd64.msi                        [必须]        本机测试安装目录  C:\Python27

    2. mercurial-4.7.1.win-amd64-py2.7.msi      [必须]       本机测试安装后自动到  C:\Python27\Lib\site-packages

    3. ttortoisehg-4.5.3-x64.msi                          [可选]       依赖 vc++2015

    4. rewrite_amd64_zh-CN.msi                       [可选]       依赖 vc++2015

    Traceback (most recent call last):
      File "thg", line 122, in <module>
      File "hgdemandimportdemandimportpy2.pyo", line 145, in __getattr__
      File "hgdemandimportdemandimportpy2.pyo", line 90, in _load
      File "hgdemandimportdemandimportpy2.pyo", line 41, in _hgextimport
      File "tortoisehghgqt
    un.pyo", line 391, in <module>
      File "hgdemandimportdemandimportpy2.pyo", line 145, in __getattr__
      File "hgdemandimportdemandimportpy2.pyo", line 90, in _load
      File "hgdemandimportdemandimportpy2.pyo", line 41, in _hgextimport
      File "tortoisehghgqtqtapp.pyo", line 18, in <module>
      File "hgdemandimportdemandimportpy2.pyo", line 167, in _demandimport
      File "hgdemandimportdemandimportpy2.pyo", line 41, in _hgextimport
      File "tortoisehghgqtqtcore.pyo", line 53, in <module>
      File "hgdemandimportdemandimportpy2.pyo", line 167, in _demandimport
      File "hgdemandimportdemandimportpy2.pyo", line 41, in _hgextimport
      File "PyQt5QtCore.pyo", line 12, in <module>
      File "PyQt5QtCore.pyo", line 10, in __load
    ImportError: DLL load failed: The specified module could not be found.

     运行 TortoiseHg Workbench 出现如上错误请安装 Microsoft C++ 2015 Redistributable  https://www.microsoft.com/en-us/download/details.aspx?id=53587

     错误参照 -->  https://bitbucket.org/tortoisehg/thg/issues/4972/importerror-dll-load-failed

    详细安装步骤请参照

    http://www.cnblogs.com/gb2013/archive/2013/02/01/Mercurial_WebServer.html

    hgweb.cgi 文件

    #!C:/Python27/python.exe
    #
    # An example hgweb CGI script, edit as necessary
    # See also http://mercurial.selenic.com/wiki/PublishingRepositories
    # Path to repo or hgweb config to serve (see 'hg help hgweb')
    config = "C:/SourceCode/hgweb.config"
    # Uncomment and adjust if Mercurial is not installed system-wide:
    import sys
    sys.path.insert(0, "C:\Python27\Lib\site-packages")
    # Uncomment to send python tracebacks to the browser if an error occurs:
    import cgitb
    cgitb.enable()
    from mercurial import demandimport
    demandimport.enable() 
    from mercurial.hgweb import hgweb, wsgicgi
    application = hgweb(config)
    wsgicgi.launch(application)

    hgweb.config 文件

    [paths] 
    /Repositories/ = C:/SourceCode/* 
    [web] 
    encoding = UTF-8
    descend = True
    push_ssl = false
    baseurl = /
    allow_read = *
    allow_push = *

    web.config 文件

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <system.webServer>
            <handlers>
                <add name="CGIHandler" path="*.cgi" verb="*" modules="CgiModule" scriptProcessor="C:Python27python.exe -u &quot;%s&quot; &quot;%s&quot;" resourceType="Unspecified" />
            </handlers>
            <defaultDocument>
                <files>
                    <add value="hgweb.cgi" />
                </files>
            </defaultDocument>
        <rewrite>
          <rules>
            <clear />
            <rule name="hgweb.cgi" enabled="true" patternSyntax="Wildcard">
              <match url="*" />
              <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
              </conditions>
              <action type="Rewrite" url="hgweb.cgi/{R:1}" />
            </rule>
          </rules>
        </rewrite>
        <security>
          <authorization>
            <remove users="*" roles="" verbs="" />
            <add accessType="Allow" users="*" />
          </authorization>
        </security>
        </system.webServer>
    </configuration>
  • 相关阅读:
    Magento2 观察者模式 之 插件
    Magento2 自定义生成日志函数
    magento 由于Httpd进程增多,导致CPU占用100%问题
    Magento composer 安装
    htaccess 的使用基本小节 For apache httpd
    设计便捷命令行工具列表
    docker-lnmp dockerfile
    使用Portainer管理Docker
    关于IIS站点最大并发量分析
    深入理解IIS的多线程工作机制
  • 原文地址:https://www.cnblogs.com/wonderfuly/p/10160944.html
Copyright © 2011-2022 走看看