Why do I get "syntax error in httpd.conf" when integrating Git with RTC?
Hello,
I am doing my first steps with such integration: Git with RTC. Similar to Makasy I have only the IBM articles in front of me -:(
when I restart my Apache it tells:
AH00526: Syntax error on line 98 of C:/Programme/Apache24/conf/httpd.conf:
Invalid command 'Allow', perhaps misspelled or defined by a module not included in the server configuration
how should the lines be filled:
<directory "="" usr="" libexec="" git-core="" "="">
<directory "="" rtc-git-hooks="" "="">
could you give an example plz.?
???
2 answers
first I would suggest to set the port number to 8080 for instance. Then please check the DocumentRoot and the Environment variable GIT_PROJECT_ROOT. Is it set to the root directory of your repository..
Another thing you can check: can you access the git directory from an internet browser directly e,g, http://<localhost>:<portnumber>
Hi Christine,
I still have a problem with my Git-RTC Integration:
c:\Programme\Apache24\htdocs\project.git>python.exe -d C:\Programme\RTC-GIT-Hooks-5.0.2\ValidatePush.py "https://clm.peiker.local:9443/ccm" "08eb28aacd7b4454bd88bf4c11f25076" "asa" "0000000000000000000000000000000000000000" "c31b0b793519eb8b9bc4
90edf7de254b1c485ee3" "master"
('https://clm.peiker.local:9443/ccm', '08eb28aacd7b4454bd88bf4c11f25076', 'asa', '0000000000000000000000000000000000000000', 'c31b0b793519eb8b9bc490edf7de254b1c485ee3', 'master', None)
('Checking for Reg exp ', None)
('Is not a regexp',)
('In getCommits: ',)
('In getParamsForPush', ['c31b0b793519eb8b9bc490edf7de254b1c485ee3'])
('Executing command: ', ['git', 'log', '-n 1', '--pretty=format:"%B"', 'c31b0b793519eb8b9bc490edf7de254b1c485ee3'])
('Executing command: ', ['git', 'log', '-n 1', '--pretty=format:"%cn"', 'c31b0b793519eb8b9bc490edf7de254b1c485ee3'])
('Executing command: ', ['git', 'log', '-n 1', '--pretty=format:"%ce"', 'c31b0b793519eb8b9bc490edf7de254b1c485ee3'])
('Executing command: ', ['git', 'log', '-n 1', '--pretty=format:"%cd"', 'c31b0b793519eb8b9bc490edf7de254b1c485ee3'])
('Executing command: ', ['git', 'rev-parse', '--git-dir'])
('getAssociateWIUrl(): Could not switch to git repository path',)
('checking isPushNewBranch',)
('data: ', 'commitSha1=c31b0b793519eb8b9bc490edf7de254b1c485ee3&commitComment=Comments+with+WorkItem+279%0A&committerName=Adel+Salah&committerEmail=%22Adel.Salah%40peiker.de%22&remoteRef=master&creationDate=%22Wed+Jul+29+10%3A04%3A48+2015+%2B020
0%22&gitUser=asa&repositoryKey=08eb28aacd7b4454bd88bf4c11f25076&baseRevSha1=0000000000000000000000000000000000000000&endRevSha1=c31b0b793519eb8b9bc490edf7de254b1c485ee3&opHint=branch_create')
('Executing command: ', ['git', 'rev-parse', '--git-dir'])
('getValidatePushUrl(): Could not switch to git repository path',)
'Push Operation' failed. Preconditions have not been met: "Owner of the Git commit is null or does not match the Git user."
I am not sure wether the problem is on the Git or RTC side?
could you plz. help?
thx
Adel
Comments
Christine Makasy
Jul 15 '15, 8:44 a.m.I'working with apache2 and did these entries in the sites-enabled folder.
<Directory "/usr/lib/git-core/">
Options +ExecCGI +SymLinksIfOwnerMatch
Require all granted
</Directory>
For some other directories you need a read/write access you maybe need to add
AllowOverride All
Adel Salah
Aug 09 '15, 10:39 a.m.Hi Christine,
I changed my httpd.conf (Listen 8080) so that when I put
http://localhost:8080/project.git
in the Browser I can see my project tree.
but when I execute following fetch command:
$GIT_CURL_VERBOSE=1 git fetch http://git@localhost/project.git
same error occurs:
* Couldn't find host localhost in the _netrc file; using defaults
* Trying ::1...
* Connected to localhost (::1) port 80 (#0)
> GET /project.git/info/refs?service=git-upload-pack HTTP/1.1
User-Agent: git/1.9.5.msysgit.1
Host: localhost
Accept: */*
Accept-Encoding: gzip
Pragma: no-cache
< HTTP/1.1 404 Not Found
< Date: Wed, 15 Jul 2015 12:08:30 GMT
< Server: Apache/2.4.12 (Win32) OpenSSL/1.0.1m
< X-Distributor: AHC
< Content-Length: 219
< Content-Type: text/html; charset=iso-8859-1
<
* Connection #0 to host localhost left intact
fatal: repository 'http://localhost/project.git/' not found
Any Idea why this happens?
your question: GIT_PROJECT_ROOT Is it set to the root directory of your repository?
as as I understood the Git sources will hosted on the Apche server under ...\Apache24\htdocs and there I have created my git project so that I now have:
\Apache24\htdocs\project.git
I want to download the \Apache24\htdocs\project.git to an other repository in c:\Git\Project
using following command:
GIT_CURL_VERBOSE=1 git fetch http://git@localhost/project.git
the question is what is now GIT_PROJECT_ROOT ?
...\Apache24\htdocs\project.git ?
or
in c:\Git\Project ?
thx
Adel
thx
Adel
Christine Makasy
Jul 22 '15, 7:09 a.m.Hi Adel,
in this case your Project Root Directory is ..\Apache24\htdocs\, The directory from which you clone, pull and to which you push.
In the fetch command you need the port, that means something like http://<localhost>:8080/<yourProjectName>.git
Cheers,
Christine
Adel Salah
Aug 09 '15, 10:49 a.m.Hi Christine,
now everything is fine except the git http-push -:(
I got following error:
fatal: unable to access 'http://git@localhost:8080/git/project.git/': The reques
ted URL returned error: 403
details:
$ GIT_CURL_VERBOSE=1 git push http://git@localhost:8080/git/project.git a26c961
30778f305cd534cabce8427257f09bbb8:master
* Trying ::1...
* Connected to localhost (::1) port 8080 (#0)
> GET /git/project.git/info/refs?service=git-receive-pack HTTP/1.1
User-Agent: git/1.9.5.msysgit.1
Host: localhost:8080
Accept: */*
Accept-Encoding: gzip
Pragma: no-cache
< HTTP/1.1 403 Forbidden
< Date: Wed, 22 Jul 2015 13:57:11 GMT
< Server: Apache/2.4.12 (Win32) OpenSSL/1.0.1m
< X-Distributor: AHC
< Expires: Fri, 01 Jan 1980 00:00:00 GMT, Fri, 01 Jan 1980 00:00:00 GMT
< Pragma: no-cache, no-cache
< Cache-Control: no-cache, max-age=0, must-revalidate, no-cache, max-age=0, must
-revalidate
< Content-Length: 0
< Content-Type: application/x-msdownload
<
* Connection #0 to host localhost left intact
fatal: unable to access 'http://git@localhost:8080/git/project.git/': The reques
ted URL returned error: 403
Apache -> error.log
::1 - - [22/Jul/2015:14:57:21 +0200] "GET /project.git/ HTTP/1.1" 200 2364
::1 - - [22/Jul/2015:14:57:45 +0200] "GET /project.git/_netrc HTTP/1.1" 200 42
::1 - - [22/Jul/2015:14:57:45 +0200] "GET /git/ HTTP/1.1" 404 -
::1 - - [22/Jul/2015:14:57:51 +0200] "GET /project.git/ HTTP/1.1" 200 2364
::1 - - [22/Jul/2015:15:22:57 +0200] "GET /git/project.git/info/refs?service=git-receive-pack HTTP/1.1" 403 -
::1 - - [22/Jul/2015:15:50:45 +0200] "GET /git/project.git/info/refs?service=git-receive-pack HTTP/1.1" 403 -
::1 - - [22/Jul/2015:15:57:11 +0200] "GET /git/project.git/info/refs?service=git-receive-pack HTTP/1.1" 403 -
thx for ur support
Adel
Christine Makasy
Jul 23 '15, 9:08 a.m.Hi Adel,
Please check whether the user has read/write access to the repository. (checking the function set rw access to the world)
Cheers, Christine
Adel Salah
Aug 09 '15, 10:49 a.m.Hi Christine,
where to set the rw access in the httpd.conf?
could you plz. write how to do that excatly?
plz. note that I am working on a windows 7 workstation.
I attached the apache config file to the mail which I got from Jazz.
may you take a look plz. and let me know what is going wrong.
the problem is still that push doesn't work from the local git repository to the bare repository (on the apache server).
thx a lot.
Adel
Christine Makasy
Jul 28 '15, 10:15 a.m.Hi Adel, please go to your directory structure where you can find your git repo and execute the command chmod -R 666 <yourGitRepo>
Cheers, Christine
Adel Salah
Aug 09 '15, 10:51 a.m.Hello Christine,
many thx for your support.
I am doing the integration under Windows 7, means no chmod.
The good news and the situation is now following:
the Git part is working well means I am able to commit/push from my local repository into http bar repository:
http://localhost:8080/project.git
Now I am trying to use ValidatePush.py and AssosiateWorkitem.py to create a link to a workitem on the RTC server and at that point I just got:
HTTP Error 500: Internal Server Error
which means a lot ....
Maybe you have an Idea what is going wrong?
I keep you informed.
thx
Adel
Adel Salah
Aug 09 '15, 10:52 a.m.Hi Christine,
just to understand the Git configuration:
local Repo: C:\Git\Project
c:\Git\Project>ls -la
Directory of c:\Git\Project
drwxr-xr-x 1 asa Administ 4096 Jul 29 10:04 .git
-rw-r--r-- 1 asa Administ 12 Jul 9 11:08 file1.txt
-rw-r--r-- 1 asa Administ 14 Jul 22 10:36 file2.txt
-rw-r--r-- 1 asa Administ 14 Jul 22 10:36 file3.txt
.
c:\Git\Project>ls .git
Directory of c:\Git\Project\.git
28.07.2015 17:06 17 COMMIT_EDITMSG
28.07.2015 17:56 603 config
28.07.2015 14:06 604 config.bak
09.07.2015 11:07 73 description
28.07.2015 14:30 91 FETCH_HEAD
09.07.2015 11:07 23 HEAD
28.07.2015 14:39 <DIR> hooks
28.07.2015 17:25 713 index
09.07.2015 11:07 <DIR> info
09.07.2015 11:10 <DIR> logs
28.07.2015 17:25 <DIR> objects
28.07.2015 14:30 41 ORIG_HEAD
22.07.2015 10:32 <DIR> refs
now bar Repository:
C:\Programme\Apache24\htdocs\project.git>ls
Volume in drive C has no label.
Volume Serial Number is 8ECE-4743
Directory of C:\Programme\Apache24\htdocs\project.git
24.07.2015 14:50 <DIR> .
24.07.2015 14:50 <DIR> ..
22.07.2015 14:44 42 .netrc
27.07.2015 11:52 592 config
15.07.2015 12:14 73 description
24.07.2015 13:40 0 FETCH_HEAD
15.07.2015 12:14 23 HEAD
15.07.2015 12:14 <DIR> hooks
28.07.2015 17:26 <DIR> info
28.07.2015 17:26 <DIR> objects
15.07.2015 12:14 <DIR> refs
24.07.2015 14:50 42 _netrc
22.07.2015 14:44 42 _netrc.bak
7 File(s) 814 bytes
6 Dir(s) 139.378.188.288 bytes free
ist the variable GIT_PROJECT_ROOT
GIT_PROJECT_ROOT=C:\Programme\Apache24\htdocs
or
GIT_PROJECT_ROOT=C:\Programme\Apache24\htdocs\project.git
btw. git offers the excutable chmod so I just run
chmod -R 666
in C:\Programme\Apache24\htdocs\project.git
is that what you mean?
thx
Adel
Christine Makasy
Jul 29 '15, 4:27 a.m.Hi Adel,
just run chmod -R 777 C:\Programme\Apache24\htdocs\project.git. (Take the 777 because there are some hooks within the repo that nned to be executed
Validating and Associating Work Items to your push means that you need access to RTC. Here please perform "grant access to all users" in the git section of RTC.
Cheers, Christine
Adel Salah
Aug 09 '15, 10:51 a.m.Hi Christine,
at the moment it looks fine:
I executed follwing commands without errors but nothing happens on the server:
ValidatePush:
C:\Programme\Apache24\htdocs\project.git>py.exe C:\Programme\RTC-GIT-Hooks-5.0.2\ValidatePush.py <o:p> </o:p>
"https://clm.peiker.local:9443/ccm" "08eb28aacd7b4454bd88bf4c11f25076" "asa" <o:p> </o:p>
"0000000000000000000000000000000000000000" "c31b0b793519eb8b9bc490edf7de254b1c485ee3" "master" ""
<o:p> </o:p> AssociateWorkitem: <o:p> </o:p>
C:\Programme\Apache24\htdocs\project.git>py.exe C:\Programme\RTC-GIT-Hooks-5.0.2\AssociateWorkitem.py <o:p> </o:p>
"https://clm.peiker.local:9443/ccm" "08eb28aacd7b4454bd88bf4c11f25076" "asa" <o:p> </o:p>
"0000000000000000000000000000000000000000" "c31b0b793519eb8b9bc490edf7de254b1c485ee3" "master" ""
plz. note that I puted the comment (git commit -m "Comments with WorkItem 279) in the commit ID c31b0b793519eb8b9bc490edf7de254b1c485ee3
any Idea what to do else?
thx
Adel
Adel Salah
Aug 09 '15, 10:51 a.m.after set a python debuger
Debuger:
C:\Programme\Apache24\htdocs\project.git>py.exe C:\Programme\RTC-GIT-Hooks-5.0.2\ValidatePush.py "https://clm.peiker.local:9443/ccm"
"08eb28aacd7b4454bd88bf4c11f25076" "asa" "0000000000000000000000000000000000000000" "c31b0b793519eb8b9bc490edf7de254b1c485ee3" "master"
('https://clm.peiker.local:9443/ccm', '08eb28aacd7b4454bd88bf4c11f25076', 'asa', '0000000000000000000000000000000000000000',
'c31b0b793519eb8b9bc490edf7de254b1c485ee3', 'master', None)
('Checking for Reg exp ', None)
('Is not a regexp',)
('In getCommits: ',)
('In getParamsForPush', ['c31b0b793519eb8b9bc490edf7de254b1c485ee3'])
('Executing command: ', ['git', 'log', '-n 1', '--pretty=format:"%B"', 'c31b0b793519eb8b9bc490edf7de254b1c485ee3'])
('Executing command: ', ['git', 'log', '-n 1', '--pretty=format:"%cn"', 'c31b0b793519eb8b9bc490edf7de254b1c485ee3'])
('Executing command: ', ['git', 'log', '-n 1', '--pretty=format:"%ce"', 'c31b0b793519eb8b9bc490edf7de254b1c485ee3'])
('Executing command: ', ['git', 'log', '-n 1', '--pretty=format:"%cd"', 'c31b0b793519eb8b9bc490edf7de254b1c485ee3'])
('Executing command: ', ['git', 'rev-parse', '--git-dir'])
('getAssociateWIUrl(): Could not switch to git repository path',)
('checking isPushNewBranch',)
('data: ', 'commitSha1=c31b0b793519eb8b9bc490edf7de254b1c485ee3&commitComment=Comments+with+WorkItem+279%0A&committerName=Adel+Salah&
committerEmail=%22Adel.Salah%40peiker.de%22&remoteRef=master&creationDate=%22Wed+Jul+29+10%3A04%3A48+2015+%2B0200%22&
gitUser=asa&repositoryKey=08eb28aacd7b4454bd88bf4c11f25076&baseRevSha1=0000000000000000000000000000000000000000&
endRevSha1=c31b0b793519eb8b9bc490edf7de254b1c485ee3&opHint=branch_create')
('Executing command: ', ['git', 'rev-parse', '--git-dir'])
('getValidatePushUrl(): Could not switch to git repository path',)
HTTP Error 500: Internal Server Error
br
Adel
Christine Makasy
Jul 29 '15, 8:40 a.m.Hi Adel,
first question: Have you added the hooks in the hooks directory of your git repo (not the clone) and you did the needed modifications as described in the hooks documentation?
Then try the push with one of these key words (task, defect) instead of WorkItem in the commit comment.
Christine
Adel Salah
Aug 09 '15, 10:50 a.m.unfortunately it doesn't work neither with comment nor with fix:
C:\Programme\Apache24\htdocs\project.git>py.exe C:\Programme\RTC-GIT-Hooks-5.0.2\ValidatePush.py "https://clm.peiker.local:9443/ccm" "08eb28aacd7b4454bd88bf4c11f25076"
"asa" "0000000000000000000000000000000000000000" "f19b6034ecac210111a84621d5d7e8f6a90c2ea7" "master"
('https://clm.peiker.local:9443/ccm', '08eb28aacd7b4454bd88bf4c11f25076', 'asa', '0000000000000000000000000000000000000000', 'f19b6034ecac210111a84621d5d7e8f6a90c2ea7', 'master', None)
('Checking for Reg exp ', None)
('Is not a regexp',)
('In getCommits: ',)
('In getParamsForPush', ['f19b6034ecac210111a84621d5d7e8f6a90c2ea7'])
('Executing command: ', ['git', 'log', '-n 1', '--pretty=format:"%B"', 'f19b6034ecac210111a84621d5d7e8f6a90c2ea7'])
('Executing command: ', ['git', 'log', '-n 1', '--pretty=format:"%cn"', 'f19b6034ecac210111a84621d5d7e8f6a90c2ea7'])
('Executing command: ', ['git', 'log', '-n 1', '--pretty=format:"%ce"', 'f19b6034ecac210111a84621d5d7e8f6a90c2ea7'])
('Executing command: ', ['git', 'log', '-n 1', '--pretty=format:"%cd"', 'f19b6034ecac210111a84621d5d7e8f6a90c2ea7'])
('Executing command: ', ['git', 'rev-parse', '--git-dir'])
('getAssociateWIUrl(): Could not switch to git repository path',)
('checking isPushNewBranch',)
('data: ', 'commitSha1=f19b6034ecac210111a84621d5d7e8f6a90c2ea7&commitComment=fix+for+task+279%0A&committerName=Adel+Salah&committerEmail=%22Adel.Salah%40peiker.de%22&remoteRef=master&creationDate=%22Wed+Jul+29+14%3A50%3A28+2015+%2B0200%22&gitUs
er=asa&repositoryKey=08eb28aacd7b4454bd88bf4c11f25076&baseRevSha1=0000000000000000000000000000000000000000&endRevSha1=f19b6034ecac210111a84621d5d7e8f6a90c2ea7&opHint=branch_create')
('Executing command: ', ['git', 'rev-parse', '--git-dir'])
('getValidatePushUrl(): Could not switch to git repository path',)
HTTP Error 500: Internal Server Error
br
Adel
Christine Makasy
Jul 29 '15, 9:25 a.m.Please go to RTC again and grant access to the git repos for all users again.
Christine.
Adel Salah
Aug 09 '15, 10:50 a.m.Christine Makasy
Jul 29 '15, 9:57 a.m.Sorry, but I have no idea, the RTC Server has the right URL?
Christine Makasy
Aug 06 '15, 6:29 a.m.Hi Adel,
sorry, but I never used git hooks on a windows system. In the IBM article https://jazz.net/library/article/1479 there is a link included where to find LibGit2 (https://libgit2.github.com/). Hope this helps.
Christine