LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 03-30-2010, 11:39 AM   #1
artur13
Member
 
Registered: Dec 2009
Posts: 31

Rep: Reputation: 16
Mercurial hgwebdir and lighhtpd


Hello,
I try to set up on Debian mercurial shared repositories. The webserver is working and python.cgi is working also. Here is my config
Code:
server.modules              = (
            "mod_cgi",
            "mod_access",
            "mod_alias",
            "mod_accesslog",
            "mod_compress",
#           "mod_rewrite",
#           "mod_redirect",
#           "mod_evhost",
#           "mod_usertrack",
#           "mod_rrdtool",
#           "mod_webdav",
#           "mod_expire",
#           "mod_flv_streaming",
#           "mod_evasive"
)
server.document-root       = "/var/www/"
server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
server.errorlog            = "/var/log/lighttpd/error.log"

index-file.names           = ( "index.py", "index.html",
                                "default.htm", "hgwebdir.cgi" )


debug.log-file-not-found   = "enable"
debug.log-request-handling = "enable"
debug.log-response-header  = "enable"
debug.log-request-header   = "enable"

cgi.assign                 = ( ".py"  => "/usr/bin/python",
				".cgi" => "/usr/bin/python" )
mimetype.use-xattr = "enable"

accesslog.filename         = "/var/log/lighttpd/access.log"

url.access-deny            = ( "~", ".inc" )

static-file.exclude-extensions = ( ".php", ".py", ".cgi" )


# error-handler for status 404
#server.error-handler-404  = "/error-handler.html"
#server.error-handler-404  = "/error-handler.php"

## to help the rc.scripts
server.pid-file            = "/var/run/lighttpd.pid"

dir-listing.encoding        = "utf-8"
server.dir-listing          = "enable"

server.username            = "www-data"

server.groupname           = "www-data"

compress.cache-dir          = "/var/cache/lighttpd/compress/"
compress.filetype           = ("text/plain", "text/html", "application/x-javascript", "text/css")

include_shell "/usr/share/lighttpd/create-mime.assign.pl"

include_shell "/usr/share/lighttpd/include-conf-enabled.pl"

$HTTP["remoteip"] =~ "127.0.0.1" {
	alias.url += (
		"/doc/" => "/usr/share/doc/",
		"/images/" => "/usr/share/images/"
	)
	$HTTP["url"] =~ "^/doc/|^/images/" {
		dir-listing.activate = "enable"
	}
}
My repos are in /home/myrepo/proj1 and proj2. In bouth i have a single html file and then I use add and commit them. The mercurial was installed using apt-get. I put hgwebdir.cgi in /var/www/test directory. Here is my hgwebdir file
Code:
!/usr/bin/env python
from mercurial import demandimport; demandimport.enable()
import os
os.environ["HGENCODING"] = "UTF-8"
from mercurial.hgweb.hgwebdir_mod import hgwebdir
from flup.server.fcgi import WSGIServer
WSGIServer(hgwebdir('hgweb.config')).run()
My hgwebdir.config is as follow
Code:
[paths]
proj1 = /home/myrepo/proj1 // proj 1 mean that repo is accessible under ip/test/proj1? 
proj2 = /home/myrepo/proj2
And the problem is that id doesn't work. When I open ip/test/ nothing happen on ip/test/proj1 I is 404 error page not found. Where is mistake?
Thx in advice for any help.
Best regards
Artur

Last edited by artur13; 04-03-2010 at 03:50 PM.
 
Old 04-02-2010, 06:24 PM   #2
fbianconi
Member
 
Registered: Apr 2008
Location: argentina
Distribution: Arch
Posts: 86

Rep: Reputation: 22
The config file should be called "hgweb.config" as is expected by hgwebdir.cgi
 
1 members found this post helpful.
Old 04-03-2010, 03:49 PM   #3
artur13
Member
 
Registered: Dec 2009
Posts: 31

Original Poster
Rep: Reputation: 16
Thx for suggestion but it wan not the only problem I also have to install package python flup and it is working perfectlyAnd the change first line to #!/usr/bin/python because the env doesn't work don't know why.
Greetings
Artur

Last edited by artur13; 04-05-2010 at 02:53 AM. Reason: fixing mistakes
 
Old 04-04-2010, 03:43 PM   #4
fbianconi
Member
 
Registered: Apr 2008
Location: argentina
Distribution: Arch
Posts: 86

Rep: Reputation: 22
"falc" as in Flac Loseless Audio Codec? It doesn't sound like it...
by the way it's #! not !# because it's supposed to be a comment, and comments start with #
 
Old 04-05-2010, 02:52 AM   #5
artur13
Member
 
Registered: Dec 2009
Posts: 31

Original Poster
Rep: Reputation: 16
Sorry my mistakes:/ I have to install this package
Code:
http://packages.debian.org/testing/python/python-flup
and with the !# You are offcourse right. Sorry for mistakes.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Filmaster switches to Mercurial LXer Syndicated Linux News 0 08-10-2009 01:10 PM
LXer: Python goes Mercurial LXer Syndicated Linux News 0 04-01-2009 04:40 PM
LXer: Xen 3.3.1rc1-pre port to CentOS 5.2 via http://bits.xensource.com mercurial rep LXer Syndicated Linux News 0 11-18-2008 07:11 PM
Apache vs Lighhtpd on Fedora sekasi Fedora 1 05-31-2008 06:26 PM
LXer: Introducing Mercurial, a distributed version control system LXer Syndicated Linux News 0 11-20-2007 07:40 AM


All times are GMT -5. The time now is 05:45 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration