Differences between revisions 9 and 23 (spanning 14 versions)
Revision 9 as of 2007-02-06 16:30:36
Size: 4851
Editor: 219-88-100-42
Comment:
Revision 23 as of 2012-10-25 19:49:02
Size: 3221
Editor: mpm
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
Mercurial has a built-in web server which can be used for browsing a repository with a web browser or <<Include(A:delete)>>
<<Include(A:style)>>

Mercurial has a built-in light-weight web server which can be used for browsing a repository with a web browser or
Line 10: Line 13:
This has most of the features of the full web interface. This server can do multithread/multi-process request since Mercurial version 0.9. If you want to make a more permanent server, you should probably use a [:CGI_Install:CGI-based server]. The built-in web server is missing some features found in other web servers, including access control, authentication, SSL, etc.
These are especially useful if you want to be able to securely push to a web-based repository. Thus, if you want to make a more
permanent server, you should probably use a [[CGIinstall|CGI-based server]].
Line 12: Line 17:
Following is a detail options for using hg's http server implemented by python code. Following are detailed options for using hg's HTTP server:
Line 14: Line 19:
bash-3.00$ hg help serve bash-2.05$ hg --version
Mercurial Distributed SCM (version 1.2.1)

Copyright (C) 2005-2009 Matt Mackall <mpm@selenic.com> and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
bash-2.05$ hg help serve
Line 22: Line 33:
    stderr.  Use the "-A" and "-E" options to log to files.     stderr. Use the "-A" and "-E" options to log to files.
Line 30: Line 41:
 -p --port port to use (default: 8000)
 -a --address address to use
 -p --port port to listen on (default: 8000)
 -a --address address to listen on (default: all interfaces)
    --prefix prefix path to
serve from (default: server root)
Line 39: Line 51:
bash-3.00$     --certificate SSL certificate file

use "hg -v help serve" to show global options
bash-2.05$
}}}

An init script to start and stop mercurial's built in http server.
{{{
bash-2.05$ cat hg.init
#!/sbin/sh
#
# Startup script for mercurial server.
#
# Change following ines
APP_BIN=/usr/bin/hg
SRC=/export/src
SRCNAME=" package source"
# Path to PID file of running mercurial process.
PID_FILE=/var/adm/hg.pid


state=$1

case "$state" in
'start')
    echo "Mecurial Server service starting."
   (cd ${SRC} ;${APP_BIN} serve --name "${SRCNAME}" -d -p 8001 --pid-file ${PID_FILE})
  ;;

'stop')
  if [ -f "${PID_FILE}" ]; then
    PID=`cat "${PID_FILE}"`
    if [ "${PID}" -gt 1 ]; then
      kill -TERM ${PID}
      echo "Stopping the Mercurial service PID=${PID}."
    else
      echo Bad PID for Mercurial -- \"${PID}\"
    fi
  else
    echo No PID file recorded for mercurial
  fi
  ;;

*)
  echo "$0 {start|stop}"
  exit 1
  ;;
