时隔半年后接着[突击Mercurial SCM(HG)5—Ubuntu下apache+mod_wsgi搭建hg server](http://blog.csdn.net/lincyang/article/details/42779523)
讲述提交代码时遇到的问题。
1.ssl问题
~~~
$ hg push
pushing to http://localhost/repos/welcomePlayer
searching for changes
abort: HTTP Error 403: ssl required
~~~
因为我们没有启用SSL,如果只是在局域网中架设服务器,那么可以先禁用ssl即可。在hgweb.config配置如下:
~~~
$ sudo vim /var/www/vhosts/xxx/cgi-bin/hgweb.config
~~~
~~~
[web]
style = coal
push_ssl = false
~~~
2.authorization failed
再次push发生如下错误:
~~~
$ hg push
pushing to http://localhost/repos/welcomePlayer
searching for changes
abort: authorization failed
~~~
原因是我们没有进行身份认证,一个最简单的办法时允许任何人提交代码,在hgweb.config中添加如下配置:
~~~
[web]
style = coal
push_ssl = false
allow_push = *
~~~
要进行明确的用户认证管理,请参
考[突击Mercurial SCM(HG)8—hg server 用户认证](http://blog.csdn.net/lincyang/article/details/43835073)