LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Mercurial hgwebdir and lighhtpd (https://www.linuxquestions.org/questions/linux-software-2/mercurial-hgwebdir-and-lighhtpd-798927/)

artur13 03-30-2010 11:39 AM

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

fbianconi 04-02-2010 06:24 PM

The config file should be called "hgweb.config" as is expected by hgwebdir.cgi

artur13 04-03-2010 03:49 PM

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

fbianconi 04-04-2010 03:43 PM

"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 #

artur13 04-05-2010 02:52 AM

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.


All times are GMT -5. The time now is 08:55 AM.