esac
bash-2.05$
Line 42: Line 103:
----
CategoryCommand CategoryWeb
Line 43: Line 106:
 [http://homepage.mac.com/knob10/58.html webcam striptease] | [http://homepage.mac.com/squarish/24.html xxx webcam] | [http://homepage.mac.com/dybbuks/8.html free sex webcams] | [http://homepage.mac.com/corsica4/79.html webcam nudes] | [http://homepage.mac.com/woads/37.html nudist webcam] | [http://homepage.mac.com/dogtired1/11.html webcam movies] | [http://homepage.mac.com/pericles4/23.html webcam young] | [http://homepage.mac.com/leitmotif1/25.html gallery webcam girl] | [http://homepage.mac.com/leitmotif1/43.html panama canal webcam] | [http://homepage.mac.com/allegation/24.html webcam chat] | [http://homepage.mac.com/allegation/70.html online casino webcam] | [http://homepage.mac.com/fagoting/69.html msn xxx webcam] | [http://homepage.mac.com/bowlfuls/26.html webcam rooms] | [http://homepage.mac.com/fagoting/31.html webcam show] | [http://homepage.mac.com/calibre2/20.html teen girl webcam] | [http://homepage.mac.com/corsica4/36.html hot girl webcam] | [http://homepage.mac.com/knob10/93.html webcam suck] | [http://homepage.mac.com/entrenches/83.html teen webcam] | [http://homepage.mac.com/leitmotif1/3.html webcam masturbating] | [http://homepage.mac.com/gongs1/72.html hot webcam] | [http://homepage.mac.com/corsica4/70.html chat using webcam] | [http://homepage.mac.com/subcranial/26.html college girls webcam] | [http://homepage.mac.com/dogtired1/5.html webcam blonde] | [http://homepage.mac.com/bowlfuls/38.html webcam private] | [http://homepage.mac.com/knob10/84.html webcam shows] | [http://homepage.mac.com/squarish/42.html dirty webcam] | [http://homepage.mac.com/woads/4.html free lesbian webcam] | [http://homepage.mac.com/calibre2/61.html msn webcam girl] | [http://homepage.mac.com/woads/12.html bikini webcam] | [http://homepage.mac.com/dybbuks/8.html adult webcam sites] | [http://homepage.mac.com/leitmotif1/30.html masturbation webcam] | [http://homepage.mac.com/corsica4/63.html free webcam babes] | [http://homepage.mac.com/leitmotif1/62.html webcam dorm] | [http://homepage.mac.com/squarish/72.html teens webcam] | [http://homepage.mac.com/allegation/28.html exhibitionist webcam] | [http://homepage.mac.com/annealed/77.html free view webcams] | [http://homepage.mac.com/bowlfuls/23.html sexy webcam blogs] | [http://homepage.mac.com/pericles4/93.html teen webcam movies] | [http://homepage.mac.com/calibre2/46.html teens on webcam] | [http://homepage.mac.com/woads/14.html amature webcams] | [http://homepage.mac.com/knob10/70.html homemade webcam movies] | [http://homepage.mac.com/calibre2/49.html college teens webcam] | [http://homepage.mac.com/leitmotif1/30.html amateur webcam xxx] | [http://homepage.mac.com/woads/83.html dancing on webcam] | [http://homepage.mac.com/gruffer1/46.html strip webcam] | [http://homepage.mac.com/entrenches/44.html jaime hammer webcam] | [http://homepage.mac.com/corsica4/71.html my sexy webcam] | [http://homepage.mac.com/calibre2/51.html striptease webcam] | [http://homepage.mac.com/leitmotif1/88.html girlfriend webcam] | [http://homepage.mac.com/annealed/8.html asian webcams] | [http://homepage.mac.com/leitmotif1/42.html webcam girls nude] | [http://homepage.mac.com/shy3/42.html girl on webcam] | [http://homepage.mac.com/woads/85.html personal webcams] [[Chinesehgserve|Chinese]] [[Frenchhgserve|Français]]

{X} This page is proposed for deletion. See our wiki cleanup plan for more information.

{i} This page does not meet our wiki style guidelines. Please help improve this page by cleaning up its formatting.

Mercurial has a built-in light-weight web server which can be used for browsing a repository with a web browser or for allowing remote machines to pull from you. To use it, simply run:

$ hg serve

And then point your web browser at http://localhost:8000/.

The built-in web server is missing some features found in other web servers, including access control, authentication, SSL, etc. These are especially useful if you want to be able to securely push to a web-based repository. Thus, if you want to make a more permanent server, you should probably use a CGI-based server.

Following are detailed options for using hg's HTTP server:

bash-2.05$ hg --version
Mercurial Distributed SCM (version 1.2.1)

Copyright (C) 2005-2009 Matt Mackall <mpm@selenic.com> and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
bash-2.05$ hg help serve
hg serve [OPTION]...

export the repository via HTTP

    Start a local HTTP repository browser and pull server.

    By default, the server logs accesses to stdout and errors to
    stderr. Use the "-A" and "-E" options to log to files.

options:

 -A --accesslog       name of access log file to write to
 -d --daemon          run server in background
    --daemon-pipefds  used internally by daemon mode
 -E --errorlog        name of error log file to write to
 -p --port            port to listen on (default: 8000)
 -a --address         address to listen on (default: all interfaces)
    --prefix          prefix path to serve from (default: server root)
 -n --name            name to show in web pages (default: working dir)
    --webdir-conf     name of the webdir config file (serve more than one repo)
    --pid-file        name of file to write process ID to
    --stdio           for remote clients
 -t --templates       web templates to use
    --style           template style to use
 -6 --ipv6            use IPv6 in addition to IPv4
    --certificate     SSL certificate file

use "hg -v help serve" to show global options
bash-2.05$

An init script to start and stop mercurial's built in http server.

bash-2.05$ cat  hg.init
#!/sbin/sh
#
# Startup script for mercurial server.
#
# Change following ines
APP_BIN=/usr/bin/hg
SRC=/export/src
SRCNAME=" package source"
# Path to PID file of running mercurial process.
PID_FILE=/var/adm/hg.pid


state=$1

case "$state" in
'start')
    echo "Mecurial Server service starting."
   (cd ${SRC} ;${APP_BIN} serve --name "${SRCNAME}"  -d  -p 8001 --pid-file ${PID_FILE})
  ;;

'stop')
  if [ -f "${PID_FILE}" ]; then
    PID=`cat "${PID_FILE}"`
    if [ "${PID}" -gt 1 ]; then
      kill -TERM ${PID}
      echo "Stopping the Mercurial service PID=${PID}."
    else
      echo Bad PID for Mercurial -- \"${PID}\"
    fi
  else
    echo No PID file recorded for mercurial
  fi
  ;;

*)
  echo "$0 {start|stop}"
  exit 1
  ;;
esac
bash-2.05$


CategoryCommand CategoryWeb

Chinese Français

hgserve (last edited 2012-10-25 19:49:02 by mpm)