I am on Linux Mint 10 and I tried the following command:
$ git instaweb -d apache2 -p 1234 --start
Syntax error on line 1 of /mnt/storage/gurjeet/.git/gitweb/httpd.conf:
Invalid command 'server.document-root', perhaps misspelled or defined
by a module not included in the server configuration
Could not execute http daemon apache2 -f.
/mnt/storage/gurjeet/ is my $HOME.
I have tried commenting out that first line, but then the error
complains about line 2 'server.port = 1234'
Any help appreciated.
Thanks in advance.
PS: I am told that no subscription is required on this mailing list,
since people usually do reply-all; so relying on that.
--
Gurjeet Singh
EnterpriseDB Corporation
The Enterprise PostgreSQL Company
From: Jakub Narebski <hidden> Date: 2016-06-15 22:51:31
CC-ing Eric Wong, author of git-instaweb.
Gurjeet Singh [off-list ref] writes:
I am on Linux Mint 10 and I tried the following command:
$ git instaweb -d apache2 -p 1234 --start
Syntax error on line 1 of /mnt/storage/gurjeet/.git/gitweb/httpd.conf:
Invalid command 'server.document-root', perhaps misspelled or defined
by a module not included in the server configuration
Could not execute http daemon apache2 -f.
Hmmm... it looks like starts apache2, but generates config file
(httpd.conf) for lighttpd instead.
Ahh... actually you started apache2, but didn't generate configuration
file for it, so git-instaweb re-uses previous config file... which by
default is lighttpd:
start, --start
Start the httpd instance and exit. This does not generate any of the
configuration files for spawning a new instance.
Try using
$ git instaweb -d apache2 -p 1234 -b lynx
then exiting web browser.
BTW. I think that git-instaweb should be more helpful here... will
investigate.
/mnt/storage/gurjeet/ is my $HOME.
Nb. it doesn't mater where $HOME is, but where is git repository you
were in when calling git-instaweb.
BTW. in the future it would be good idea to tell what git version are
you using.
--
Jakub Narebski
Poland
ShadeHawk on #git
On Thu, Jun 23, 2011 at 4:23 AM, Jakub Narebski [off-list ref] wrote:
CC-ing Eric Wong, author of git-instaweb.
Gurjeet Singh [off-list ref] writes:
quoted
I am on Linux Mint 10 and I tried the following command:
$ git instaweb -d apache2 -p 1234 --start
Syntax error on line 1 of /mnt/storage/gurjeet/.git/gitweb/httpd.conf:
Invalid command 'server.document-root', perhaps misspelled or defined
by a module not included in the server configuration
Could not execute http daemon apache2 -f.
Hmmm... it looks like starts apache2, but generates config file
(httpd.conf) for lighttpd instead.
Ahh... actually you started apache2, but didn't generate configuration
file for it, so git-instaweb re-uses previous config file... which by
default is lighttpd:
start, --start
Start the httpd instance and exit. This does not generate any of the
configuration files for spawning a new instance.
Now that's very unintuitive.... I am the impatient kind, and didn't
read the whole paragraph. I assumed --start would just start the
webserver (maybe run in daemon mode).
That worked.. I do not have lynx, but it did start apache2 and I was
able to browse the repo.
then exiting web browser.
BTW. I think that git-instaweb should be more helpful here... will
investigate.
quoted
/mnt/storage/gurjeet/ is my $HOME.
Nb. it doesn't mater where $HOME is, but where is git repository you
were in when calling git-instaweb.
Got it. I have some files of my home directory in a Git repository, so
$HOME is where the repository is.
I have quite a few development related Git repositories under
$HOME/dev/ and instaweb shows all of them on the first page (with
description etc). IOW, is it supposed to recurse down all directories
to look for .git/ directories?
.git
dev/EDB-ADVISORS/.git
dev/EDBAS/.git
dev/PCS/.git
dev/PEM/.git
dev/PGAGENT/.git
dev/POSTGRES/.git
dev/SERVICESTOOLS/.git
dev/SLONY/.git
Is this expected?
BTW. in the future it would be good idea to tell what git version are
you using.
I am at 1.7.1
Thanks for the help, and thanks to everyone around Git for a great
piece of software.
--
Gurjeet Singh
EnterpriseDB Corporation
The Enterprise PostgreSQL Company
From: Jakub Narebski <hidden> Date: 2016-06-15 22:51:31
On Thu, 23 Jun 2011, Gurjeet Singh wrote:
On Thu, Jun 23, 2011 at 4:23 AM, Jakub Narebski [off-list ref] wrote:
quoted
Gurjeet Singh [off-list ref] writes:
quoted
I am on Linux Mint 10 and I tried the following command:
$ git instaweb -d apache2 -p 1234 --start
Syntax error on line 1 of /mnt/storage/gurjeet/.git/gitweb/httpd.conf:
Invalid command 'server.document-root', perhaps misspelled or defined
by a module not included in the server configuration
Could not execute http daemon apache2 -f.
Hmmm... it looks like starts apache2, but generates config file
(httpd.conf) for lighttpd instead.
Ahh... actually you started apache2, but didn't generate configuration
file for it, so git-instaweb re-uses previous config file... which by
default is lighttpd:
start, --start
Start the httpd instance and exit. This does not generate any of the
configuration files for spawning a new instance.
Now that's very unintuitive.... I am the impatient kind, and didn't
read the whole paragraph. I assumed --start would just start the
webserver (maybe run in daemon mode).
I'm working on it... actually the patch series is ready to send; it will
be sent as a reply to this email.
I just hope that it wouldn't be lost being deeper in thread...
quoted
quoted
/mnt/storage/gurjeet/ is my $HOME.
Nb. it doesn't mater where $HOME is, but where is git repository you
were in when calling git-instaweb.
Got it. I have some files of my home directory in a Git repository, so
$HOME is where the repository is.
I have quite a few development related Git repositories under
$HOME/dev/ and instaweb shows all of them on the first page (with
description etc). IOW, is it supposed to recurse down all directories
to look for .git/ directories?
.git
dev/EDB-ADVISORS/.git
dev/EDBAS/.git
dev/PCS/.git
dev/PEM/.git
dev/PGAGENT/.git
dev/POSTGRES/.git
dev/SERVICESTOOLS/.git
dev/SLONY/.git
Is this expected?
It is expected behavior.
It is consequence of the fact that the default gitweb mode is to search
for repositories recursively starting from given root; git-instaweb set
this $projectsroot to the one directory up from $GIT_DIR. Alternate
solution would be for git-instaweb to generate projects list file for
gitweb with only single repository listed...
Nevertheless usually you don't have repositories inside of working
directory of other repositories. There was even idea floated to deprecate
such support, but it didn't gained traction.
One expected exception is when you use _submodules_; in this case you
would probably want to see both supermodule and submodules (subrepositories).
That is why I think that current git-instaweb behavior has sense.
--
Jakub Narebski
Poland
From: Jakub Narebski <hidden> Date: 2016-06-15 22:51:31
This series fixes the issue reported by Gurheet Singh in "Having some
problem with instaweb", in that --start/--restart doesn't generate
configuration, which is documented:
start, --start
Start the httpd instance and exit. This does not generate any of the
configuration files for spawning a new instance.
but unexpected.
The first three patches are independent refactoring to make final
change smaller and easier to review, thoug they have merit even taken
standalone.
---
Jakub Narebski (4):
git-instaweb: Check that correct config file exists for (re)start
git-instaweb: Move all actions at the end of script
git-instaweb: Use $conf, not $fqgitdir/gitweb/httpd.conf
git-instaweb: Extract web server configuration into configure_httpd
Documentation/git-instaweb.txt | 8 ++--
git-instaweb.sh | 84 ++++++++++++++++++++++++++--------------
2 files changed, 58 insertions(+), 34 deletions(-)
--
Jakub Narebski
ShadeHawk on #git
Poland
From: Jakub Narebski <hidden> Date: 2016-06-15 22:51:31
This is preparatory work for making start/restart check that
git-instaweb set up correct configuration, and generate it if it is
missing.
Pure refactoring, no functional changes.
Signed-off-by: Jakub Narebski <redacted>
---
As usual, you can check this change with
$ git blame -w --date=short -C -C HEAD^.. -- git-instaweb.sh |
grep -C 3 -e '^[^^]' | less -S
assuming that it is checked out (HEAD == this commit).
Thanks Junio for the tip!
Nb. it would be nice to have an option to 'git diff' which would
function like '-w' but ignore code movement...
git-instaweb.sh | 46 +++++++++++++++++++++++++---------------------
1 files changed, 25 insertions(+), 21 deletions(-)
From: Jakub Narebski <hidden> Date: 2016-06-15 22:51:31
Don't repeat yourself: use "$conf" instead of its [current] contents,
namely "$fqgitdir/gitweb/httpd.conf".
Signed-off-by: Jakub Narebski <redacted>
---
Straighforward improvement. Note that currently $conf is constant,
and doesn't change its value.
git-instaweb.sh | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
@@ -103,7 +103,7 @@ start_httpd () {case"$httpd"in*mongoose*|*plackup*)#These servers don't have a daemon mode so we'll have to fork it-$full_httpd"$fqgitdir/gitweb/httpd.conf"&+$full_httpd"$conf"&#Save the pid before doing anything else (we'll print it later)pid=$!
From: Jakub Narebski <hidden> Date: 2016-06-15 22:51:31
As a nice side-effect now the order of parameters does not matter:
$ git instaweb --httpd=apache2 --start
is now (after this patch) the same as
$ git instaweb --start --httpd=apache2
Before this commit --start, --stop, --restart (and their subcommand
versions start, stop, restart) exited immediately.
This is preparatory work for making start/restart check that correct
configuration is set up; this change was required to have access in
start_httpd to requested web browser etc.
Signed-off-by: Jakub Narebski <redacted>
---
Unfortunately there are no tests for git-instaweb, so I couldn't test
if it is really no much of a functional change.
BTW. if you thought of a better subject for this commit, please speak
up.
git-instaweb.sh | 27 ++++++++++++++++++++-------
1 files changed, 20 insertions(+), 7 deletions(-)
@@ -148,17 +149,13 @@ while test $# != 0docase"$1"in--stop|stop)-stop_httpd-exit0+action="stop";;--start|start)-start_httpd-exit0+action="start";;--restart|restart)-stop_httpd-start_httpd-exit0+action="restart";;-l|--local)local=true
From: Jakub Narebski <hidden> Date: 2016-06-15 22:51:31
Currently start/restart does not generate any configuration files for
spawning a new instance. This means that
$ git instaweb --http=<server> --start
might pick up stale 'httpd.conf' file for a different web server
(e.g. for default lighttpd when requesting apache2).
This commit changes that, and makes git-instaweb generate web server
config file and/or gitweb config file if don't exists.
This required naming config files after the name of web server
(alternate solution would be to somehow mark for which web server was
config file generated).
Note that web servers that embed configuration in server script file,
namely webrick and plackup, and which delete "$conf" in their *_conf
function, would have their config (server script) always regenerated.
Note: this commit introduces a bit of code repetition (but only a few
lines).
Reported-by: Gurjeet Singh <redacted>
Signed-off-by: Jakub Narebski <redacted>
---
This is an actual fix.
Though I haven't checked if git-instaweb behaves sanely if you switch
between web servers with --start...
Documentation/git-instaweb.txt | 8 ++++----
git-instaweb.sh | 7 +++++++
2 files changed, 11 insertions(+), 4 deletions(-)
@@ -51,8 +51,8 @@ OPTIONS start:: --start::- Start the httpd instance and exit. This does not generate- any of the configuration files for spawning a new instance.+ Start the httpd instance and exit. Regenerate configuration files+ as necessary for spawning a new instance. stop:: --stop::
@@ -62,8 +62,8 @@ stop:: restart:: --restart::- Restart the httpd instance and exit. This does not generate- any of the configuration files for spawning a new instance.+ Restart the httpd instance and exit. Regenerate configuration files+ as necessary for spawning a new instance. CONFIGURATION -------------
@@ -99,6 +99,12 @@ start_httpd () {# here $httpd should have a meaningful valueresolve_full_httpd+mkdir-p"$fqgitdir/gitweb/$httpd_only"+conf="$fqgitdir/gitweb/$httpd_only.conf"++# generate correct config file if it doesn't exist+test-f"$conf"||configure_httpd+test-f"$fqgitdir/gitweb/gitweb_config.perl"||gitweb_conf# don't quote $full_httpd, there can be arguments to it (-f)case"$httpd"in
From: Eric Wong <hidden> Date: 2016-06-15 22:51:31
Jakub Narebski [off-list ref] wrote:
This series fixes the issue reported by Gurheet Singh in "Having some
problem with instaweb", in that --start/--restart doesn't generate
configuration, which is documented:
Everything looks reasonable, thanks! Acked and pushed to "instaweb"
branch on git://bogomips.org/git-svn.git
--
Eric Wong