mecurial 服务器认证配置(mecurial + apache + mod_wsgi + python )
2012-11-23 20:13
615 查看
安装Apache: sudo apt-get install apache2安装mod_wsgi: sudo apt-get install libapache2-mod-wsgi安装Mercurial:源码安装,稳定版,见hg安装(目前是2.4)的下载网页[1] hgweb.wsgi在源码mercurail-2.4/contrib下配置hgrc
sudo mkdir /etc/mercurial添加:[web]allow_push = *push_ssl = falseallow_archive = gz, zip, bz2[trusted]users = www-data
.hgrc的添加: cdvim .hgrc#type the following[ui]username = usertest
建立测试目录: cd ~ # go to home directorymkdir repository1cd repository1hg initecho Hello World! > readme.txthg add readme.txthg statushg commit -m 'My first repository!'hg tip # shows the tip of the repository
建立主机目录 cd /varsudo mkdir hgsudo mkdir hg/repositoriessudo chown -R root:www-data hg配置hgweb.config文件 cd /var/hgsudo vim hgweb.config#type following[web]style = gitweb[collections]/var/hg/repositories = /var/hg/repositories配置hgweb.wsgi cd /var/hgsudo cp /home/lijian/Downloads/mercurial-2.4/contrib/hgweb.wsgi .sudo chmod a+x hgweb.wsgisudo vim hgweb.wsgi修改:config = "/var/hg/hgweb.config"配置apache cd /etc/apache2/sudo mkdir mercurialcd mercurial/sudo vim mercurial.conf内容:WSGIScriptAliasMatch ^/hg(.*) /var/hg/hgweb.wsgi$1<Directory "/var/hg/">Options Indexes FollowSymlinks MultiViews ExecCGIAllowOverride AllOrder allow,denyAllow from allAuthType BasicAuthName "Mercurial Repositories"AuthUserFile /var/hg/hgusersRequire valid-user</Directory>cd
/etc/apache2/sites-available
sudo
nano default
# Type on the line before
Include
/etc/apache2/mercurial/mercurial
.conf
#restart the apache server so the changes take effect
sudo
apache2ctl restart
如有问题查看/var/log/apache2/error.log [tail /var/log/apache2/error.log]测试 cd ~ # go to your home drivesudo mv test/ /var/hg/repositories/.sudo chown -R root:www-data /var/hg/建立用户密码文件 cd /var/hgsudo htpasswd -mc hgusers admin #建立adminsudo chown root:www-data hgusers添加其它用户 cd /var/hgsudo htpasswd -m hgusers {username}# 添加用户username用http://localhost/hg,访问 参考:[1]: [http://mercurial.selenic.com/release/?M=D][2]:[http://omarfrancisco.com/setting-up-a-mercurial-repository-in-ubuntu-11-10/][3]:[http://www.linuxidc.com/Linux/2011-07/39290.htm][4]:官网介绍:[http://mercurial.selenic.com/wiki/PublishingRepositories]
相关文章推荐
- Apache2.2+python2.7+mod_python安装与配置
- python 2.6.x 构建 mod_python 及 apache 下的简单配置
- ubuntu16.04安装配置mod_python,apxs,apache
- 配置apache服务器的用户认证
- linxu下的apache+mod_python的djangoweb开发配置
- Win下python+Pydev+Django+apache+mod_wsgi开发部署配置记录
- Apache服务器SSL双向认证配置
- win8系统下 配置apache2.4+mod_wsgi4.4+django1.8.6+python3.4
- Ubuntu Apache 2.4 配置-HTTPS、python mod WSGI
- 在Windows服务器下用Apache和mod_wsgi配置Python应用的教程
- 让你的apache+mod_python服务器支持自定义扩展名
- 用Apache配置本地服务器,并用以运行html和Python文件
- 【转】ubuntu下配置apache的mod_python解决firefox下不能解析文档而变成直接下载
- Django在使用mod_python+apache中配置VirtualHost的问题总结
- windows+apache+mod_python配置django运行环境
- Debian+Django1.11+Apache2.4+mod_wsgi+python2.7搭建服务器
- 网页编辑器(修改apache+mod_python配置完成cgi脚本前奏)
- Linux+Django+Python+Wsgi配置过程 Linux下配置Apache+Mod_Wsgi+Django环境 部署django项目
- Mod_Python在 Apache 2.2.4下的配置
- [Python]DJango部署在Apache服务器配置示例